This page is under regular updates. Please check back later for more content.
Introductory Example

Lab 01 | Introductory Example

  • We're going to create a simple EC2 instance.
  • Then we're going to create to add an Elastic IP to it
  • And we're going to add two security groups to it

Implementation

Click Here for tutorial

AWS CloudFormation Template reference (opens in a new tab)

Create a YAML file.

L01_1-simple_ec2.yaml
Resources:
  MyInstance:
    Type: AWS::EC2::Instance
    Properties:
      AvailabilityZone: us-east-1a
      ImageId: ami-a4c7edb2
      InstanceType: t2.micro

Here in the YAML file -

PropertyDescription
ResourcesDefines the AWS resources in this CloudFormation template.
MyInstanceName of the logical ID for our CloudFormation.
TypeType of AWS resource, here it's an EC2 instance.
PropertiesContains basics settings for the EC2 instance.
AvailabilityZoneThe specific zone (us-east-1a) where the EC2 instance will run.
ImageIdThe ID of the AMI (Amazon Machine Image) used to launch the instance.
InstanceTypeThe size/type of the EC2 instance (t2.micro is a small instance).