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

Missing partition and account_id locals in multiple sub-modules in 5.5.2 #289

Closed
1 task done
enver opened this issue Oct 16, 2022 · 2 comments · Fixed by #290
Closed
1 task done

Missing partition and account_id locals in multiple sub-modules in 5.5.2 #289

enver opened this issue Oct 16, 2022 · 2 comments · Fixed by #290

Comments

@enver
Copy link
Contributor

enver commented Oct 16, 2022

Description

There are several local values missing in sub-modules as a consequence of merging #283.

I.e. running terraform init && terraform plan on 5.5.2 produces following error:

data.aws_iam_policy_document.custom_trust_policy: Reading...
module.iam_assumable_role_custom.data.aws_iam_policy_document.assume_role[0]: Reading...
module.iam_assumable_role_sts.data.aws_iam_policy_document.assume_role_with_mfa[0]: Reading...
data.aws_iam_policy_document.custom_trust_policy: Read complete after 1s [id=408100223]
module.iam_assumable_role_custom.data.aws_iam_policy_document.assume_role[0]: Read complete after 0s [id=2535048448]
module.iam_assumable_role_sts.data.aws_iam_policy_document.assume_role_with_mfa[0]: Read complete after 0s [id=1700556763]
module.iam_assumable_role_custom_trust_policy.data.aws_iam_policy_document.assume_role[0]: Reading...
module.iam_assumable_role_custom_trust_policy.data.aws_iam_policy_document.assume_role[0]: Read complete after 0s [id=2783130461]
╷
│ Error: Reference to undeclared local value
│
│   on ../../modules/iam-assumable-role/main.tf line 76, in data "aws_iam_policy_document" "assume_role_with_mfa":
│   76:         values   = ["arn:${local.partition}:iam::${local.account_id}:role${var.role_path}${local.role_name_condition}"]
│
│ A local value with the name "partition" has not been declared.
╵
╷
│ Error: Reference to undeclared local value
│
│   on ../../modules/iam-assumable-role/main.tf line 76, in data "aws_iam_policy_document" "assume_role_with_mfa":
│   76:         values   = ["arn:${local.partition}:iam::${local.account_id}:role${var.role_path}${local.role_name_condition}"]
│
│ A local value with the name "account_id" has not been declared.
╵
  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version 5.5.2

  • Terraform version: ANY

  • Provider version(s): ANY

Reproduction Code [Required]

  • Go to examples/iam-assumable-role
  • Run terraform init && terraform plan

Steps to reproduce the behavior:

See bove

Expected behavior

Terrform should produce a clean plan

Actual behavior

It fails with error A local value with the name "partition" and "account_id" has not been declared.

Terminal Output Screenshot(s)

Additional context

See #283

@antonbabenko
Copy link
Member

This issue has been resolved in version 5.5.5 🎉

@github-actions
Copy link

github-actions bot commented Dec 2, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants