Useful Commands

SSH to an EC2 instnace

ssh -i ~/repos/aws/keypair/awsAccess.pem ec2-user@52.65.42.180

Copy a file to remote server

scp -i awsAccess.pem awsAccess.pem ec2-user@52.65.42.180:/tmp/

Get docker login

Get docker login bash command

aws ecr get-login --no-include-email

Create stack using aws-cli

aws cloudformation create-stack --stack-name simpleSite --template-body file://s3_simple_website.json --parameters ParameterKey=Stackname,ParameterValue=stage1,ParameterKey=AppName,ParameterValue=something

aws cloudformation delete-stack --stack-name simpleSite

Redirect all TCP traffic to another ip address.

sudo yum install socat
socat TCP-LISTEN:8080,fork TCP:10.0.100.121:80