0
0
AWScloud~10 mins

Outputs for cross-stack references in AWS - Interactive Code Practice

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

Complete the code to export a value from a CloudFormation stack output.

AWS
Outputs:
  MyBucketName:
    Value: !Ref MyBucket
    Export:
      Name: [1]
Drag options to blanks, or click blank then click option'
AMyBucketNameExport
BBucketNameExport
CMyBucketName
DExportedBucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using a name that does not match the output logical name.
Leaving the export name empty.
2fill in blank
medium

Complete the code to import an exported value from another CloudFormation stack.

AWS
Resources:
  MyBucketPolicy:
    Type: AWS::S3::BucketPolicy
    Properties:
      Bucket: !ImportValue [1]
Drag options to blanks, or click blank then click option'
AExportedBucket
BOtherStack-MyBucketName
CMyBucketNameExport
DMyBucketName
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different or incorrect export name.
Confusing the logical resource name with the export name.
3fill in blank
hard

Fix the error in the output export name to make it valid for cross-stack reference.

AWS
Outputs:
  MyBucketArn:
    Value: !GetAtt MyBucket.Arn
    Export:
      Name: [1]
Drag options to blanks, or click blank then click option'
AMy Bucket Arn
BMyBucket_Arn
CMyBucketArn!
DMyBucketArn
Attempts:
3 left
💡 Hint
Common Mistakes
Including spaces in export names.
Using special characters like exclamation marks.
4fill in blank
hard

Fill both blanks to correctly export and import a VPC ID between stacks.

AWS
Outputs:
  VPCId:
    Value: !Ref MyVPC
    Export:
      Name: [1]

Resources:
  MySubnet:
    Type: AWS::EC2::Subnet
    Properties:
      VpcId: !ImportValue [2]
Drag options to blanks, or click blank then click option'
AMyApp-VPC
BMyApp_VPC
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatch between export and import names.
Using spaces or invalid characters.
5fill in blank
hard

Fill all three blanks to export an RDS instance endpoint and import it in another stack.

AWS
Outputs:
  DBEndpoint:
    Value: !GetAtt MyDB.Endpoint.Address
    Export:
      Name: [1]

Resources:
  MyAppDBConnection:
    Type: AWS::RDS::DBInstance
    Properties:
      DBInstanceIdentifier: mydb
      EndpointAddress: !ImportValue [2]
      Port: [3]
Drag options to blanks, or click blank then click option'
AMyApp-DBEndpoint
C3306
D5432
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatched export/import names.
Using the wrong port number for the database.