-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS Provider in v0.5.3 - Credentials can't be used in modules #2445
Comments
This should be fixed now. |
Please let me know if it isn't. The PRs are out there to fix this! |
@mitchellh - Confused as this is present in 0.5.3 which is the latest release yes? How do I figure out which pull request to use? |
Should be fixed now! |
Apologies - not sure I understand. What version of the application is the bug fixed in? Absent a version, does that mean only in master? Sorry! |
No problem Tim. It just means that is in Git, slated for the next release. We'll be releasing 0.6.0 soon, so that is the release it will be in. |
Was this fix available in v0.6.4? I just hit something that seems like an identical bug. I have a top-level module called A that includes a module called B. Module B contains a single
If I add any resource to Module B, the error goes away. |
I'm seeing the same as @brikis98 in v0.6.6 |
bump re: v0.6.6 on Atlas ... except I can't make the error go away.
and still, when I "terraform push", Atlas gives me (representative errors)
|
Update: ... and when, in Atlas, I set the environment variables "AWS_ACCESS_KEY_ID" "AWS_SECRET_ACCESS_KEY" and "AWS_REGION" on the environment where I'm pushing my config, the errors all go away. So that explains why this has been working on my local machine, but not in Atlas. Also, very likely explains why, when I had a mismatch between those environment variables and the access_key / secret_key (terraform) variables, all hell broke loose and terraform created some of my resources in the wrong AWS account. (I mitigated that problem by using the allowed_account_ids parameter to provider "aws" |
I too am having this issue, using the stock atlas-examples/infrastructure project 01 with 0.6.6 @amotoohno, As a workaround, an ugly one, you can add the provider and region/access/secret into each main.tf of the module and it does work without using environment vars. |
I'm seeing this on v0.6.8 with region not being set. I'm building locally, not with Atlas.
Here is the structure of my project so far
Main.tf
Here is how I recreate the issue
If I run a plan without -input=false, I get asked several times for the region. After typing out the region, the plan will work.
Per @amotoohno's comment about setting environment variables locally, I can run the following and have a plan build successfully.
|
@mitchellh: Could you re-open this issue? I just hit it again on v0.6.8. Here is a simple repro case. Create the following files & folders:
Contents of
Contents of
Contents of
Run the following:
|
+1 I've just run into this as well in 0.6.11. |
+1 I've just noticed the exact same behavior in 0.6.12 |
@mitchellh @phinze please reopen this issue. I'm hitting on the exact issue that many (specifically @pgporada described above |
Hi @thegranddesign - sorry for the trouble! Is the issue you're seeing properly described in #4865? That's on my short list of issues to tackle soon. |
@phinze 100%! Thanks for the quick reply. I'll subscribe to that issue for updates. 😀 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I believe this is related to #1380
Basically if a top-level module declares and configures the AWS provider and does not also directly create an AWS resource, terraform gets confused about credentials not being set properly. Not sure if I am doing something wrong here or not. It does feel like a bug.
My directory structure is as follows:
main.tf:
variables.tf:
terraform.tfvars:
a/main.tf:
b/main.tf:
both a/variables.tf and b/variables.tf:
when I run:
I received as output:
If I uncomment the aws_security_group rule in a/main.tf I receive instead:
The text was updated successfully, but these errors were encountered: