Skip to content

Instantly share code, notes, and snippets.

@anuragmathur1
Last active June 30, 2017 04:30
Show Gist options
  • Save anuragmathur1/5f26ed3b14ae6e2ea510678198985106 to your computer and use it in GitHub Desktop.
Save anuragmathur1/5f26ed3b14ae6e2ea510678198985106 to your computer and use it in GitHub Desktop.
aws ec2 create-network-interface --description some-internal --groups sg-xxxxxxxx --subnet-id subnet-xxxxxxxx  --profile=work
aws ec2 create-tags --resources eni-xxxxxxxx --tags Key=Name,Value=some-internal Key=appType,Value=logging --profile=work
aws ec2 run-instances --image-id ami-xxxxxxxx --instance-type t2.medium --security-group-ids sg-xxxxxxxx --subnet-id subnet-xxxxxxxx --iam-instance-profile Arn=arn:aws:iam::123456789876:instance-profile/my-instance-profile --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=elk},{Key=appType,Value=elk}]' 'ResourceType=volume,Tags=[{Key=Name,Value=some-app-host},{Key=appType,Value=some-app}]' --profile=work
aws ec2 attach-network-interface --device-index 1 --instance-id i-xxxxxxxxxxxxxxxxx --network-interface-id eni-xxxxxxxx
#aws ec2 describe-network-interfaces --filters Name=tag:Name,Values=some-app*
#aws ec2 describe-instances --profile=work --filters Name=tag:Name,Values=some-app* --query 'Reservations[*].Instances[*].[InstanceId]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment