Skip to content

Prefix CloudFormation export names with DEP_NAME#133

Draft
OscarGonzalez-FortyAU wants to merge 1 commit intogaiin-platform:mainfrom
FortyAU-Amplify-Team:feature/prefix-cloudformation-export-names
Draft

Prefix CloudFormation export names with DEP_NAME#133
OscarGonzalez-FortyAU wants to merge 1 commit intogaiin-platform:mainfrom
FortyAU-Amplify-Team:feature/prefix-cloudformation-export-names

Conversation

@OscarGonzalez-FortyAU
Copy link

@OscarGonzalez-FortyAU OscarGonzalez-FortyAU commented Jun 5, 2025

This PR updates the Outputs section in our serverless.yml to prefix all CloudFormation export names with a deployment-specific identifier derived from ${self:custom.stageVars.DEP_NAME}.

For example, an export previously named:
${sls:stage}-RestApiId

Will now be named:
${self:custom.stageVars.DEP_NAME}-${sls:stage}-RestApiId

This change enhances namespacing, allowing multiple service instances to coexist without CloudFormation export name collisions.

Important Deployment Note for Existing Environments:

Attempting to directly deploy this version of the producer stack (which now only defines the new, prefixed export names) into an environment where consumer stacks still reference the old, unprefixed names will result in a deployment failure for this producer stack.

CloudFormation will prevent the deletion of the old export names because they are still in use by other stacks. Consequently, the new naming convention will not be applied by this deployment attempt, and while currently running consumer services won't be immediately broken by this specific failed deployment of the producer, the producer stack itself cannot be updated to the new naming standard without a specific rollout strategy.

Marked as a draft PR for this reason.

To successfully implement this naming update, the "double reference" deployment strategy is required for existing environments.

Ref.: https://github.com/orgs/gaiin-platform/discussions/7

jasonbrd pushed a commit to jasonbrd/amplify-genai-backend that referenced this pull request Jun 5, 2025
@OscarGonzalez-FortyAU
Copy link
Author

@ggr614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant