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

'aws_iam_role.default' not found #4

Closed
FernandoMiguel opened this issue Nov 22, 2017 · 2 comments
Closed

'aws_iam_role.default' not found #4

FernandoMiguel opened this issue Nov 22, 2017 · 2 comments
Assignees

Comments

@FernandoMiguel
Copy link

I've used the default assumerole role name
OrganizationAccountAccessRole

data "aws_iam_role" "ecr" {
  name = "OrganizationAccountAccessRole"
}

and got the following error planning with TF 0.11

Error: Error running plan: 1 error(s) occurred:

* module.ecr.output.role_name: Resource 'aws_iam_role.default' not found for variable 'aws_iam_role.default.name'
@aknysh aknysh self-assigned this Dec 13, 2017
@aknysh
Copy link
Member

aknysh commented Dec 13, 2017

@FernandoMiguel thank you for evaluating the module.

Please update to Terraform 0.11.1.
It's a known issue in Terraform 0.11.0.

They made it a fatal error in 0.11.0 to reference a resource with count=0 even if that resource is not used.
hashicorp/terraform#16726

But then switched it to warning in 0.11.1
https://github.com/hashicorp/terraform/blob/v0.11.1/CHANGELOG.md

Since the new feature was already rolled out, and since development for 0.12 depends on the foundational changes that enabled it, we decided to compromise with an opt-out mechanism in 0.11.1, so those with configurations containing problematic output expressions have a means to use 0.11.1 without first fixing all modules. We understand that this is not the most ideal migration path -- if we could do this over again we would've introduced the warning in one of the 0.10 point releases -- but we hope that this compromise is acceptable so that we can continue to make progress towards 0.12.

To enable that behavior, you need to set the variable TF_WARN_OUTPUT_ERRORS=1

They mentioned they will make it an error again in 0.12, so it's a temporarily fix anyway.

But if they fix ternaries (to short-circuit and not evaluate left and right part at the same time), we can work around the issue very easily
hashicorp/hil#50

Please update to 0.11.1 and set TF_WARN_OUTPUT_ERRORS=1.

We'll close the issue for now, please let us know if that's addresses your question and if you have other questions or concerns.

@aknysh aknysh closed this as completed Dec 13, 2017
@FernandoMiguel
Copy link
Author

i'll give it a try again.
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants