Terraform Providers
Providers are plugins that allow Terraform to integrate into different sources and types of cloud infrastructure. AWS is example of a provider.
Multiple Providers
There are multiple regions in AWS. To specify resources in different regions, define multiple terraform providers.
For example, there is a requirement that AWS CloudFront certificates must be issued in the us-east-1
.
provider "aws" {
region = "ap-southeast-1"
profile = "myapp"
}
provider "aws" {
region = "us-east-1"
alias = "us-east-1"
profile = "myapp"
}
Then the certificate resource can reference the relevant provider attribute. The first entry above is aws
while the second entry
is referred to as aws.us-east-1
resource "aws_acm_certificate" "www_example_com" {
domain_name = "www.example.com"
validation_method = "DNS"
provider = aws.us-east-1
}