Skip to content

Commit e098782

Browse files
Grant deploy role scoped access to the SAM-managed bucket stack
--resolve-s3 manages the aws-sam-cli-managed-default stack/bucket; allow the deploy role to operate on exactly those SAM-managed resources (still no admin).
1 parent 503ffd2 commit e098782

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

template.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ Resources:
8585
- cloudformation:DescribeChangeSet
8686
- cloudformation:ExecuteChangeSet
8787
- cloudformation:DeleteChangeSet
88-
Resource: !Sub "arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/faq-assistant/*"
88+
Resource:
89+
- !Sub "arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/faq-assistant/*"
90+
# SAM's --resolve-s3 manages this stack to provision the deploy bucket.
91+
- !Sub "arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/aws-sam-cli-managed-default/*"
8992
- Sid: CloudFormationServerlessTransform
9093
Effect: Allow
9194
Action: cloudformation:CreateChangeSet
@@ -99,6 +102,13 @@ Resources:
99102
- Sid: SamDeployBucket
100103
Effect: Allow
101104
Action:
105+
- s3:CreateBucket
106+
- s3:GetBucketPolicy
107+
- s3:PutBucketPolicy
108+
- s3:PutBucketTagging
109+
- s3:PutBucketVersioning
110+
- s3:PutBucketPublicAccessBlock
111+
- s3:PutEncryptionConfiguration
102112
- s3:GetObject
103113
- s3:PutObject
104114
- s3:GetBucketLocation

0 commit comments

Comments
 (0)