Skip to content

Commit

Permalink
Merge pull request #216 from cisagov/improvement/alphabetize_attributes
Browse files Browse the repository at this point in the history
Alphabetize Terraform attributes
  • Loading branch information
mcdonnnj authored May 1, 2024
2 parents 74a335e + 3f1c503 commit f9ec86e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 35 deletions.
10 changes: 5 additions & 5 deletions examples/basic_usage/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
output "arn" {
value = module.example.arn
description = "The EC2 instance ARN."
value = module.example.arn
}

output "availability_zone" {
value = module.example.availability_zone
description = "The AZ where the EC2 instance is deployed."
value = module.example.availability_zone
}

output "id" {
value = module.example.id
description = "The EC2 instance ID."
value = module.example.id
}

output "private_ip" {
value = module.example.private_ip
description = "The private IP of the EC2 instance."
value = module.example.private_ip
}

output "subnet_id" {
value = module.example.subnet_id
description = "The ID of the subnet where the EC2 instance is deployed."
value = module.example.subnet_id
}
18 changes: 9 additions & 9 deletions examples/basic_usage/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# ------------------------------------------------------------------------------

variable "tf_role_arn" {
type = string
description = "The ARN of the role that can terraform non-specialized resources."
type = string
}

# ------------------------------------------------------------------------------
Expand All @@ -16,27 +16,27 @@ variable "tf_role_arn" {
# ------------------------------------------------------------------------------

variable "ami_owner_account_id" {
type = string
description = "The ID of the AWS account that owns the AMI, or \"self\" if the AMI is owned by the same account as the provisioner."
default = "self"
description = "The ID of the AWS account that owns the AMI, or \"self\" if the AMI is owned by the same account as the provisioner."
type = string
}

variable "aws_availability_zone" {
type = string
description = "The AWS availability zone to deploy into (e.g. a, b, c, etc.)."
default = "a"
description = "The AWS availability zone to deploy into (e.g. a, b, c, etc.)."
type = string
}

variable "aws_region" {
type = string
description = "The AWS region to deploy into (e.g. us-east-1)."
default = "us-east-1"
description = "The AWS region to deploy into (e.g. us-east-1)."
type = string
}

variable "tags" {
type = map(string)
description = "Tags to apply to all AWS resources created."
default = {
Testing = true
}
description = "Tags to apply to all AWS resources created."
type = map(string)
}
6 changes: 3 additions & 3 deletions examples/basic_usage/versions.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
terraform {
# We want to hold off on 1.1 or higher until we have tested it.
required_version = "~> 1.0"

# If you use any other providers you should also pin them to the
# major version currently being used. This practice will help us
# avoid unwelcome surprises.
Expand All @@ -20,4 +17,7 @@ terraform {
version = "~> 4.9"
}
}

# We want to hold off on 1.1 or higher until we have tested it.
required_version = "~> 1.0"
}
2 changes: 1 addition & 1 deletion examples/basic_usage/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ resource "aws_vpc" "example" {
resource "aws_subnet" "example" {
availability_zone = "${var.aws_region}${var.aws_availability_zone}"
cidr_block = "10.230.0.0/28"
vpc_id = aws_vpc.example.id
tags = { "Name" : "Example" }
vpc_id = aws_vpc.example.id
}
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ data "aws_ami" "example" {
values = ["ebs"]
}

most_recent = true
owners = [
var.ami_owner_account_id
]
most_recent = true
}

# The default tags configured for the default provider
Expand All @@ -40,8 +40,8 @@ data "aws_default_tags" "default" {}
# The example EC2 instance
resource "aws_instance" "example" {
ami = data.aws_ami.example.id
instance_type = "t3.micro"
availability_zone = "${var.aws_region}${var.aws_availability_zone}"
instance_type = "t3.micro"
subnet_id = var.subnet_id

# The tag or tags specified here will be merged with the provider's
Expand Down
10 changes: 5 additions & 5 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
output "arn" {
value = aws_instance.example.arn
description = "The EC2 instance ARN."
value = aws_instance.example.arn
}

output "availability_zone" {
value = aws_instance.example.availability_zone
description = "The AZ where the EC2 instance is deployed."
value = aws_instance.example.availability_zone
}

output "id" {
value = aws_instance.example.id
description = "The EC2 instance ID."
value = aws_instance.example.id
}

output "private_ip" {
value = aws_instance.example.private_ip
description = "The private IP of the EC2 instance."
value = aws_instance.example.private_ip
}

output "subnet_id" {
value = aws_instance.example.subnet_id
description = "The ID of the subnet where the EC2 instance is deployed."
value = aws_instance.example.subnet_id
}
14 changes: 7 additions & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# ------------------------------------------------------------------------------

variable "subnet_id" {
type = string
description = "The ID of the AWS subnet to deploy into (e.g. subnet-0123456789abcdef0)."
type = string
}

# ------------------------------------------------------------------------------
Expand All @@ -15,19 +15,19 @@ variable "subnet_id" {
# These parameters have reasonable defaults.
# ------------------------------------------------------------------------------
variable "ami_owner_account_id" {
type = string
description = "The ID of the AWS account that owns the Example AMI, or \"self\" if the AMI is owned by the same account as the provisioner."
default = "self"
description = "The ID of the AWS account that owns the Example AMI, or \"self\" if the AMI is owned by the same account as the provisioner."
type = string
}

variable "aws_availability_zone" {
type = string
description = "The AWS availability zone to deploy into (e.g. a, b, c, etc.)."
default = "a"
description = "The AWS availability zone to deploy into (e.g. a, b, c, etc.)."
type = string
}

variable "aws_region" {
type = string
description = "The AWS region to deploy into (e.g. us-east-1)."
default = "us-east-1"
description = "The AWS region to deploy into (e.g. us-east-1)."
type = string
}
6 changes: 3 additions & 3 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
terraform {
# We want to hold off on 1.1 or higher until we have tested it.
required_version = "~> 1.0"

# If you use any other providers you should also pin them to the
# major version currently being used. This practice will help us
# avoid unwelcome surprises.
Expand All @@ -20,4 +17,7 @@ terraform {
version = "~> 4.9"
}
}

# We want to hold off on 1.1 or higher until we have tested it.
required_version = "~> 1.0"
}

0 comments on commit f9ec86e

Please sign in to comment.