Sha256: dee6904dacb70239c3319a118d13ccc17f50b9552c49ffc5f675410cd3622969

Contents?: true

Size: 571 Bytes

Versions: 17

Compression:

Stored size: 571 Bytes

Contents

#!/bin/bash -eux

# Create AMI Bundle
AMI_NAME="<%= @ami_name %>"
INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
REGION=$(aws configure get region)
# Note this will cause the instance to reboot.  Not using the --no-reboot flag
# to ensure consistent AMI creation.
SOURCE_AMI_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/ami-id)
echo "$SOURCE_AMI_ID" > /var/log/source-ami-id.txt
mkdir -p /opt/aws-ec2/data
aws ec2 create-image --name "$AMI_NAME" --instance-id "$INSTANCE_ID" --region "$REGION" > /opt/aws-ec2/data/ami-id.txt

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
aws-ec2-1.4.9 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.8 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.7 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.6 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.5 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.4 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.3 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.2 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.1 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.4.0 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.3.2 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.3.1 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.3.0 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.2.2 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.2.1 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.2.0 lib/aws_ec2/script/templates/ami_creation.sh
aws-ec2-1.1.0 lib/aws_ec2/script/templates/ami_creation.sh