Skip to content
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

core: fix provider config inheritence for deeply nested modules #6186

Merged
merged 1 commit into from
Apr 18, 2016

Conversation

phinze
Copy link
Contributor

@phinze phinze commented Apr 14, 2016

The flattening process was not properly drawing dependencies between provider
nodes in modules and their parent provider nodes.

Fixes #2832
Fixes #4443
Fixes #4865

}

func (n *graphNodeDisabledProviderFlat) DependentOn() []string {
var result []string

// If we're in a module, then depend on our parent's provider
if len(n.PathValue) > 1 {
prefix := modulePrefixStr(n.PathValue[:len(n.PathValue)-1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build failure (terraform/transform_provider.go:357: undefined: prefix) seems related to this?

@jen20
Copy link
Contributor

jen20 commented Apr 15, 2016

@phinze looks like the build error here is correct and there is a stray deletion in the diff?

@phinze
Copy link
Contributor Author

phinze commented Apr 15, 2016

Yeah final pre-push cleanup was a little overzealous - fixing! 😄

The flattening process was not properly drawing dependencies between provider
nodes in modules and their parent provider nodes.

Fixes #2832
Fixes #4443
Fixes #4865
@phinze phinze force-pushed the phinze/fix-grandchild-module-providers branch from 52a5d6c to 813dc16 Compare April 15, 2016 16:20
@phinze
Copy link
Contributor Author

phinze commented Apr 15, 2016

Ok green now, @jen20 PTAL!

@jen20
Copy link
Contributor

jen20 commented Apr 18, 2016

This LGTM now.

@jen20 jen20 merged commit ddf794b into master Apr 18, 2016
@jen20 jen20 deleted the phinze/fix-grandchild-module-providers branch April 18, 2016 23:19
@evilezh
Copy link

evilezh commented May 26, 2016

There is still bug with nested modules (0.6.16)
After I've created module, I did comment out it (so it should get destroyed).
here is structure:
root level: AWS defined, include of module level 2.
level 2: include several modules from level 3 (nothing else)
level 3: do aws stuff

When I ask to destroy:

terraform apply

provider.aws.region
The region where AWS operations will take place. Examples
are us-east-1, us-west-2, etc.

Default: us-east-1
Enter a value:

I enter my value and then it runs refresh nicely through refresh state, but when it should start doing actual changes, then:
Error refreshing state:

  • 1 error(s) occurred:

* No valid credential sources found for AWS Provider.
Please see https://terraform.io/docs/providers/aws/index.html for more information on
providing credentials for the AWS Provider

@hatt
Copy link

hatt commented Aug 31, 2016

Seeing the same as @evilezh, extra confusing when the provider is repeatedly asking which region to use with no context as to which module instance it's even referencing. Running on 0.7.3-dev (git commit 70d9fe8).

@ghost
Copy link

ghost commented Apr 22, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants