provider alias
A second, named configuration of the same provider, used when one configuration must talk to two regions or accounts.
In more detail
You write a second provider block with an alias argument, then point individual resources or modules at it with provider = aws.<alias>. Resources without that argument use the default configuration.
Example
provider "aws" {
alias = "ireland"
region = "eu-west-1"
}Related terms
- provider block — A top-level block that configures a provider, for example which region or endpoint it talks to and which credentials it uses.
- region — A separate geographic area where a cloud provider runs data centres, such as eu-west-2 for London in AWS.
Taught in
- Providers And The required_providers Block — Infrastructure as Code with Terraform
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- Trap Sprint: Twelve Answers That Are Almost True — HashiCorp Terraform Associate (004) Exam Prep