terraform for_each code example
Example: repetitive resource use in different region terraform
####Repeat Resource block and launch in multiple regions
provider "aws" {
region = "us-west-1"
access_key = "PUT-ACCESS-KEY"
secret_key = "PUT-SECRET-KEY"
}
provider "aws" {
alias = "mumbai"
region = "ap-south-1"
access_key = "PUT-ACCESS-KEY"
secret_key = "PUT-SECRET-KEY"
}
resource "aws_eip" "eip1" {
vpc = "true"
}
resource "aws_eip" "eip2" {
vpc = "true"
provider = aws.mumbai
}