Skip to content

Instantly share code, notes, and snippets.

@ReedD
Created June 9, 2015 16:11
Show Gist options
  • Save ReedD/f4a0d95261ce0e15ed2b to your computer and use it in GitHub Desktop.
Save ReedD/f4a0d95261ce0e15ed2b to your computer and use it in GitHub Desktop.
EC2 MongoDB instance startup command
#!/bin/bash
# http://docs.mongodb.org/ecosystem/platforms/amazon-ec2/
# the following command is the updated version of the command
# used to setup the mongo instance along with the recommended
# EBS volumes
aws --profile <AWS_PROFILE> ec2 run-instances \
--image-id <CURRENT_AWS_LINUX_AMI> \
--instance-type <INSTANCE_TYPE> \
--security-group-ids <SECURITY_GROUP_ID> \
--key-name <KEY_PAIR_NAME> \
--block-device-mappings '[
{
"DeviceName": "/dev/xvdf",
"Ebs": {
"VolumeSize": 200,
"DeleteOnTermination": false,
"VolumeType": "io1",
"Iops": 1000,
"Encrypted": false
}
},
{
"DeviceName": "/dev/xvdg",
"Ebs": {
"VolumeSize": 25,
"DeleteOnTermination": false,
"VolumeType": "io1",
"Iops": 250, "Encrypted": false
}
},
{
"DeviceName": "/dev/xvdh",
"Ebs": {
"VolumeSize": 10,
"DeleteOnTermination": false,
"VolumeType": "io1",
"Iops": 100,
"Encrypted": false
}
}
]' \
--ebs-optimized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment