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: Not to iterate over remote_access object in dynamic block #1743

Conversation

knight42
Copy link
Contributor

@knight42 knight42 commented Jan 6, 2022

Description

Motivation and Context

Currently if user specifies remote_access in eks_managed_node_groups, terraform will throw an error since we iterate the remote_access object directly, which is not expected.

Breaking Changes

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

@knight42 knight42 force-pushed the fix/eks-nodegroup-remote-access branch from 03f0620 to 3d8af0d Compare January 6, 2022 16:46
@knight42 knight42 changed the title fix: correct the reference to remote_access in dynamic block fix: Not to iterate over remote_access object in dynamic block Jan 6, 2022
@@ -295,7 +295,7 @@ resource "aws_eks_node_group" "this" {
}

dynamic "remote_access" {
for_each = var.remote_access
for_each = length(var.remote_access) > 0 ? [var.remote_access] : []
Copy link
Member

Choose a reason for hiding this comment

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

just testing locally looks like we also need to change lines 300-301 to:

	ec2_ssh_key               = try(remote_access.value.ec2_ssh_key, null)
	source_security_group_ids = try(remote_access.value.source_security_group_ids, [])

Copy link
Contributor Author

@knight42 knight42 Jan 7, 2022

Choose a reason for hiding this comment

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

Nice catch! I have applied your fix and verified it locally. Thanks!

@knight42 knight42 force-pushed the fix/eks-nodegroup-remote-access branch from 3d8af0d to c3d6c5b Compare January 7, 2022 09:01
@knight42 knight42 requested a review from bryantbiggs January 7, 2022 09:01
Copy link
Member

@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.

@antonbabenko 👍🏽

thanks for the patch @knight42 🎉

@antonbabenko antonbabenko merged commit 86b3c33 into terraform-aws-modules:master Jan 7, 2022
antonbabenko pushed a commit that referenced this pull request Jan 7, 2022
### [18.0.4](v18.0.3...v18.0.4) (2022-01-07)

### Bug Fixes

* Not to iterate over remote_access object in dynamic block ([#1743](#1743)) ([86b3c33](86b3c33))
@antonbabenko
Copy link
Member

This PR is included in version 18.0.4 🎉

@knight42 knight42 deleted the fix/eks-nodegroup-remote-access branch January 7, 2022 13:25
baibailiha added a commit to baibailiha/terraform-aws-eks that referenced this pull request Sep 13, 2022
@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, 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 Nov 11, 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 this pull request may close these issues.

3 participants