From cf993f1d523b8237916d5539317c918fd90bd61d Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:57:50 -0500 Subject: [PATCH 1/5] Alphabetize resources attributes in main.tf --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 7f3b203..0646a05 100644 --- a/main.tf +++ b/main.tf @@ -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 @@ -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 From 8bbce64442a8541bebde6852b67b888422d67b1f Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:59:20 -0500 Subject: [PATCH 2/5] Alphabetize resource attributes in outputs.tf --- outputs.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/outputs.tf b/outputs.tf index 9d8af20..ce18699 100644 --- a/outputs.tf +++ b/outputs.tf @@ -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 } From 45869c35e63b1e602f074c19d4f3d34278404dd6 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:00:05 -0500 Subject: [PATCH 3/5] Alphabetize resource attributes in variables.tf --- variables.tf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/variables.tf b/variables.tf index 245aabb..416ad14 100644 --- a/variables.tf +++ b/variables.tf @@ -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 } # ------------------------------------------------------------------------------ @@ -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 } From b5f21797609260d1305915e82b705f9b27e82db4 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:10:32 -0500 Subject: [PATCH 4/5] Alphabetize resource attributes in versions.tf --- versions.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/versions.tf b/versions.tf index 80277d5..9db27b0 100644 --- a/versions.tf +++ b/versions.tf @@ -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. @@ -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" } From 3f1c503b5fdcc4a35804636f777db463c12bcf31 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:02:10 -0500 Subject: [PATCH 5/5] Alphabetize resource attributes in examples/basic_usage/ --- examples/basic_usage/outputs.tf | 10 +++++----- examples/basic_usage/variables.tf | 18 +++++++++--------- examples/basic_usage/versions.tf | 6 +++--- examples/basic_usage/vpc.tf | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/basic_usage/outputs.tf b/examples/basic_usage/outputs.tf index a815e68..542df31 100644 --- a/examples/basic_usage/outputs.tf +++ b/examples/basic_usage/outputs.tf @@ -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 } diff --git a/examples/basic_usage/variables.tf b/examples/basic_usage/variables.tf index 205df43..70b275a 100644 --- a/examples/basic_usage/variables.tf +++ b/examples/basic_usage/variables.tf @@ -5,8 +5,8 @@ # ------------------------------------------------------------------------------ variable "tf_role_arn" { - type = string description = "The ARN of the role that can terraform non-specialized resources." + type = string } # ------------------------------------------------------------------------------ @@ -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) } diff --git a/examples/basic_usage/versions.tf b/examples/basic_usage/versions.tf index 80277d5..9db27b0 100644 --- a/examples/basic_usage/versions.tf +++ b/examples/basic_usage/versions.tf @@ -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. @@ -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" } diff --git a/examples/basic_usage/vpc.tf b/examples/basic_usage/vpc.tf index b54ecfd..947e0eb 100644 --- a/examples/basic_usage/vpc.tf +++ b/examples/basic_usage/vpc.tf @@ -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 }