AWS Certified DevOps Engineer – ProfessionalConfiguration Management and Infrastructure as CodeMedium

A DevOps team is using AWS CloudFormation to manage their infrastructure. They have a core VPC template that is used by multiple application stacks. They want to avoid duplicating the VPC definition in every application stack template. Furthermore, they need to ensure that changes to the core VPC template are managed independently and don't force a full update of all dependent application stacks if unnecessary. Which CloudFormation feature should they use to achieve this modularity and dependency management?

  1. ACloudFormation Exports and Imports
  2. BCloudFormation Parameters
  3. CCloudFormation Nested Stacks
  4. DCloudFormation Resource Tags
Show answer & explanation

Correct answer: A. CloudFormation Exports and Imports

CloudFormation Exports allow a stack to output values (like VPC ID or subnet IDs) that can then be imported by other stacks. This creates loose coupling, enabling independent management of the core VPC stack and preventing unnecessary updates to dependent application stacks when only the VPC stack's outputs change.

Why the other options are wrong

  • B. Parameters allow dynamic input values but don't facilitate sharing output values between separate, independently managed stacks.
  • C. Nested Stacks manage related resources as a single unit but still imply a parent-child dependency for deployment and updates, which the question aims to reduce.
  • D. Resource Tags are for resource identification and cost allocation, not for sharing output values between stacks.

CloudFormation Exports/Imports

A mechanism in AWS CloudFormation to share output values from one stack to other stacks, enabling modular and loosely coupled infrastructure deployments.

  • Outputs from a stack can be 'exported' with a unique name.
  • Other stacks can 'import' these exported values using `Fn::ImportValue`.
  • Facilitates independent management and updates of related stacks.

Memory trick: Export for sharing, import for using, independent stacks keep on cruising.

More Configuration Management and Infrastructure as Code questions