-
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
fix(cognito-identitypool): providerUrl causes error when mappingKey is not provided and it is a token #21191
Conversation
This property is for use when the identityProvider is a Token. By default identityProvider is used as the key in the role mapping hash, but Cloudformation only allows concrete strings to be used as hash keys.
A couple of missing import statements
I couldn't run them locally, now I've seen them fail the CodeBuild build I can fix the results based on my changes.
Build failure doesn't appear to be due to anything I've done; it appears to be in @aws-cdk/aws-appsync, which I haven't touched:
|
Also, move the documentation of the new feature to a more relevant part of the README.md.
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 this is more of a fix than a feat but it's almost perfect as is. Just one suggested change inline.
} else { | ||
const providerUrl = prop.providerUrl.value; | ||
if (Token.isUnresolved(providerUrl)) { | ||
throw new Error('mappingKey must be provided when providerUrl.value is an unresolved token'); |
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.
throw new Error('mappingKey must be provided when providerUrl.value is an unresolved token'); | |
throw new Error('mappingKey must be provided when providerUrl.value is a token'); |
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'm happy to make this change; that was wording I've copied from other parts of the CDK such as
throw new Error('Unable to determine ARN separator for SSM parameter since the parameter name is an unresolved token. Use "fromAttributes" and specify "simpleName" explicitly'); |
throw new Error(`multiple "${operator}" conditions cannot be merged if one of them contains an unresolved token`); |
I couldn't decide if this was a fix or a feature; I fell on the side of this being a feature as it does actually provide new functionality, rather than altering existing functionality; it's just that the new feature addresses a gap that was previously present in the CDK's capabilities. Once again, I'm happy to defer to your judgment here.
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.
Ah, I've made the change manually, rather than applying your commit suggestion; that's Github functionality I hadn't seen before.
Pull request has been modified.
Update the wording of the error message when providerUrl.value is a token as per request of @TheRealAmazonKendra
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…s not provided and it is a token (aws#21191) This property is for use when the identityProvider is a Token. By default identityProvider is used as the key in the role mapping hash, but Cloudformation only allows concrete strings to be used as hash keys. In particular this feature is a requirement to allow a previously defined CDK UserPool to be used as an identityProvider. closes aws#19222 Please note that the integ test results will need updating. I attempted to run the tests, and received the error ``` Error: ENOENT: no such file or directory, open '/home/sam/aws-cdk/packages/aws-cdk/lib/init-templates/v1/info.json' ERROR integ.identitypool 0.535s Command exited with status 1 ``` I've used `npm` to update to the latest CDK CLI. I appear to not be the only person facing this issue; see aws#21056 (comment) ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This property is for use when the identityProvider is a Token. By default identityProvider is used as the key in the role mapping
hash, but Cloudformation only allows concrete strings to be used as hash keys.
In particular this feature is a requirement to allow a previously defined CDK UserPool to be used as an identityProvider.
closes #19222
Please note that the integ test results will need updating. I attempted to run the tests, and received the error
I've used
npm
to update to the latest CDK CLI. I appear to not be the only person facing this issue; see #21056 (comment)All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license