Manage your resources using command line

Oct 25, 2020 15:32


Here are a few AWS commands those are very useful.
Add the profile for the snowball to your AWS CLI configuration by adding the following to the ~/.aws/config file:
[profile snowcone]
region=snowball
output=json
_____
aws ec2 create-security-group --group-name web \
--description "allow 80 and 443" \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 create-security-group --group-name web \
--description "allow 80 and 443" \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 create-security-group --group-name web \
--description "allow 80 and 443" \
--endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 authorize-security-group-ingress \
--group-name web \
--ip-permissions IpProtocol=tcp,FromPort=80,ToPort=80,IpRanges=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.111:8008 \
--profile snowball
aws ec2 authorize-security-group-ingress \
--group-name web \
--ip-permissions IpProtocol=tcp,FromPort=443,ToPort=443,IpRanges=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.111:8008 \
--profile snowball
aws ec2 authorize-security-group-ingress \
--group-name web \
--ip-permissions IpProtocol=icmp,FromPort=-1,ToPort=-1,IpRanges=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.111:8008 \
--profile snowball
aws ec2 authorize-security-group-ingress \
--group-name web \
--ip-permissions IpProtocol=tcp,FromPort=80,ToPort=80,IpRanges=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.112:8008 \
--profile snowcone
aws ec2 authorize-security-group-ingress \
--group-name web \
--ip-permissions IpProtocol=tcp,FromPort=443,ToPort=443,IpRanges=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.112:8008 \
--profile snowcone
aws ec2 authorize-security-group-ingress \
--group-name web \
--ip-permissions IpProtocol=icmp,FromPort=-1,ToPort=-1,IpRangers=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.112:8008 \
--profile snowcone
aws ec2 create-security-group --group-name ssh \
--description "allow ssh" \
--endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 authorize-security-group-ingress \
--group-name ssh \
--ip-permissions IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.111:8008 \
--profile snowball
aws ec2 authorize-security-group-ingress \
--group-name ssh \
--ip-permissions IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges=[{CidrIp=0.0.0.0/0}] \
--endpoint http://192.168.1.112:8008 \
--profile snowcone
aws ec2 create-security-group --group-name dns \
--description "allow 53 for DNS" \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 describe-images --endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 run-instances \
--image-id
--instance-type snc1.medium \
--security-group-ids "" ""
--endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 describe-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 stop-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 start-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 associate-address \
--instance-id s.i-xxxxxxxxxxxxxxxxx \
--public-ip \
--endpoint http://192.168.1.112:8008 --profile snowcone
aws ec2 describe-images --endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 run-instances \
--image-id
--instance-type sbe-c.small \
--security-group-ids "" ""
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 describe-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 stop-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 start-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 associate-address \
--instance-id s.i-xxxxxxxxxxxxxxxxx \
--public-ip \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 run-instances \
--image-id
--instance-type sbe-c.large \
--security-group-ids "" ""
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 describe-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 stop-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 start-instances \
--instance-ids s.i-xxxxxxxxxxxxxxxxx \
--endpoint http://192.168.1.111:8008 --profile snowball
aws ec2 associate-address \
--instance-id s.i-xxxxxxxxxxxxxxxxx \
--public-ip \
--endpoint http://192.168.1.111:8008 --profile snowball
https://aws.amazon.com/blogs/publicsector/managing-edge-of-edge-deployments-rancher/

aws

Previous post Next post
Up