波田野 裕一
2021-08-31
CloudFormationリソースS3::BucketPolicyを利用してS3バケットにバケットポリシーを作成します。
本手順は、以下の権限を有する「IAMユーザー」もしくは「IAMロールが付与された環境(Cloud9などを含むEC2環境)で行います。
作業権限条件: 必要なIAMポリシー
AWSCloudFormationFullAccess
AmazonS3FullAccess
必要なIAMポリシーを利用する環境(「IAMユーザー」「IAMグループ」もしくは「IAMロール」)にアタッチした後に、手順を実施します。
注釈
本手順は、Cloud9環境での実施を推奨します。
AWS CLIハンズオンの環境構築手順: http://prototype-handson-cli.s3-website-ap-northeast-1.amazonaws.com/handson_light_web-aws_prepare/handson_light_web-aws_prepare-cloud9/index.html
本手順は、以下の環境で行います。
環境条件1: OSとバージョン
本手順は、Amazon Linux 2"Karoo"以降のOS環境での実施を前提としています。
コマンド: cat /etc/system-release 結果(例): Amazon Linux release 2 (Karoo)
コマンド:
cat /etc/system-release
結果(例):
Amazon Linux release 2 (Karoo)
環境条件2: シェルとバージョン
本手順は、bash "4.2.46(2)-release"以降のシェル環境での実施を前提としています。
コマンド: bash --version -v \ | head -1 結果(例): GNU bash, バージョン 4.2.46(2)-release (x86_64-redhat-linux-gnu)
bash --version -v \ | head -1
GNU bash, バージョン 4.2.46(2)-release (x86_64-redhat-linux-gnu)
環境条件3: AWS CLIのバージョン
本手順は、AWS CLIのバージョン"1.20.5"以降での実施を前提としています。
コマンド: aws --version 結果(例): aws-cli/1.20.5 Python/3.7.10 Linux/4.14.238-182.422.amzn1.x86_64 botocore/1.21.5
aws --version
aws-cli/1.20.5 Python/3.7.10 Linux/4.14.238-182.422.amzn1.x86_64 botocore/1.21.5
本手順書で構築するAWSリソースの構成は以下の図のようになります。
CLIハンズオンの実施方法や効果的に行うためのポイントについては、CLIハンズオンガイドをご参照ください。
CloudShell環境で作業を実施します。
ハンズオン環境への権限追加
今後の参考にするため、本手順についてご意見・コメントをお願いします。
必須項目はありません。お気軽にご回答ください。
内容が違えばお一人何回回答していただいても問題ありません。
はまりどころや誤字・脱字などの修正のご指摘もお待ちしています。
このアンケートシステムはS3 + Cognitoで構築しています。
Cloud9環境の停止
ハンズオン環境からの権限剥奪
(特になし)
https://aws.amazon.com/jp/cloudformation/
特徴: https://aws.amazon.com/jp/cloudformation/features/
料金: https://aws.amazon.com/jp/cloudformation/pricing/
リソース: https://aws.amazon.com/jp/cloudformation/resources/
よくある質問: https://aws.amazon.com/jp/cloudformation/faqs/
https://docs.aws.amazon.com/ja_jp/cloudformation/index.html
ユーザーガイド: https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/index.html
CloudFormation CLIリファレンス (v1): https://docs.aws.amazon.com/cli/latest/reference/cloudformation/index.html
CloudFormation CLIリファレンス (v2): https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/index.html
CloudFormation APIリファレンス: https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/APIReference/index.html
Actions: https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/APIReference/API_Operations.html
User Guide for Extension Development: https://docs.aws.amazon.com/ja_jp/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html
https://aws.amazon.com/jp/aws-jp-introduction/aws-jp-webinar-service-cut/
CloudFormation (2020/08/26)
SlideShare: https://www.slideshare.net/AmazonWebServicesJapan/20200826-aws-black-belt-online-seminar-aws-cloudformation-238501102
PDF: https://d1.awsstatic.com/webinars/jp/pdf/services/20200826_AWS-BlackBelt_AWS-CloudFormation.pdf
Youtube: https://youtu.be/Viyqh9fNBjw
CloudFormation deep dive (2020/10/06)
SlideShare: https://www.slideshare.net/AmazonWebServicesJapan/20201006-aws-black-belt-online-seminar-aws-cloudformation-deep-dive
PDF: https://d1.awsstatic.com/webinars/jp/pdf/services/20201006_BlackBelt_CloudFormation_DeepDive.pdf
Youtube: https://youtu.be/XOuhtEIdf0k