-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-iam): (Simplify OpenIdConnectProvider by using CloudFormation resource instead of custom resource lambda) #21197
Comments
We received a notification that NodeJS 12 runtime is no longer being supported. This custom Lambda resource uses this runtime so could become an issue in coming months. "AWS Lambda end of support for Node.js 12" Is this relevant in prioritising this issue? Cheers. |
So I came across this issue after learning that the AWS-CDK's I have a solution here that has worked for us for a while now, and I've just ported it into a CDK-based deploy. I'd be happy to see this code baked into the CDK:
|
How do you import an existing provider arn using this approach? |
If anyone is aware of past situations where a construct moved from being supported via a custom resource, to being supported via a CloudFormation resource, these would be helpful in working on this change. I am wondering, could the change be made so that apps already using this construct could upgrade without getting their provider resource deleted? Is it a requirement that existing providers not be deleted and re-created? If they are going to be deleted, does this change need to go in an alpha package? Update: It seems from #22573 and #16014 that the upgrade could be handled with a feature flag. |
@diranged You said the custom resource contains a pretty old bug that you encountered previously. I see that you have posted code that contains a solution, but what was the bug? |
The Custom Resource handler code implements the logic that lets you omit the thumbprints when instantiating your Provider. The handler code downloads the thumbprint and does some validation on it when a thumbprint is not provided. I'm not sure how to retain this feature, meaning the ability to omit the thumbprints and have the construct get a thumbprint at deploy time, without leaving the Provider in a Custom Resource. If we add a feature flag that causes the OIDC Provider to be created via the Cfn resource, for example, |
@douglasnaphas I believe the bug we ran into was that the custom CFN provider was picking the wrong CA in the CA bundle to generate the thumbprint from. Instead of picking the root, it picks a SubCA. AWS then changed the SubCA cert on us a year or two ago, and our authentication broke at that point. The code I have here I think is “better” because we’re only using a custom provider to get the thumbprint ID - and nothing else. The rest is native CFN, which means that as the |
I think it would make sense to break the thumbprint logic out into its own Thumbprint Construct. I have proposed this in the CDK RFC repo. I don't think the OIDC Provider L1 Cfn resource will ever support thumbprint picking, since the API for OIDC Providers requires the thumbprint to be specified, and L1 Constructs don't have any additional logic. I think it would be better for the thumbprint picking logic to live in the proposed Thumbprint Construct, and for the OIDC Provider L2 Construct to accept a Thumbprint Construct. |
Since about a month ago pinning certificate thumbprints with GitHub as OIDC provider is no longer required. See GitHub's announcement here. |
Any updates on this ? We had to switch to regular cloudformation templates because of this issue |
I'm facing a similar issue. The custom resource Lambda is on node 16 and I'd like to update to node 18 but I'm not sure how to do that since the Lambda is provisioned automatically. Any idea? |
closes aws#21197 OpenIdConnectProvider is implemented as Custom Resource using Lambda. This is not recommended anymore because we have CloudFormation resource that can be used directly. "AWS::IAM::OIDCProvider" resource is available as "CfnOIDCProvider"
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
Mark OpenIdConnectProvider, which uses custom resources with lambda, as deprecated. The newly introduced OpenIdConnectProvider2 uses the native CloudFormation resource AWS::IAM::OIDCProvider
Mark OpenIdConnectProvider, which uses custom resources with lambda, as deprecated. The newly introduced OpenIdConnectProvider2 uses the native CloudFormation resource AWS::IAM::OIDCProvider
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
I have PR ready for review here #28634 It introduces a new OpenIdConnecProvider that uses the CloudFormation resource so that there is no breaking change for the existing construct that uses custom resources. Looking for suggestions and comments on this. It is my first contribution to aws-cdk. Thank you 🙏 |
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
IAM is stable in CDK, so we should not introduce breaking changes. This commit 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 resource AWS::IAM::OIDCProvider. Closes aws#21197
Describe the feature
OpenIdConnectProvider
construct currently creates custom resource lambda and associated resources to create OIDC provider.However, CloudFormation now supports it out of the box: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-oidcprovider.html
The construct can be significantly simplified by moving to use direct CloudFormation resource.
Use Case
Custom resource lambdas are more complex, harder to understand, and reduce visibility into what's being created. Using CloudFormation resource directly would reduce complexity.
Proposed Solution
Switch to
AWS::IAM::OIDCProvider
CloudFormation resourceOther Information
No response
Acknowledgements
CDK version used
2.32.1
Environment details (OS name and version, etc.)
Ubuntu 18
The text was updated successfully, but these errors were encountered: