I wrote a two part blog about Terraform AWS Tags best practices and workarounds for bugs.
https://blog.rocketinsights.com/best-practices-for-terraform-aws-tags/
https://blog.rocketinsights.com/best-practices-for-terraform-aws-tags-part-2/
I wrote a two part blog about Terraform AWS Tags best practices and workarounds for bugs.
https://blog.rocketinsights.com/best-practices-for-terraform-aws-tags/
https://blog.rocketinsights.com/best-practices-for-terraform-aws-tags-part-2/
provider "aws" { region = "us-east-1" } resource "aws_dynamodb_table" "dynamodb-terraform-lock-example" { name = "terraform-lock-example" hash_key = "LockID" read_capacity = 5 write_capacity = 5 attribute { name = "LockID" type = "S" } tags { Name = "Terraform Lock Table Example" Org = "JavaJirawat" } }
terraform { backend "s3" { bucket = "terraform-s3-tfstate-example" region = "us-east-1" key = "example/ec2-with-locking/terraform.tfstate" dynamodb_table = "terraform-lock-example" encrypt = true } } provider "aws" { region = "us-east-1" } # Amazon Linux AMI resource "aws_instance" "ec2-with-locking-example" { count = 1 ami = "ami-a4c7edb2" instance_type = "t2.micro" lifecycle { create_before_destroy = true } tags { Name = "Example for DynamoDB lock" Org = "JavaJirawat" } }
provider "aws" { region = "us-east-1" } resource "aws_s3_bucket" "s3-tfstate-example" { bucket = "terraform-s3-tfstate-example" acl = "private" versioning { enabled = true } lifecycle { prevent_destroy = true } tags { Name = "Terraform S3 tfstate Example" Org = "JavaJirawat" } }
terraform { backend "s3" { bucket = "terraform-s3-tfstate-example" region = "us-east-1" key = "example/ec2/terraform.tfstate" encrypt = true } } provider "aws" { region = "us-east-1" } # Amazon Linux AMI resource "aws_instance" "ec2-example" { count = 1 ami = "ami-a4c7edb2" instance_type = "t2.micro" lifecycle { create_before_destroy = true } tags { Name = "Example for S3 tfstate" Org = "JavaJirawat" } }