You can create S3 on the management console screen, but I haven't created it by operating it with CLI, so I tried this time.
aws --version
$ aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]: ap-northeast-1
Default output format [None]: json
Nothing is specified for "AWS Access Key ID [None]:" and "AWS Secret Access Key [None]:".
$ mkdir ~/work
$ cd ~/work
$ wget https://hogehoge/hogehoge.png
Execute the s3 ls command by specifying the bucket. Check if there is an image.
$ aws s3 ls s3://hoge
You can also check if there is an image on the management console.
Set public access authority from CLI with the following command.
$ aws s3api put-object-acl --acl public-read --bucket filename--key image name(hoge.png)
Check if there is a permission setting in the access control list.
$ aws s3api get-object-acl --bucket filename--key image name(hoge.png)
Click the object URL in the management console and check if the image can be opened. When the above procedure is followed, the image is displayed.
If you press the object URL and it says "Access Denied" and the image is not displayed, click the "Publish" button in the outline of the object and it will be displayed.
reference Getting Started with Linux Getting Started with AWS
Recommended Posts