Skip to content

feat: (PSKD-904) Support credentials when assuming an IAM role#319

Merged
dhoucgitter merged 11 commits intostagingfrom
pskd-904
Feb 10, 2025
Merged

feat: (PSKD-904) Support credentials when assuming an IAM role#319
dhoucgitter merged 11 commits intostagingfrom
pskd-904

Conversation

@dhoucgitter
Copy link
Member

@dhoucgitter dhoucgitter commented Jan 28, 2025

Changes

  • Updates to support authenticating to Terraform using temporary AWS credentials generated by assuming an IAM role
  • Expose EKS cluster authentication_mode as a General configuration variable
  • Add admin_access_entry_role_arns as a General configuration variable. Add behavior to create an admin level EKS access entry for each role ARN specified in this list of strings.
  • Added CONFIG-VARS.md doc for the two new configuration variables.

Signed-off-by: David.Houck <David.Houck@sas.com>
@dhoucgitter dhoucgitter added the enhancement New feature or request label Jan 28, 2025
@dhoucgitter dhoucgitter self-assigned this Jan 28, 2025
@dhoucgitter dhoucgitter requested a review from supear January 28, 2025 18:13
Signed-off-by: David.Houck <David.Houck@sas.com>
Signed-off-by: David.Houck <David.Houck@sas.com>
Copy link
Contributor

@supear supear left a comment

Choose a reason for hiding this comment

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

Here are some edits!

Signed-off-by: David.Houck <David.Houck@sas.com>
@dhoucgitter
Copy link
Member Author

Hi @supear, please review the latest commit for updates based on your suggested doc changes, thanks.

Copy link
Contributor

@supear supear left a comment

Choose a reason for hiding this comment

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

Just one typo. I think it's good to go once that's fixed!

@ajeffowens
Copy link
Contributor

ajeffowens commented Jan 30, 2025

This line from fsx_ontap will need to be adapted for the iam role scenario:

user = data.aws_iam_user.terraform.user_name
.

Otherwise it fails like this:

╷
│ Error: getting user: operation error IAM: GetUser, https response error StatusCode: 404, RequestID: 2ad78f83-7713-4d54-81c3-e343f5eb1f9a, NoSuchEntity: The user with name GitHubActions cannot be found.
│ 
│   with module.ontap[0].data.aws_iam_user.terraform,
│   on modules/aws_fsx_ontap/main.tf line 76, in data "aws_iam_user" "terraform":
│   76: data "aws_iam_user" "terraform" {
│ 
╵

Signed-off-by: David.Houck <David.Houck@sas.com>
… comment

Signed-off-by: David.Houck <David.Houck@sas.com>
@dhoucgitter
Copy link
Member Author

Hi @supear, based on your last comment and the new commit, I will go ahead and resolve your doc review comments as completed, sound good?

Signed-off-by: David.Houck <David.Houck@sas.com>
@dhoucgitter
Copy link
Member Author

This line from fsx_ontap will need to be adapted for the iam role scenario:

user = data.aws_iam_user.terraform.user_name

.
Otherwise it fails like this:

╷
│ Error: getting user: operation error IAM: GetUser, https response error StatusCode: 404, RequestID: 2ad78f83-7713-4d54-81c3-e343f5eb1f9a, NoSuchEntity: The user with name GitHubActions cannot be found.
│ 
│   with module.ontap[0].data.aws_iam_user.terraform,
│   on modules/aws_fsx_ontap/main.tf line 76, in data "aws_iam_user" "terraform":
│   76: data "aws_iam_user" "terraform" {
│ 
╵

Hi @ajeffowens , the latest commit should handle creating the correct policy attachment whether using an assumed IAM role or IAM user. I'll message you once I have a new image ready that I'm hoping you can try out again.

Signed-off-by: David.Houck <David.Houck@sas.com>
…cation

Signed-off-by: David.Houck <David.Houck@sas.com>
Signed-off-by: David.Houck <David.Houck@sas.com>
Signed-off-by: David.Houck <David.Houck@sas.com>
@dhoucgitter dhoucgitter merged commit 437e7d3 into staging Feb 10, 2025
5 checks passed
@dhoucgitter dhoucgitter deleted the pskd-904 branch February 10, 2025 20:07
@dhoucgitter dhoucgitter linked an issue Mar 18, 2025 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: version 8.6.0 fails when AWS CLI is authenticated with SSO

4 participants