Provider error while trying to configure terragrunt in Atlantis CI #19
-
|
This message was extracted from a discussion that originally took place in Gruntwork Community Slack. Names and URLs have been removed where appropriate From a customer Good morning. A basic question, sorry. I get errors using some of your account-baseline modules, due to an aws provider block embedded in the code that does not have any profile information. I assume the credentials should be taken from the root module (where the profile is defined) but it seems this doesn't happen. How would you expect me to pass the right credentials to that child module? In your module repo: https://github.com/gruntwork-io/terraform-aws-security/blob/master/modules/aws-config-multi-region/main.tf I am a bit confused since from the documentation it looks like no provider should be defined in a module: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
From a grunt Ah so with our Landing Zone modules, because there are resources that need to be deployed in every region, we need to define the providers inside the modules so that the user doesn’t have the burden of defining R providers, one for each region. This is indeed an anti-pattern according to terraform, and we are working on refactoring the multi-region approach to not need this (which is now possible thanks to new features in terraform 0.15). In general, we recommend using an external tool that handles the AWS credentials and feeds it to the CLI via environment variables (e.g., aws-vault). If you do wish to use the credentials file with profiles, you should be able to make it work if you set the BTW, feel free to ask basic questions as well! It's perfectly reasonable. We're working on a way to make it easier to find answers. |
Beta Was this translation helpful? Give feedback.
From a grunt
Ah so with our Landing Zone modules, because there are resources that need to be deployed in every region, we need to define the providers inside the modules so that the user doesn’t have the burden of defining R providers, one for each region.
This is indeed an anti-pattern according to terraform, and we are working on refactoring the multi-region approach to not need this (which is now possible thanks to new features in terraform 0.15).
In general, we recommend using an external tool that handles the AWS credentials and feeds it to the CLI via environment variables (e.g., aws-vault).
If you do wish to use the credentials file with profiles, you should be able to make it wor…