-
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
custom-resource: Passthrough physicalResourceId when its not specified in onUpdate at AwsCustomResource #23843
Comments
Hi @konokenj , thanks for reaching out. It would be great if you could provide some more information on what you are trying to solve and the solution steps as well. Thanks. |
when omit it in onUpdate closes aws#23843
Hi @khushail, thank you for your ownership. aws-cdk/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/runtime/index.ts Line 153 in 9b2a45a
I created a PR. |
when omit it in onUpdate closes aws#23843
when omit it in onUpdate closes aws#23843
…m request when omit it in onUpdate (#24194) AwsCustomResource is now able to omit `physicalResourceId` in `onUpdate` to copy it from request. Some `UPDATE` AWS APIs responses with an empty body. When users want to call these APIs using AwsCustomResource, users can't specify physicalResourceId by `PhysicalResourceId.fromResponse()`. Furthermore, when the Create API generates an unpredictable ID and this must be passed to the Update API, this Construct could not be used. For example, following APIs match this situation: - https://docs.aws.amazon.com/athena/latest/APIReference/API_UpdateNotebook.html - https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_UpdateUser.html Closes #23843. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…m request when omit it in onUpdate (aws#24194) AwsCustomResource is now able to omit `physicalResourceId` in `onUpdate` to copy it from request. Some `UPDATE` AWS APIs responses with an empty body. When users want to call these APIs using AwsCustomResource, users can't specify physicalResourceId by `PhysicalResourceId.fromResponse()`. Furthermore, when the Create API generates an unpredictable ID and this must be passed to the Update API, this Construct could not be used. For example, following APIs match this situation: - https://docs.aws.amazon.com/athena/latest/APIReference/API_UpdateNotebook.html - https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_UpdateUser.html Closes aws#23843. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the feature
Currently, when using AwsCustomResource construct, users have to specify
physicalResourceId
inonUpdate
.This limitation is brought by AwsCustomResource copies
onUpdate
(physicalResourceId
is NOT mandatory) toonCreate
(physicalResourceId
is mandatory) whenonCreate
is not specified.AwsCustomResource should be able to omit
physicalResourceId
inonUpdate
with passthrough it from request. This is useful when users want to call an update API without resoure replacing.Some AWS APIs send empty response in update. This causes problem in below situation:
physicalResourceId: PhysicalResourceId.fromResponse()
new PhysicalResourceIdReference()
in parametersphysicalResourceId: PhysicalResourceId.fromResponse()
or any ID generationUse Case
To create / update / delete resources that is not covered by CloudFormation. If API specification matches above conditions, this feature is critical. Like below:
Proposed Solution
Passthrough
physicalResourceId
from request to response inonUpdate
whenphysicalResourceId
is not specified.To do that, update input check logic for
physicalResourceId
.This change is not breaking, because it's not a problem if users can specify
physicalResourceId
inonUpdate
.Other Information
Instead of omit
physicalResourceId
to passthrough, we can provide a property likepassthroughPhysicalResourceId: true
. But I think its more intuitive that omitphysicalResourceId
.Acknowledgements
CDK version used
2.61.1
Environment details (OS name and version, etc.)
Node.js 16.13.0, MacOS 12.6.2
The text was updated successfully, but these errors were encountered: