Create a VPC and EC2: Automated via CloudFormation

run ./create.sh vpc vpc_ec2.yml

bash: ./create.sh: Permission denied
soln: chmod u+x create.sh

vpc1 vpc2

aws cloudformation create-stack \
--stack-name $1 \
--template-body file://$2  \
--parameters file://$3 \
--capabilities "CAPABILITY_IAM" "CAPABILITY_NAMED_IAM" \
--region=us-east-1
./create.sh vpc vpc_ec2.yml vpc_ec2.json  
./update.sh vpc vpc_ec2.yml vpc_ec2.json   
./describe.sh [stack name]  
./delete.sh [stack name]

vpc3 vpc4 vpc5

Describe stack
vpc6

Expected Output

To verify, you will use the public IP address of the newly launched EC2 instance, and paste it in a new browser window. You should see the Apache web server test page.

Note: Use http ( not https! ), like so: http://public-ip-address

To Run the User data

Connect to the Instance or ssh into it. then install the steps manually.

#!/bin/bash
sudo yum update -y
sudo yum install -y httpd
sudo systemctl start httpd

ec21 ec23 ec22 ec24