terraform to work on two aws accounts code example
Example: multiple aws accounts terraform
####Use Multiple Accounts Launch for resource
provider "aws" {
region = "us-west-1"
access_key = "PUT-ACCESS-KEY"
secret_key = "PUT-SECRET-KEY"
}
provider "aws" {
alias = "mumbai"
region = "ap-south-1"
profile = "ACCOUNT-NAME"
}
resource "aws_eip" "eip1" {
vpc = "true"
}
resource "aws_eip" "eip2" {
vpc = "true"
provider = aws.mumbai
}