Author:
erics , February 10th, 2025
I needed to get all files in a bucket readable by the public easily. Here is the S3 Bucket Policy I applied:
{
"Version" : "2012-10-17" ,
"Statement" : [
{
"Sid" : "PublicReadGetObject" ,
"Effect" : "Allow" ,
"Principal" : "*" ,
"Action" : "s3:GetObject" ,
"Resource" : "arn:aws:s3:::BUCKET_NAME_HERE/*"
}
]
}
To do this via the aws cli command, create the file s3_read_policy.json containing the policy above, with your bucket name in place of BUCKET_NAME_HERE:
aws s3api put - bucket - policy -- bucket BUCKET_NAME_HERE -- policy file : //s3_read_policy.json
Categories: How-To's , Technology Tags: API , AWS , AWS S3 , aws s3api , Bucket , howto , Policy , public , Read , S3 , s3api , tips
| No comments
Author:
erics , July 29th, 2021
SUMMARY: Needed to create an AWS IAM Policy to allow a user access to create and delete EBS snapshots. This script also needed to be able to list volumes:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"Version" : "2012-10-17" ,
"Statement" : [
{
"Sid" : "VisualEditor0" ,
"Effect" : "Allow" ,
"Action" : [
"ec2:DeleteSnapshot" ,
"ec2:ModifySnapshotAttribute" ,
"ec2:CreateSnapshots" ,
"ec2:ResetSnapshotAttribute" ,
"ec2:CreateSnapshot"
] ,
"Resource" : [
"arn:aws:ec2:*:ACCOUNT_ID_HERE:volume/*" ,
"arn:aws:ec2:*:ACCOUNT_ID_HERE:snapshot/*" ,
"arn:aws:ec2:*:ACCOUNT_ID_HERE:instance/*"
]
} ,
{
"Sid" : "VisualEditor1" ,
"Effect" : "Allow" ,
"Action" : [
"ec2:DescribeSnapshotAttribute" ,
"ec2:DescribeVolumes" ,
"ec2:DescribeSnapshots"
] ,
"Resource" : "*"
}
]
}
Categories: How-To's , Technology Tags: Amazon , AWS , Create , Delete , howto , IAM , JSON , Policy , Snapshot , tips , User , volume
| No comments
Author:
erics , July 28th, 2021
SUMMARY: Needed to create an AWS IAM Policy to allow a user access to two buckets and their associated CDN’s in WordPress W3 Total Cache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
"Version" : "2012-10-17" ,
"Statement" : [
{
"Sid" : "VisualEditor0" ,
"Effect" : "Allow" ,
"Action" : "s3:ListBucket" ,
"Resource" : "arn:aws:s3:::wyzaerd-demo-prod"
} ,
{
"Sid" : "VisualEditor1" ,
"Effect" : "Allow" ,
"Action" : [
"s3:PutObject" ,
"s3:GetObject" ,
"s3:DeleteObject" ,
"s3:PutObjectAcl"
] ,
"Resource" : "arn:aws:s3:::wyzaerd-demo-prod/*"
} ,
{
"Sid" : "VisualEditor2" ,
"Effect" : "Allow" ,
"Action" : "s3:ListBucket" ,
"Resource" : "arn:aws:s3:::wyzaerd-demo-dev"
} ,
{
"Sid" : "VisualEditor3" ,
"Effect" : "Allow" ,
"Action" : [
"s3:PutObject" ,
"s3:GetObject" ,
"s3:DeleteObject" ,
"s3:PutObjectAcl"
] ,
"Resource" : "arn:aws:s3:::wyzaerd-demo-dev/*"
} ,
{
"Sid" : "VisualEditor4" ,
"Effect" : "Allow" ,
"Action" : [
"s3:ListAllMyBuckets" ,
"cloudfront:ListDistributions"
] ,
"Resource" : "*"
}
]
}
Categories: How-To's , Technology Tags: Amazon , AWS , Bucket , CDN , CloudFront , howto , IAM , JSON , Policy , S3 , tips , User , W3 Total Cache
| No comments