Open1

AWS Cloud9からAmazon s3 にファイルを転送

marchanmarchan

aws configure を確認

$ aws configure list
  Name                    Value             Type    Location
  ----                    -----             ----    --------

profile <not set> None None
access_key ****************2B7M shared-credentials-file
secret_key ****************1n6b shared-credentials-file
region ap-northeast-1 config-file ~/.aws/config

Amazon s3 に接続を確認

$ aws s3 ls

2024-11-15 23:46:20 amazon-connect-82f6e732924b
2024-11-12 05:30:21 amplify-amplifyupload-dev-24346-deployment
2024-11-09 02:29:50 amplifyupload-hosting-dev
2024-11-09 02:29:50 amplifyupload2024062424346-dev
2024-11-16 03:51:57 aws-athena-query-results-ap-northeast-1-053423220213
2024-11-12 11:45:19 cdk-hnb659fds-assets-053423220213-ap-northeast-1

ディレクトリを移動

$ cd pgm_rating
ls -ls

0 drwxr-xr-x. 2 ec2-user ec2-user 50 Dec 3 05:04 every_minute
4 -rw-r--r--. 1 ec2-user ec2-user 188 Feb 6 2024 common.js
4 -rw-r--r--. 1 ec2-user ec2-user 2980 Jul 30 08:08 index.html

Amazon s3 にファイル転送

$ aws s3 cp index.html s3://shima-web/pgm_rating/

upload: ./index.html to s3://shima-web/pgm_rating/index.html

$ aws s3 cp upload_pgm_rating.js s3://shima-web/pgm_rating/

upload: ./upload_pgm_rating.js to s3://shima-web/pgm_rating/upload_pgm_rating.js

Amazon s3 にてファイルの存在を確認する

$ aws s3 ls s3://shima-web/pgm_rating/

2024-12-03 05:55:53 1217 index.html
2024-12-03 05:56:30 3817 upload_pgm_rating.js