LoginSignup
0
0

More than 5 years have passed since last update.

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

Last updated at Posted at 2017-02-13

前提条件

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

完了

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0