Skip to content

(aws-api-gateway): Re-generate API Deployment Logical ID when stack parameter is populated using Custom Resources #33719

@Zichpie

Description

@Zichpie

Describe the feature

We are using a custom resource to fetch an API Gateway integration parameter dynamically at deployment time and noticed that the API Gateway deployment logical ID does not change due to the logical ID being calculated as the hash of the cfn template. Since we are using customer resources, cdk does not detect a change during build time and hence does create a new Deployment resource with a new logical ID.

We noticed later on that we can using the addLogicalId method to force CDK to generate a new Deployment resource each time, however would it be possible to always update the Deployment logical ID if custom resource is used to to fetch any properties.

Use Case

Automatically update the API Gateway Deployment resource logical ID when there is a custom resource to fetch an API Gateway integration parameter, or other properties.

Proposed Solution

If any custom resource is detected in the RestApi or SpecRestApi cloudformation template, invoke addToLogicalId with an UUID so that a new hash would be generated.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

^2.158.0

Environment details (OS name and version, etc.)

MacOS 14.6.1 (23G93)

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-apigatewayRelated to Amazon API Gatewayclosed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.feature-requestA feature should be added or improved.p3response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions