Skip to content

Migrating Service Token of a CustomResource from Lambda ARN to Provider Service Token #30261

Answered by michanto
Toltar asked this question in Q&A
Discussion options

You must be logged in to vote

As long as it is acceptable to destroy/create the custom resource, you can modify the logical ID by finding the CfnResource for the custom resource and calling overrideLogicalId. Usually this is acceptable unless the LogicalId is part of the resource lambda logic.

A single deployment with the new logical ID is all that is required. Since it is a new Logical ID, CloudFormation will not see it as a service token change. After that, you can go back to the original logical ID if you like.

See my code here that does this.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@michanto
Comment options

Answer selected by Toltar
@Toltar
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants