File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88# Right click on the *.ps1 file and select Run with PowerShell
99$ErrorActionPreference = " Stop"
1010
11- $AMIID = aws ec2 describe- images -- filters " Name=name,Values=amzn2-ami-hvm-2.0.202*-x86_64-gp2" -- query " Images[0].ImageId" -- output text
11+ $AMIID = aws ec2 describe- images -- owner amazon -- filters " Name=name,Values=amzn2-ami-hvm-2.0.202*-x86_64-gp2" -- query " Images[0].ImageId" -- output text
1212$VPCID = aws ec2 describe- vpcs -- filter " Name=isDefault, Values=true" -- query " Vpcs[0].VpcId" -- output text
1313$SUBNETID = aws ec2 describe- subnets -- filters " Name=vpc-id, Values=$VPCID " -- query " Subnets[0].SubnetId" -- output text
1414$INSTANCEID = aws ec2 run- instances -- image- id $AMIID -- instance- type t3.micro -- subnet- id $SUBNETID -- iam- instance- profile " Name=ec2-ssm-core" -- query " Instances[0].InstanceId" -- output text
Original file line number Diff line number Diff line change 11#! /bin/bash -e
22# You need to install the AWS Command Line Interface from http://aws.amazon.com/cli/
3- AMIID=" $( aws ec2 describe-images --filters " Name=name,Values=amzn2-ami-hvm-2.0.202*-x86_64-gp2" --query " Images[0].ImageId" --output text) "
3+ AMIID=" $( aws ec2 describe-images --owner amazon -- filters " Name=name,Values=amzn2-ami-hvm-2.0.202*-x86_64-gp2" --query " Images[0].ImageId" --output text) "
44VPCID=" $( aws ec2 describe-vpcs --filter " Name=isDefault, Values=true" --query " Vpcs[0].VpcId" --output text) "
55SUBNETID=" $( aws ec2 describe-subnets --filters " Name=vpc-id, Values=$VPCID " --query " Subnets[0].SubnetId" --output text) "
66INSTANCEID=" $( aws ec2 run-instances --image-id " $AMIID " --instance-type t3.micro --subnet-id " $SUBNETID " --iam-instance-profile " Name=ec2-ssm-core" --query " Instances[0].InstanceId" --output text) "
You can’t perform that action at this time.
0 commit comments