DOP-C02 practice question 2 of 35

A company is developing a web application's infrastructure using AWS CloudFormation The database engineering team maintains the database resources in…

Full set: 449 questions
A company is developing a web application's infrastructure using AWS CloudFormation The database engineering team maintains the database resources in a Cloud Formation template, and the software development team maintains the web application resources in a separate CloudFormation template. As the scope of the application grows, the software development team needs to use resources maintained by the database engineering team However, both teams have their own review and lifecycle management processes that they want to keep. Both teams also require resource-level change-set reviews. The software development team would like to deploy changes to this template using their Cl/CD pipeline. Which solution will meet these requirements?
Answer options
A: Create a stack export from the database CloudFormation template and import those references into the web application CloudFormation template Correct answer
B: Create a CloudFormation nested stack to make cross-stack resource references and parameters available in both stacks.
C: Create a CloudFormation stack set to make cross-stack resource references and parameters available in both stacks.
D: Create input parameters in the web application CloudFormation template and pass resource names and IDs from the database stack.
Correct Answer:
A. Create a stack export from the database CloudFormation template and import those references into the web application CloudFormation template
Explanation

Stack Export and Import: Use the Export feature in CloudFormation to share outputs from one stack (e.g., database resources) and use them as inputs in another stack (e.g., web application resources). Steps to Create Stack Export: Define the resources in the database CloudFormation template and use the Outputs section to export necessary values. Outputs: DBInstanceEndpoint: Value: !GetAtt DBInstance.Endpoint.Address Export: Name: DBInstanceEndpoint Steps to Import into Web Application Stack: In the web application CloudFormation template, use the ImportValue function to import these exported values. Resources: MyResource: Type: "AWS::SomeResourceType" Properties: SomeProperty: !ImportValue DBInstanceEndpoint Resource-Level Change-Set Reviews: Both teams can continue using their respective review processes, as changes to each stack are managed independently. Use CloudFormation change sets to preview changes before deploying. By exporting resources from the database stack and importing them into the web application stack, both teams can maintain their separate review and lifecycle management processes while sharing necessary resources.
Reference: AWS CloudFormation Export AWS CloudFormation ImportValue

Scroll to Top