Skip to content

Instantly share code, notes, and snippets.

@benileo
Last active June 11, 2017 18:40
Show Gist options
  • Save benileo/a61098be565e0ea02da7f11046f44ed0 to your computer and use it in GitHub Desktop.
Save benileo/a61098be565e0ea02da7f11046f44ed0 to your computer and use it in GitHub Desktop.
#!/bin/bash -ex
AMI_ID=ami-efd0428f
PROFILE=jammin
REGION=us-west-2
USER_DATA=$(mktemp)
TYPE="t2.micro"
DRY_RUN=""
write-mime-multipart --output=$USER_DATA \
cloud-init.template bootstrap.sh:text/x-shellscript
aws --profile $PROFILE --region $REGION ec2 run-instances $DRY_RUN \
--image-id $AMI_ID \
--user-data file://$USER_DATA \
--instance-type $TYPE \
--count 1 \
--subnet-id xxxxxxxxxx \
--security-group-ids xxxxxxxxxx \
--block-device-mappings file://mapping.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment