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

feat(eks): allow associating external oidc provider with cluster #26950

Closed
wants to merge 2 commits into from

Conversation

Advill
Copy link

@Advill Advill commented Aug 30, 2023

Implement associateOpenIdConnectProvider method in Cluster resource.

Implement test for connecting an OIDC resource after creating a cluster

A project I'm working on has fairly strict requirements from the managing IT org around IAM resources. Long story short, they'd prefer that we spin up our clusters and let them add OIDC providers to them. Currently there is no way to short-circuit the lazy OIDC creation logic or to provide a cluster with an OIDC provider manually.

This PR simply grabs an OIDC provider by it's ARN and slots it in the internal OIDC variable.

The added test could probably use some work. I'm not familiar enough with jest or the CDK's Template construct to work out how to check that a certain resource type is not provisioned in a synthesis, but I've tested what I can.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team August 30, 2023 20:33
@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Aug 30, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@Advill Advill changed the title feat(aws-eks): allow associating external oidc provider with cluster feat(eks): allow associating external oidc provider with cluster Sep 6, 2023
Copy link
Contributor

@mrgrain mrgrain left a comment

Choose a reason for hiding this comment

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

Hi, can you describe the use case in more detail? Specifically how are you making sure that this "external" OIDC provider hast the correct url?

*
* @param arn the arn of the OIDC provider
*/
public associateOpenIdConnectProvider(arn: string): iam.IOpenIdConnectProvider {
Copy link
Contributor

Choose a reason for hiding this comment

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

This would need to accept a IOpenIdConnectProvider. not an ARN.

Copy link
Author

Choose a reason for hiding this comment

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

For sure, I was pretty new to the CDK and my exact use case when I first made this PR. Still finishing up some more important work but once I finish I'm going to clean this up and finish off the parts the PR is missing.

@Advill
Copy link
Author

Advill commented Sep 19, 2023

Hi, can you describe the use case in more detail? Specifically how are you making sure that this "external" OIDC provider hast the correct url?

The use case is certainly an edge one, but is pretty accurately described in the above post. I could add some checks to the imported OIDC provider to try to ensure that it's configured correctly but I'll need to get more familiar with the creation process for OIDCs for that and it may take some back and forth on the request.

In impementing this, hopefully at least a few other users with specific use cases like mine would be able to jump past the OIDC creation requirement of automatically adding ALBControllers and ServiceAccounts using provided functions, if it seems like I'm alone in this requirement though it's fair if this PR is denied.

eks cluster

Implement `associateOpenIdConnectProvider` method in `Cluster` resource.

Implement test for connecting an OIDC resource after creating a cluster
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0b2eeca
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mrgrain
Copy link
Contributor

mrgrain commented Sep 22, 2023

Hi, can you describe the use case in more detail? Specifically how are you making sure that this "external" OIDC provider hast the correct url?

The use case is certainly an edge one, but is pretty accurately described in the above post. I could add some checks to the imported OIDC provider to try to ensure that it's configured correctly but I'll need to get more familiar with the creation process for OIDCs for that and it may take some back and forth on the request.

In impementing this, hopefully at least a few other users with specific use cases like mine would be able to jump past the OIDC creation requirement of automatically adding ALBControllers and ServiceAccounts using provided functions, if it seems like I'm alone in this requirement though it's fair if this PR is denied.

Thanks your response. I'm happy to move forward with this, but we will need to use the interface for it.

@rix0rrr rix0rrr self-assigned this Sep 22, 2023
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

5 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Oct 18, 2023
@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants