DVA-C02 · Question #355
A developer is deploying an application in the AWS Cloud by using AWS CloudFormation. The application will connect to an existing Amazon RDS database. The hostname of the RDS database is stored in…
The correct answer is A. Use the ssm dynamic reference. Referencing an existing plaintext SSM Parameter Store value in a CloudFormation template is done with the ssm dynamic reference syntax, which resolves the parameter at stack creation/update time.
Question
A developer is deploying an application in the AWS Cloud by using AWS CloudFormation. The application will connect to an existing Amazon RDS database. The hostname of the RDS database is stored in AWS Systems Manager Parameter Store as a plaintext value. The developer needs to incorporate the database hostname into the CloudFormation template to initialize the application when the stack is created. How should the developer reference the parameter that contains the database hostname?
Options
- AUse the ssm dynamic reference.
- BUse the Ref intrinsic function.
- CUse the Fn::ImportValue intrinsic function.
- DUse the ssm-secure dynamic reference.
How the community answered
(41 responses)- A83% (34)
- B10% (4)
- C5% (2)
- D2% (1)
Why each option
Referencing an existing plaintext SSM Parameter Store value in a CloudFormation template is done with the ssm dynamic reference syntax, which resolves the parameter at stack creation/update time.
The ssm dynamic reference ({{resolve:ssm:/parameter/name}}) instructs CloudFormation to fetch the current value of a plaintext SSM parameter at deployment time without requiring the parameter to be declared in the CloudFormation template itself.
The Ref intrinsic function resolves CloudFormation Parameters or logical resource IDs declared within the same template; it cannot reach into SSM Parameter Store to retrieve an external value.
Fn::ImportValue is used to consume values exported by another CloudFormation stack's Outputs section, not to access SSM Parameter Store values.
The ssm-secure dynamic reference is specifically for SSM SecureString parameters and causes CloudFormation to handle the value as a secret; the hostname is stored as plaintext, so ssm-secure is unnecessary and would fail for standard string parameters.
Concept tested: SSM Parameter Store dynamic references in CloudFormation
Source: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html
Community Discussion
No community discussion yet for this question.