-
Notifications
You must be signed in to change notification settings - Fork 4k
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(iam): introduce OIDCProvider
construct utilizing the native CloudFormation resource
#28634
Conversation
There was a problem hiding this 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.
3036ef0
to
02274f7
Compare
The integration test is failing with the following error now
|
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Clarification Request What do you think of renaming I chose
I suggest the following name changes:
and filename change to
|
f9af6d6
to
35e95ea
Compare
35e95ea
to
a4a4a18
Compare
a4a4a18
to
8f7bc78
Compare
8f7bc78
to
211248a
Compare
const resource = new CfnOIDCProvider(this, 'Resource', { | ||
url: props.url, | ||
clientIdList: props.clientIds, | ||
thumbprintList: props.thumbprints, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation for the original OpenIdConnectProvider
passed in a CodeHash
from the provider so that CFN invokes the UPDATE handler when there are code change but the properties of the resource haven't changed.
Is this problem is fixed by using CfnOIDCProvider
?
For more context: https://github.com/aws/aws-cdk/pull/22802/files#r1018838729
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the comment. I shall look into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @WarFox, I agree that using the name OidcProvider
makes sense because it better aligns with the AWS::IAM::OIDCProvider
that is being used but I feel like it may create too much confusion with the old resource, at least not without a lot more documentation.
After discussing with the team I believe the best option here is to use a feature flag and add changes to the existing OpenIdConnectProvider
as suggested here: #16014 (comment) with the following caveats:
- The feature flag should toggle between the two constructs,
OpenIdConnectProvider
, andOpenIdConnectProvider2
in the constructor ofOpenidConnectProvider
. - Rename
OpenIdConnectProvider2
toOpenIdConnectProviderNative
. But don't export it, only allow it to be used viaOpenIdConnectProvider
+ feature flag
thanks for pointing out to #16014 (comment) @paulhcsun. I shall look into how a feature flag is helpful for this, it is interesting. What do you think of naming it Just to confirm, is the consensus in your team NOT to deprecate |
Hey @WarFox, While I agree that it would be good to have name parity with My opinion is to go with As for deprecation, we would NOT deprecate |
2beca9d
to
635a11f
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
OIDCProvider
construct utilizing the native CloudFormation resource
OIDCProvider
construct utilizing the native CloudFormation resourceOIDCProvider
construct utilizing the native CloudFormation resource
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @WarFox, thank you for your patience and continued effort on this! I've just left 2 final comments and then I am happy to approve once they have been addressed.
@@ -98,6 +98,7 @@ export interface OpenIdConnectProviderProps { | |||
* @see https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html | |||
* | |||
* @resource AWS::CloudFormation::CustomResource | |||
* @deprecated Use { @link OidcProvider } instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the old OpenIdConnectProvider
is still being used in EKS, I don't think we can deprecate this just yet. Apologies for the churn but I did not realize this when making the original suggestion. For the time being we will have to just support both of these. On this note as well, because the old OpenIdConnectProvider
will not be deprecated we should probably rename the new OidcProvider
to be OidcProviderNative
so that there will be a distinction at least. Then in CDK v3 we will be able to remove the old OpenIdConnectProvider
and then we can remove the Native
from OidcProviderNative
.
/** | ||
* Represents an IAM OpenID Connect provider. | ||
* | ||
*/ | ||
export interface IOidcProvider extends IResource { | ||
/** | ||
* The Amazon Resource Name (ARN) of the IAM OpenID Connect provider. | ||
* | ||
* @attribute | ||
*/ | ||
readonly oidcProviderArn: string; | ||
|
||
/** | ||
* The issuer for OIDC Provider | ||
* | ||
* @attribute | ||
*/ | ||
readonly oidcProviderIssuer: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't actually need a new interface here since this is identical to the old IOpenIdConnectProvider
aws-cdk/packages/aws-cdk-lib/aws-iam/lib/oidc-provider.ts
Lines 13 to 27 in d1b3c81
/** | |
* Represents an IAM OpenID Connect provider. | |
* | |
*/ | |
export interface IOpenIdConnectProvider extends IResource { | |
/** | |
* The Amazon Resource Name (ARN) of the IAM OpenID Connect provider. | |
*/ | |
readonly openIdConnectProviderArn: string; | |
/** | |
* The issuer for OIDC Provider | |
*/ | |
readonly openIdConnectProviderIssuer: string; | |
} |
Let's just implement that one instead of creating a new duplicate.
OIDCProvider
construct utilizing the native CloudFormation resourceOIDCProvider
construct utilizing the native CloudFormation resource
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. |
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. |
Comments on closed issues and PRs are hard for our team to see. |
The pull request linter fails with the following errors:
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 |
IAM is stable in CDK, so we should not introduce breaking changes. This PR introduces a new version of OIDC provider without introducing breaking changes.
Older
iam.OpenIdConnectProvider
, which uses custom resources with lambda, is marked as deprecated.The newly introduced
OpenIdConnectProvider2
uses the native CloudFormation resourceAWS::IAM::OIDCProvider
ThumbprintList
ThumbprintList
must not be empty when usingAWS::IAM::OIDCProvider
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc_verify-thumbprint.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-oidcprovider.html
https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateOpenIDConnectProvider.html
Closes #21197
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license