Working with CloudFormation Condition Functions

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

This hands-on lab allows the student to create a condition function in a CloudFormation template. The condition function will determine if the VPC deployed by the template will be configured with default or dedicated tenancy. The student can either take the challenge of completing the lab without looking at the solution template, or they follow along with the solution offered in the second video.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a VPC with Dedicated Tenancy
  • From the CloudFormation Management Console, select Create Stack.
  • Upload the template with the condition function.
  • In the Parameters select Dedicated.
  • Click Next, then click Create Stack.
Create a VPC with Default Tenancy
  • From the CloudFormation Management Console, select Create Stack.
  • Upload the template with the condition function.
  • In the Parameters select Default.
  • Click Next, then click Create Stack.

Additional Resources

Login as cloud_user with the credentials provided. Make sure you are in us-east-1.

Three files can be downloaded from github here:

https://github.com/natonic/CloudFormation-Deep-Dive/tree/master/Labs/Condition%20Functions

Lab1_VPC.json is the "before" template. There is no condition in this template. If you want to try the challenge, adapt this template to add a parameter, a condition, and then a decision on tenancy based on the condition.

hints.json holds a couple of hints on configuring the condition if you need a little help.

vpctenancy.json is the solution template and can be used if you just want to follow along with the video walking through the solution.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?