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

Complete example not working #12

Closed
nicolaevladescu opened this issue Apr 29, 2021 · 4 comments
Closed

Complete example not working #12

nicolaevladescu opened this issue Apr 29, 2021 · 4 comments
Labels
bug 🐛 An issue with the system

Comments

@nicolaevladescu
Copy link

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

│ Error: Invalid for_each argument
│
│   on .terraform/modules/assignments/modules/account-assignments/main.tf line 30, in resource "aws_ssoadmin_account_assignment" "this":
│   30:   for_each = local.assignment_map
│     ├────────────────
│     │ local.assignment_map will be known only after apply
│
│ The "for_each" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to
│ first apply only the resources that the for_each depends on.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Clone this repository
  2. cd ./examples/complete
  3. Modify main.tf to replace boilerplate with actual group names and real AWS account ids
  4. terraform init
  5. terraform plan
  6. See error

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: Debian 10 on WSL
  • Terraform version: 0.15.1
@nicolaevladescu nicolaevladescu added the bug 🐛 An issue with the system label Apr 29, 2021
@jgrumboe
Copy link
Contributor

jgrumboe commented May 18, 2021

Got the same with TF 0.14.6.
It's because the example relays on module output https://github.com/cloudposse/terraform-aws-sso/blob/master/examples/complete/main.tf#L33 and the arn of the permissionset is only known after apply.
I switched back to using 0.2.1.
Edit: sorry, just saw that there's already PR #13
Will try it

@nitrocode
Copy link
Member

nitrocode commented Jun 11, 2021

The example in the repo should work now.

Could you confirm? @nicolaevladescu @jgrumboe

@jgrumboe
Copy link
Contributor

jgrumboe commented Jun 14, 2021

@nitrocode
No, example/complete isn't working, because new value permission_set_name is missing in examples/complete/main.tf.
We missed that in the PR.

@mcalhoun
Copy link
Member

Fixed in #13 and #20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants