MCQs Questions on Basic CloudFormation Concepts | AWS CloudFormation Multiple Choice Questions

Enhance your AWS knowledge with these AWS CloudFormation MCQ questions and answers. This set focuses on basic CloudFormation concepts, including templates, resources, properties, and template structures in YAML/JSON. You’ll also explore parameters, mappings, and outputs. Perfect for mastering AWS CloudFormation’s infrastructure as code capabilities.


MCQs

AWS CloudFormation Templates

  1. What is an AWS CloudFormation template?
    a) A script for managing EC2 instances
    b) A JSON or YAML file that describes AWS resources and configurations
    c) A Python library for automation
    d) A deployment tool for third-party applications
  2. What is the maximum size for a single CloudFormation template?
    a) 512 KB
    b) 1 MB
    c) 2 MB
    d) 5 MB
  3. In CloudFormation, which attribute is mandatory in every template?
    a) Parameters
    b) Resources
    c) Outputs
    d) Mappings
  4. Which file formats are supported for AWS CloudFormation templates?
    a) XML and CSV
    b) YAML and JSON
    c) HTML and TXT
    d) SQL and Markdown
  5. What does the “AWSTemplateFormatVersion” field define in a template?
    a) The CloudFormation service version
    b) The format version of the template file
    c) The API version for Lambda functions
    d) The operating system version

Resources and Properties

  1. What is a “Resource” in a CloudFormation template?
    a) A mapping of parameters to outputs
    b) An AWS service or component that you define in the template
    c) A backup file for CloudFormation stacks
    d) A default configuration for AWS services
  2. Which of the following is an example of a CloudFormation resource type?
    a) AWS::EC2::Instance
    b) EC2::AWS::Instance
    c) S3::Bucket::AWS
    d) Instance::EC2::AWS
  3. How are properties defined within a resource in a CloudFormation template?
    a) As key-value pairs under the “Parameters” section
    b) Inside the “Properties” section of the resource
    c) Through the “Mappings” section
    d) Using external scripts
  4. Which attribute is used to specify dependencies between resources?
    a) DependsOn
    b) Dependencies
    c) RequiredBy
    d) LinkedResources
  5. How can you dynamically create resource names in a CloudFormation template?
    a) Using the Ref function
    b) Through static strings
    c) By applying the Join function
    d) Using the Fn::Sub intrinsic function

Template Structure (YAML/JSON)

  1. What symbol is used to denote comments in a YAML-formatted CloudFormation template?
    a) //
    b) #
    c) <!– –>
    d) **
  2. Which section in a CloudFormation template contains optional metadata about the stack?
    a) Description
    b) Metadata
    c) Resources
    d) Outputs
  3. How do you declare a resource in a JSON CloudFormation template?
    a) As an array within the “Resources” key
    b) As an object under the “Resources” key
    c) Using the “Mappings” section
    d) Inside a string under the “Outputs” section
  4. Which YAML syntax is used to define an intrinsic function?
    a) !!Intrinsic::
    b) Fn::FunctionName
    c) !FunctionName
    d) $Intrinsic::
  5. What is the purpose of the “Transform” section in a CloudFormation template?
    a) To map outputs to resources
    b) To include additional AWS service-specific macros
    c) To create JSON-to-YAML conversions
    d) To validate stack permissions

Parameters, Mappings, and Outputs

  1. What is the purpose of “Parameters” in a CloudFormation template?
    a) To define custom values passed into the template at runtime
    b) To store data generated by the stack
    c) To represent the logical relationships between resources
    d) To map CloudFormation templates to IAM roles
  2. Which intrinsic function is used to reference a parameter value?
    a) Fn::GetAtt
    b) Ref
    c) Fn::Sub
    d) Fn::Join
  3. What does the “Mappings” section in a CloudFormation template provide?
    a) A way to organize the structure of resources
    b) A lookup table for static values based on keys
    c) Dynamic inputs for stack creation
    d) A summary of outputs
  4. Which intrinsic function retrieves values from the “Mappings” section?
    a) Ref
    b) Fn::GetAtt
    c) Fn::FindInMap
    d) Fn::Select
  5. What is a primary use of the “Outputs” section in a CloudFormation template?
    a) To generate errors for invalid parameters
    b) To return information about resources created by the stack
    c) To automate stack deletion
    d) To deploy external applications
  6. Which attribute is used in the Outputs section to make a value accessible to another stack?
    a) Export
    b) Share
    c) Distribute
    d) Link
  7. How are conditions defined in a CloudFormation template?
    a) Using If-Else blocks in the “Resources” section
    b) Through the “Conditions” section with logical functions
    c) Inside the “Outputs” section using intrinsic functions
    d) Directly in the “Parameters” section
  8. Which function is used to combine multiple strings in CloudFormation?
    a) Fn::Join
    b) Fn::Concat
    c) Fn::Merge
    d) Fn::Combine
  9. What is the purpose of the “Description” section in a CloudFormation template?
    a) To describe the logical relationships between resources
    b) To add metadata about the template
    c) To explain the template’s purpose and details
    d) To include inline comments
  10. Which section is mandatory in every CloudFormation template?
    a) Outputs
    b) Mappings
    c) Resources
    d) Parameters

Answer Key

QnoAnswer
1b) A JSON or YAML file that describes AWS resources and configurations
2c) 2 MB
3b) Resources
4b) YAML and JSON
5b) The format version of the template file
6b) An AWS service or component that you define in the template
7a) AWS::EC2::Instance
8b) Inside the “Properties” section of the resource
9a) DependsOn
10d) Using the Fn::Sub intrinsic function
11b) #
12b) Metadata
13b) As an object under the “Resources” key
14c) !FunctionName
15b) To include additional AWS service-specific macros
16a) To define custom values passed into the template at runtime
17b) Ref
18b) A lookup table for static values based on keys
19c) Fn::FindInMap
20b) To return information about resources created by the stack
21a) Export
22b) Through the “Conditions” section with logical functions
23a) Fn::Join
24c) To explain the template’s purpose and details
25c) Resources

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top