~/environment
from the top menu:Click I trust the author on the next dialog.
git clone https://github.com/longthg-workshops/amazon-ecs-mythicalmysfits-workshop.git
cd amazon-ecs-mythicalmysfits-workshop/workshop-1
script/setup
#! /bin/bash
set -eu
echo "Removing unneeded docker images..."
docker images -q | xargs docker rmi || true
echo "Installing dependencies..."
sudo yum install -y jq
echo "Fetching CloudFormation outputs..."
script/fetch-outputs
echo "Populating DynamoDB table..."
script/load-ddb
echo "Uploading static site to S3..."
if [[ $# -eq 1 ]]; then
script/upload-site $1
else
script/upload-site
fi
echo "Installing ECR Cred Helper..."
sudo script/credhelper
echo "Attaching Instance Profile to Cloud9..."
script/associate-profile
echo "Success!"
When you see “Success!” on the interface, the command has been executed successfully.
export ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account)
export TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60")
export AWS_REGION=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region')
echo "export ACCOUNT_ID=${ACCOUNT_ID}" >> ~/.bash_profile
echo "export AWS_REGION=${AWS_REGION}" >> ~/.bash_profile
aws configure set default.region ${AWS_REGION}
aws configure get default.region