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

Add permissions policy to the EKS nodegroup IAM role for Nomad Autoscaler [ONPREM-129] #181

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

christian-stephen
Copy link
Contributor

@christian-stephen christian-stephen commented Oct 3, 2023

⚙️ Issue

Jira: https://circleci.atlassian.net/browse/ONPREM-129

AWS requires the Nomad Autoscaler daemon to have a certain set of permissions associated with its EKS nodegroup IAM role. This PR attaches a policy to that role with the required permissions.

Fix

Tests

I've done some testing of this against our internal server-infrastructure to ensure that the policy gets created and associated with the EKS node group IAM role as expected: https://github.com/circleci/server-infrastructure/pull/22

@christian-stephen christian-stephen requested a review from a team October 3, 2023 16:59
@christian-stephen christian-stephen force-pushed the ONPREM-129/nodegroup-policy branch 11 times, most recently from 7aac82d to 2855435 Compare October 4, 2023 13:03
@christian-stephen christian-stephen marked this pull request as ready for review October 4, 2023 13:21
@christian-stephen christian-stephen force-pushed the ONPREM-129/nodegroup-policy branch 9 times, most recently from 3953235 to e3e5199 Compare October 4, 2023 16:40
@christian-stephen christian-stephen marked this pull request as draft October 4, 2023 16:44
@christian-stephen christian-stephen force-pushed the ONPREM-129/nodegroup-policy branch from e3e5199 to cc8525f Compare October 4, 2023 17:02
@christian-stephen christian-stephen marked this pull request as ready for review October 4, 2023 17:12

resource "aws_iam_role_policy" "nomad_nodegroup_iam_role_policy" {
count = var.create_nomad_nodegroup_iam_role_policy ? 1 : 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need a flag for the count here since we cannot depend on a computed variable. Otherwise, we'll need to do a terraform apply in two steps, which isn't great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@christian-stephen christian-stephen force-pushed the ONPREM-129/nodegroup-policy branch from cc8525f to 9d426b6 Compare October 4, 2023 17:28
@christian-stephen christian-stephen merged commit 8fc0b83 into main Oct 4, 2023
@christian-stephen christian-stephen deleted the ONPREM-129/nodegroup-policy branch October 4, 2023 18:24
christian-stephen added a commit that referenced this pull request Nov 1, 2023
…roup-policy"

This reverts commit 8fc0b83, reversing
changes made to 4388a74.
christian-stephen added a commit that referenced this pull request Nov 1, 2023
…#185)

* Revert "Merge pull request #182 from CircleCI-Public/ONPREM-129/worker-policy"

This reverts commit b6befb4, reversing
changes made to 8fc0b83.

* Revert "Merge pull request #181 from CircleCI-Public/ONPREM-129/nodegroup-policy"

This reverts commit 8fc0b83, reversing
changes made to 4388a74.

* Unrevert README updates

* Temporarily ignore failing `tfsec` hits to pass CI

* Fix dead link
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