AWS EC2 Mastering, interview preparation, essential questions, answers, components, scaling, security, monitoring.

Automating EC2 Instance Creation with AWS CLI Script – A Step-by-Step Guide

AWS, How to By Feb 11, 2023 No Comments

Here is an AWS CLI script that creates an EC2 instance with a subnet in the “us-east-1a” availability zone, in a security group, and with an Ubuntu 20.04 t2.small instance type:

aws ec2 run-instances \
  --image-id ami-0c55b159cbfafe1f0 \
  --instance-type t2.small \
  --key-name MyKeyPair \
  --security-group-ids sg-49d61617 \
  --subnet-id subnet-049df61146f127901 \
  --placement "AvailabilityZone=us-east-1a" \

            
Author

I'm Abhay Singh, an Architect with 9 Years of It experience. AWS Certified Solutions Architect.

No Comments

Leave a comment

Your email address will not be published. Required fields are marked *