Providing tags using Terraform - AMS Accelerate Operations Plan

Providing tags using Terraform

See the Terraform documentation on Resource Tagging for a full description of how to manage resource tags using Terraform.

The following is an example of how you can apply AMS Accelerate alarm management tags to an Amazon EC2 instance managed by Terraform.

resource "aws_instance" "test_linux_instance" { # ...ami and other properties... instance_type = "t3.micro" tags = { "ams-monitoring-policy" = "ams-monitored" "ams-monitoring-policy-platform" = "ams-monitored-linux" } }

The following is an example of how you can apply AMS alarm management tags to an Auto Scaling group managed by Terraform. Note that the Auto Scaling group will propagate its tags to EC2 instances that are created by it:

resource "aws_autoscaling_group" "test_asg" { name = "terraform-test" # ...other properties... tags = { "ams-monitoring-policy" = "ams-monitored" "ams-monitoring-policy-platform" = "ams-monitored-linux" } }