※terraformとaws-cliが必要です
#!/bin/bash
APP=myapp
BRANCH=master
DEPLOYMENT_GROUP=$(terraform output 'asg_name')
COMMIT_ID=$(git ls-remote git@github.com:$GITHUB_REPO refs/heads/$BRANCH | awk '{ print $1 }’)
aws deploy create-deployment --application-name $APP \
--deployment-group $DEPLOYMENT_GROUP \
--github-location commitId=$COMMIT_ID,repository=$GITHUB_REPO