Skip to Content

DVA-C02: How to Use a Parameter with AllowedValues in AWS CloudFormation

Learn how to use a parameter with AllowedValues in AWS CloudFormation to choose from a list of approved options. Find out how to create a parameter and specify the list of EC2 instance types as AllowedValues in your CloudFormation template.

Table of Contents

Question

A developer is creating an AWS CloudFormation template to deploy Amazon EC2 instances across multiple AWS accounts. The developer must choose the EC2 instances from a list of approved instance types.

How can the developer incorporate the list of approved instance types in the CloudFormation template?

A. Create a separate CloudFormation template for each EC2 instance type in the list.

B. In the Resources section of the CloudFormation template, create resources for each EC2 instance type in the list.

C. In the CloudFormation template, create a separate parameter for each EC2 instance type in the list.

D. In the CloudFormation template, create a parameter with the list of EC2 instance types as AllowedValues.

Answer

D. In the CloudFormation template, create a parameter with the list of EC2 instance types as AllowedValues.

Explanation

The correct answer to the question is D. In the CloudFormation template, create a parameter with the list of EC2 instance types as AllowedValues.

The reason for this answer is that a parameter in a CloudFormation template allows the user to specify input values when creating or updating a stack. By using the AllowedValues property, the parameter can restrict the input values to a predefined list. This way, the developer can incorporate the list of approved EC2 instance types in the template and ensure that only those instances are deployed across multiple AWS accounts.

The other options are incorrect because:

  • Option A: Creating a separate CloudFormation template for each EC2 instance type in the list would be inefficient and redundant. It would also make it difficult to manage and update the templates across multiple AWS accounts.
  • Option B: In the Resources section of the CloudFormation template, creating resources for each EC2 instance type in the list would result in deploying all the EC2 instances in the list, regardless of the user’s input. This would waste resources and incur unnecessary costs.
  • Option C: In the CloudFormation template, creating a separate parameter for each EC2 instance type in the list would make the template too complex and cumbersome. It would also require the user to specify multiple input values when creating or updating a stack, which could lead to errors or confusion.

The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.

AWS Certified Developer - Associate DVA-C02 Exam Questions and Answers