Help us understand the problem. What is going on with this article?

[JAWS-UG CLI] S3 #16 S3バケットへの設定ファイルの配置

More than 3 years have passed since last update.

前提条件

S3

S3(conf)バケットへのアクセス権

0. 準備

1. 事前作業

1.1. AMI設定情報ディレクトリの指定

変数の指定
DIR_CONF_AMI='config-ami-handson-20170213'

1.2. S3バケットの指定

変数の指定
S3_BUCKET_NAME="conf-${AWS_ID}"

2. 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

3. 事後作業

コマンド
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

完了

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away