I am using CDKTF and python for a project where I am generating JSON output that will be interpreted by Terraform.
I have a use case where I need to send in multiple aliased AWS providers. I am able to specify a single provider to the stack by using the add_provider
method but I cannot add a secondary aliased provider without using add_override
.
Is there a way for me to do this without getting name conflicts in the keys where CDKTF gives an error that I am specifying the aws
key twice.
Basically I am asking if there is a way for me to specify the key I use when specifying the keys in providers so that I get something like:
"providers": {
"aws": "aws.account-one",
"aws.two": "aws.account-two"
}
Kindly let me know if I am doing this wrong.
Thanks in advance.
With CDKTF you can specify multiple providers like this:
This is documented in the examples: https://github.com/hashicorp/terraform-cdk/blob/main/examples/typescript/aws-cloudfront-proxy/main.ts