Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
$ tf version
Terraform v0.12.29
+ provider.aws v3.5.0
Your version of Terraform is out of date! The latest version
is 0.13.2. You can update by downloading from https://www.terraform.io/downloads.html
Use-cases
for aws, if you use localstack for local testing in local or dev stage. you need to set various endpoints for aws provider like this.
and you want to use real aws for endpoints for other stages. eg. you have stages, dev、staging、prod 。
so you want to use localstack in dev stage, how do you set this ?
for set different config backends for different stages, this would help, but i don't find a effective way to implement different provider configs for different stages.
in simple terms, what i want to achieve is (pseudo code):
Current Terraform Version
Use-cases
for aws, if you use localstack for local testing in local or dev stage. you need to set various endpoints for aws provider like this.
and you want to use real aws for endpoints for other stages. eg. you have stages, dev、staging、prod 。
so you want to use localstack in dev stage, how do you set this ?
for set different config backends for different stages, this would help, but i don't find a effective way to implement different provider configs for different stages.
in simple terms, what i want to achieve is (pseudo code):
Attempted Solutions
tried to set providers configs in different stages, but don't know how to reference it in main.tf.
for resource, you can use provider alias reference provider like
provider = aws.dev
, but how for provider config ?Proposal
References
https://github.com/terraform-providers/terraform-provider-aws/issues/15050