· 6 years ago · Aug 30, 2019, 07:04 PM
1aws cloudformation create-stack --stack-name SSH-Bastion-Stack \
2 --template-body file://Tempate-test.cf.json \
3 --parameters ParameterKey=VPC,ParameterValue=vpc-xxxx \
4 ParameterKey=Subnet,ParameterValue=subnet-xxxxx \
5 ParameterKey=KeyPair,ParameterValue=your-keypair-name \
6 ParameterKey=InstanceType,ParameterValue=t2.micro
7
8When you run this template you have to provide it with 4 paramaters as declared in the Parameters section .
9
10Let's break it down:
11####################
12Line 1 : aws cli using API using cloudformation service then specify your stack name
13Line 2 : you can change directory (cd) to directory of your template and use file://your-filename
14Line 2": this template using added plugin in visual Studio called : "Cloudformation Templates" needs the file to be fielname.cf.json
15Line 3 : assign each input parameter by Key and Value
16Line 5 : add your keypair file name without .pem like :my-key not my-key.pem
17Line 6 : this parameter will be validated for only allowed values stated in the template