question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Providing the physicalResourceId on AwsCustomResource onUpdate / onDelete

See original GitHub issue

How should a physicalResourceId be provided to AwsCustomResource onUpdate / onDelete

AwsCustomResource works well for resource creation.

But how should onUpdate and onDelete supply the physicalResourceId that was returned during the onCreate phase?

Take this example. How should the DirectoryId to be deleted be provided in the onDelete phase? I am not sure if this just isn’t documented yet, or isn’t possible. If it isn’t possible, I feel it should be, and if it isn’t possible, what should we do instead? It would definitely be a shame if there was no intent to add this as functionality, as AwsCustomResource is extremely useful.

    var adConnector = new AwsCustomResource(this, "ADConnector", {
        onCreate: {
          service: 'DirectoryService',
          action: 'connectDirectory',
          parameters: { ... },
          physicalResourceId: PhysicalResourceId.fromResponse('DirectoryId')
        },
        onDelete: {
          service: 'DirectoryService',
          action: 'deleteDirectory',
          parameters: {
            DirectoryId: ???,
          }
        }
      }
    );

Environment

CDK CLI 1.30.0 Module Version: 1.30.0 OS: all Language: all

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

0reactions
github-actions[bot]commented, Jun 3, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Referencing the physical resource ID in a ... - Stack Overflow
In the onCreate I can see that to return the OU's Id as the physical resource ID I can specify a physicalResourceIdPath ,...
Read more >
interface AwsCustomResourceProps · AWS CDK
Properties for AwsCustomResource. Note that at least onCreate, onUpdate or onDelete must be specified. ... physicalResourceId: cr.PhysicalResourceId.of('.
Read more >
AWS Custom Resource using CDK AwsCustomResource ...
Method fromSdkCalls adds actions configured in onCreate , onUpdate and onDelete properties, to the custom resource lambda IAM policy. Based on ...
Read more >
How to use the PhysicalResourceId for CloudFormation ...
The PhysicalResourceId is an oft-overlooked feature of Custom Resources. ... At first, I didn't give too much attention to it.
Read more >
Managing Missing CloudFormation Support with the AWS CDK
The AWS CDK provides a Custom Resource module out of the box, ... updateThingGroup on update and deleteThingGroup on delete.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found