Skip to content

Commit 87e5ed3

Browse files
fix: Update IAM policy with specific S3 permissions for SAM deployment
- Add specific S3 permissions for SAM deployment bucket - Include s3:GetObject, s3:PutObject, s3:DeleteObject, s3:ListBucket - Add s3:GetBucketLocation, s3:GetObjectVersion, s3:PutObjectAcl - Allow s3:CreateBucket, s3:DeleteBucket, s3:ListAllMyBuckets for bucket management - Target specific S3 bucket: cn-seba-aws-sam-cli-managed-default-samclisourcebucket
1 parent ff056e8 commit 87e5ed3

2 files changed

Lines changed: 50 additions & 2 deletions

File tree

create_role.ps1

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,12 +1111,36 @@ $POLICY_DOCUMENT = @"
11111111
"Effect": "Allow",
11121112
"Action": [
11131113
"cloudformation:*",
1114-
"s3:*",
11151114
"lambda:*",
11161115
"iam:*",
11171116
"logs:*"
11181117
],
11191118
"Resource": "*"
1119+
},
1120+
{
1121+
"Effect": "Allow",
1122+
"Action": [
1123+
"s3:GetObject",
1124+
"s3:PutObject",
1125+
"s3:DeleteObject",
1126+
"s3:ListBucket",
1127+
"s3:GetBucketLocation",
1128+
"s3:GetObjectVersion",
1129+
"s3:PutObjectAcl"
1130+
],
1131+
"Resource": [
1132+
"arn:aws:s3:::cn-seba-aws-sam-cli-managed-default-samclisourcebucket",
1133+
"arn:aws:s3:::cn-seba-aws-sam-cli-managed-default-samclisourcebucket/*"
1134+
]
1135+
},
1136+
{
1137+
"Effect": "Allow",
1138+
"Action": [
1139+
"s3:CreateBucket",
1140+
"s3:DeleteBucket",
1141+
"s3:ListAllMyBuckets"
1142+
],
1143+
"Resource": "*"
11201144
}
11211145
]
11221146
}

create_role.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,12 +1094,36 @@ POLICY_DOCUMENT=$(cat <<EOF
10941094
"Effect": "Allow",
10951095
"Action": [
10961096
"cloudformation:*",
1097-
"s3:*",
10981097
"lambda:*",
10991098
"iam:*",
11001099
"logs:*"
11011100
],
11021101
"Resource": "*"
1102+
},
1103+
{
1104+
"Effect": "Allow",
1105+
"Action": [
1106+
"s3:GetObject",
1107+
"s3:PutObject",
1108+
"s3:DeleteObject",
1109+
"s3:ListBucket",
1110+
"s3:GetBucketLocation",
1111+
"s3:GetObjectVersion",
1112+
"s3:PutObjectAcl"
1113+
],
1114+
"Resource": [
1115+
"arn:aws:s3:::cn-seba-aws-sam-cli-managed-default-samclisourcebucket",
1116+
"arn:aws:s3:::cn-seba-aws-sam-cli-managed-default-samclisourcebucket/*"
1117+
]
1118+
},
1119+
{
1120+
"Effect": "Allow",
1121+
"Action": [
1122+
"s3:CreateBucket",
1123+
"s3:DeleteBucket",
1124+
"s3:ListAllMyBuckets"
1125+
],
1126+
"Resource": "*"
11031127
}
11041128
]
11051129
}

0 commit comments

Comments
 (0)