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 } 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 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 } 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 } 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" }