-
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
AwsCustomResource with delete only action fails with Invalid PhysicalResourceId #6061
Labels
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
bug
This issue is a bug.
in-progress
This issue is being actively worked on.
p1
Comments
chrisgit
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Feb 2, 2020
@jogold would you like to take a look? |
Yes |
@chrisgit in the meantime you can use the following workaround: const key = new Key(this, 'kms-key', {
alias: 'KMS-Test-Delete-Alias',
description: 'This is a test KMS key using custom resource',
enabled: true,
});
new AwsCustomResource(this, 'kmsDeleteKeyResource', {
onCreate: { // Dummy call
service: 'KMS',
action: 'describeKey',
parameters: {
KeyId: key.keyArn
},
physicalResourceId: key.keyArn,
},
onDelete: {
service: 'KMS',
action: 'scheduleKeyDeletion',
parameters: {
KeyId: key.keyArn,
PendingWindowInDays: 7
},
},
}) |
Thank you very much for taking the time to look at this issue. @jogold Thank you, the work around provided works as expected. |
@eladb what do you think is best here?
|
I think that making an action with just |
jogold
added a commit
to jogold/aws-cdk
that referenced
this issue
Feb 19, 2020
Correctly find the default physical resource id. Default to logical resource id for a create event with delete only call. Fixes aws#6061
SomayaB
added
in-progress
This issue is being actively worked on.
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Feb 19, 2020
mergify bot
added a commit
that referenced
this issue
Feb 26, 2020
#6363) * fix(custom-resources): AwsCustomResource with delete only action fails Correctly find the default physical resource id. Default to logical resource id for a create event with delete only call. Fixes #6061 * break Co-Authored-By: Elad Ben-Israel <benisrae@amazon.com> * integ test Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Elad Ben-Israel <benisrae@amazon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
bug
This issue is a bug.
in-progress
This issue is being actively worked on.
p1
I have written some lambda backed custom resources using the provider framework but in some cases the task involved is very simple and does not require the overhead of creating a bespoke lambda.
The CDK offers an alternative to the provider framework which is a custom resource that calls an AWS SDK API
The scenarios is that in a development environment I want to remove any CDK generated secrets and KMS keys.
My understanding is that I can use an AwsCustomResource with just the onDelete event specified, however creating the resource produces an Invalid PhysicalResourceId error.
Reproduction Steps
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: