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

fix: Correct image_pull_secret dynamic block iterator #12

Merged
merged 1 commit into from
May 17, 2023

Conversation

carflo
Copy link
Contributor

@carflo carflo commented May 17, 2023

What does this PR do?

Fixes the iterator on the image_pull_secrets dynamic block.

Motivation

module "team" {
source = "github.com/aws-ia/terraform-aws-eks-blueprints-teams?ref=afc511ccb9c2b747fb05a79aeceb7c66be74cf6f"
//... omitting required inputs for brevity

  namespaces = {
    "team_a_ns" = {
      service_account = {
        image_pull_secrets = [{name = "image-pull-secret-docker"}]
      }
    }
  }
}

Produces the following error:

│ Error: Reference to undeclared resource
│
│   on .terraform/modules/team/main.tf line 207, in resource "kubernetes_service_account_v1" "this":
│  207:       name = secret.value.name

A managed resource "secret" "value" has not been declared in module.team.

I think the iterator should match the dynamic block name. Updating the terraform to use image_pull_secrets.value.name fixes the issue.

More

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I ran pre-commit run -a with this PR

For Moderators

  • E2E Test successfully complete before merge?

Additional Notes

None.

@carflo carflo requested a review from a team as a code owner May 17, 2023 22:35
@carflo carflo changed the title Fixes image pull secret dynamic block iterator Fixes the image_pull_secret dynamic block iterator May 17, 2023
@carflo carflo changed the title Fixes the image_pull_secret dynamic block iterator fix: Fixes the image_pull_secret dynamic block iterator May 17, 2023
Copy link
Contributor

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

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

Whoops - thanks for catching that!

@bryantbiggs bryantbiggs changed the title fix: Fixes the image_pull_secret dynamic block iterator fix: Correct image_pull_secret dynamic block iterator May 17, 2023
@bryantbiggs bryantbiggs merged commit 1df78c2 into aws-ia:main May 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants