前提条件
S3
S3(conf)バケットへのアクセス権
-
準備
======= -
事前作業
===========
1.1. AMI設定情報ディレクトリの指定
変数の指定
DIR_CONF_AMI='config-ami-handson-20170213'
1.2. S3バケットの指定
変数の指定
S3_BUCKET_NAME="conf-${AWS_ID}"
- S3への転送
=============
変数の確認
cat << ETX
DIR_CONF_AMI: ${DIR_CONF_AMI}
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
ETX
コマンド
aws s3 sync ${DIR_CONF_AMI} s3://${S3_BUCKET_NAME}/${DIR_CONF_AMI} \
--exclude ".*" \
--delete
結果(例):
upload: config-apache-redmine/sample-index.html to s3://conf-${AWS_ID}/config-ami-handson-20170213/database.yml
upload: config-apache-redmine/sample-index.html to s3://conf-${AWS_ID}/config-ami-handson-20170213/httpd-redmine.conf
- 事後作業
===========
コマンド
aws s3 ls s3://${S3_BUCKET_NAME}/${DIR_CONF_AMI}/
結果(例):
2017-02-13 01:23:45 195 database.yml
2017-02-13 01:23:45 513 httpd-redmine.conf