Skip to content

Commit 843eb60

Browse files
committed
chore(infra): make the S3 marts access policy managed
given how AWS Copilot works, it is more convenient to use a managed policy since it is automatically attached to the Task role.
1 parent d336934 commit 843eb60

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

infra/copilot/streamlit/addons/s3-marts-access-policy.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ Parameters:
1111

1212
Resources:
1313
S3martsBucketAccessPolicy:
14-
Type: AWS::IAM::Policy
14+
Type: AWS::IAM::ManagedPolicy
1515
Properties:
16-
PolicyName: s3martsBucketPolicy
17-
# Attach this policy to the TaskRole provided by Copilot.
18-
Roles:
19-
- "pems-dev-streamlit-TaskRole-5Zuwi15thMkN"
16+
Description: "Access to S3 marts bucket"
2017
PolicyDocument:
2118
Version: "2012-10-17"
2219
Statement:
@@ -30,6 +27,6 @@ Resources:
3027
Resource: "arn:aws:s3:::caltrans-pems-prd-us-west-2-marts"
3128

3229
Outputs:
33-
S3martsAccessPolicyArn:
34-
Description: "The ARN of the S3 marts access policy"
30+
S3martsBucketAccessPolicyArn:
31+
Description: "The ARN of the S3 marts bucket access policy"
3532
Value: !Ref S3martsBucketAccessPolicy

0 commit comments

Comments
 (0)