Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access.
Lab 83
Services Covered
- CloudFormation
- S3
- EC2
Lab description
AWS CloudFormation Sample Template EC2InstanceWithSecurityGroupSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access. WARNING This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.
- Create a CloudFormation template
- Upload template to S3 bucket
- Create CloudFormation stack
Lab date
09-10-2021
Prerequisites
- AWS account
Lab steps
- Write or copy CloudFormation template file and upload it to a S3 bucket.
- Create a CloudFormation Stack. Use the template.json stored in S3 as a source file. You can review it in Designer.
When the stack gets createdGo to EC2 and review created resources
- Delete the stack which will delete the created resources.