Bird
0
0

What is the best practice to avoid deployment failures in StackB?

hard📝 Best Practice Q15 of 15
AWS - CloudFormation
You want to share a VPC ID from StackA to StackB using outputs and imports. StackA exports the VPC ID as VpcIdExport. StackB imports it with Fn::ImportValue: VpcIdExport. Later, you need to update StackA to create a new VPC and export its ID with the same name. What is the best practice to avoid deployment failures in StackB?
AChange the export name in StackA and update StackB to import the new name
BDelete StackB before updating StackA, then redeploy StackB after update
CKeep the export name the same and update StackB without changes
DRemove the export from StackA and hardcode the VPC ID in StackB
Step-by-Step Solution
Solution:
  1. Step 1: Recognize export name immutability

    Export names cannot be changed or deleted without affecting dependent stacks.
  2. Step 2: Plan safe update

    To update the VPC and export a new ID, use a new export name and update StackB to import that new name.
  3. Step 3: Avoid breaking dependencies

    This avoids deployment failures and keeps stacks consistent.
  4. Final Answer:

    Change the export name in StackA and update StackB to import the new name -> Option A
  5. Quick Check:

    Update export name and import to avoid conflicts = B [OK]
Quick Trick: Change export name and update imports to avoid breaking stacks [OK]
Common Mistakes:
  • Deleting dependent stacks before update
  • Keeping export name same causing conflicts
  • Hardcoding values instead of using imports

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes