DOP-C02 Configuration Management and IaC Practice Question
A team uses CloudFormation to deploy a multi-container Docker environment on Amazon ECS. They need to pass environment variables to the containers from Parameter Store. How should they reference these values in the CloudFormation template?
⚠ Common exam trap
Candidates often confuse CloudFormation's 'Ref' function with the ability to fetch SSM parameter values, or invent a non-existent function like 'Fn::ParamStore', instead of recognizing the dedicated 'resolve:ssm' dynamic reference syntax.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Using the 'resolve:ssm' dynamic reference
CloudFormation supports dynamic references using the 'resolve:ssm' prefix to retrieve values from AWS Systems Manager Parameter Store at stack creation or update time. This allows environment variables in an ECS task definition to be populated directly from Parameter Store without hardcoding secrets or using custom Lambda-backed custom resources.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Using the 'Ref' function with the parameter name
Why it's wrong here
The Ref function only returns the value of a template parameter or resource when given its logical ID. If you pass the name of an SSM parameter as a template parameter, Ref returns that name string literally, not the stored value from Parameter Store. It cannot dereference or look up the contents of a named SSM parameter, so secrets and configuration values remain inaccessible.
- ✗
Using the 'Fn::ParamStore' intrinsic function
Why it's wrong here
CloudFormation's intrinsic function library includes Ref, Fn::GetAtt, Fn::Join, Fn::Sub, and Fn::ImportValue, but there is no Fn::ParamStore. Attempting to use it would result in a template validation error because the intrinsic function does not exist. The correct way to retrieve Parameter Store values is through dynamic references, not a made-up pseudo function.
- ✗
Using 'Fn::GetAtt' on the Parameter Store resource
Why it's wrong here
Fn::GetAtt is only used to fetch attributes of resources that are explicitly declared inside the CloudFormation template, such as an AWS::SSM::Parameter resource. It cannot query an existing SSM parameter by name; doing so requires the logical ID of a resource created in the same stack. Additionally, using Fn::GetAtt on a non-existent or external Parameter Store resource would fail, and it is not designed for retrieving values from the Parameter Store service.
- ✓
Using the 'resolve:ssm' dynamic reference
Why this is correct
The correct method is to use a dynamic reference, which CloudFormation resolves during stack create or update operations. For SSM Parameter Store, you write {{resolve:ssm:parameter-name:version}} (or without a version) to inject the parameter's value directly into your template properties. This approach works for both plaintext and, with resolve:ssm-secure, SecureString parameters, enabling secure, service-managed retrieval without hardcoding secrets.
Visual reference
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
One of 1,298 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.