0
0
AWScloud~10 mins

Why Infrastructure as Code matters in AWS - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a simple AWS S3 bucket using Infrastructure as Code.

AWS
Resources:
  MyBucket:
    Type: [1]
Drag options to blanks, or click blank then click option'
AAWS::EC2::Instance
BAWS::S3::Bucket
CAWS::Lambda::Function
DAWS::DynamoDB::Table
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong AWS resource type like EC2 instance or Lambda function.
Confusing resource types for different AWS services.
2fill in blank
medium

Complete the code to specify the bucket name property in the S3 bucket resource.

AWS
Resources:
  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: [1]
Drag options to blanks, or click blank then click option'
AMyBucket123
BInstanceType
CFunctionName
DTableName
Attempts:
3 left
💡 Hint
Common Mistakes
Using properties that belong to other AWS services.
Leaving the bucket name blank or invalid.
3fill in blank
hard

Fix the error in the following CloudFormation snippet by selecting the correct property key for enabling versioning on the S3 bucket.

AWS
Resources:
  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      [1]:
        Status: Enabled
Drag options to blanks, or click blank then click option'
AVersioningConfiguration
BVersionControl
CVersion
DVersioningStatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names like Version or VersionControl.
Misnaming the property causes deployment errors.
4fill in blank
hard

Fill both blanks to create a CloudFormation output that shows the bucket's ARN after deployment.

AWS
Outputs:
  BucketArn:
    Description: "The ARN of the S3 bucket"
    Value: ![1] MyBucket.[2]
Drag options to blanks, or click blank then click option'
AGetAtt
BRef
CArn
DName
Attempts:
3 left
💡 Hint
Common Mistakes
Using Ref instead of GetAtt for ARN retrieval.
Using incorrect attribute names like Name.
5fill in blank
hard

Fill all three blanks to define an IAM role with a trust policy allowing Lambda service to assume it.

AWS
Resources:
  LambdaExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Principal:
              Service: [1]
            Action: [2]
      Policies:
        - PolicyName: LambdaPolicy
          PolicyDocument:
            Version: '2012-10-17'
            Statement:
              - Effect: Allow
                Action: [3]
                Resource: '*'
Drag options to blanks, or click blank then click option'
Alambda.amazonaws.com
Bsts:AssumeRole
Clogs:CreateLogGroup
Dec2.amazonaws.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong service principal like ec2.amazonaws.com.
Using incorrect action names for assume role or logging.