Last active
June 22, 2022 23:41
-
-
Save jTakasuRyuji/bee4e81bd4927872cd892f6fb3d1c35b to your computer and use it in GitHub Desktop.
S3,IAM(Group,User,Policy)をCLI(CloudShell)にてまとめて定義
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[step1/6]S3バケットの新規作成 | |
| aws s3 mb s3://9999.lab1.example.jp | |
| #[step2/6]ユーザーを新規作成する | |
| aws iam create-user --user-name scott --tags Key=department,Value=car_shop_scott Key=location,Value=tuchiura_ibaraki_japan | |
| #[step3/6]アクセスキーを発行する | |
| aws iam create-access-key --user-name scott | |
| #[step4/6]新しいグループを作成する | |
| aws iam create-group --group-name corp_scott | |
| #[step5/6]グループにユーザーを参加させる | |
| aws iam add-user-to-group --user-name scott --group-name corp_scott | |
| #[step6/6]グループに権限付与する | |
| aws iam attach-group-policy --group-name corp_scott --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
このグループポリシーを適用すると、以下のリスクが発生します
corp_scottのすべてのメンバーは バケットの作成・削除といったS3に対するすべてのタスクが実行可能になる
→適切なポリシー付与が必要(テックデモの為、AmazonS3FullAccessとして説明)