Your company runs services in AWS across 3 different regions. The DevOps team manages a stack of 30 CloudWatch alarms for every region, which means, (3 regions) * (30 alarms) = 90 different alarms.
- This project create CloudWatch alarms with jenkins pipeline in the region you choose.
- You can create and destroy resources with terraform.
- separate state for each region to avoid collision with workspaces.
tf_alarm/
├── alarms.Jenkinsfile
├── environments
│ ├── dev.tfvars
│ └── prod.tfvars
├── main.tf
├── backend.tf
├── outputs.tf
├── regions
│ ├── eu-central-1-prod.tfvars
│ ├── us-east-1-dev.tfvars
│ ├── us-east-1-prod.tfvars
│ └── us-west-1-prod.tfvars
└── variables.tf
main.tf
contains configurations of 3 CloudWatch alarms, as well as sns topicbackend.tf
contain Terraform block with the relevant provider and an S3 backendvariables.tf
andoutputs.tf
: contain variable definitions and outputsenvironments
directory: contains .tfvars files with per-env variable assignmentsregions
directory: contains .tfvars files with per-region variable assignmentsalarms.Jenkinsfile
: an almost ready-to-use Jenkinsfile to integrate the alarms pipeline in your Jenkins server