Skip to content

Commit

Permalink
fix: aws-amplify#5794 - storage access problem with groups (aws-ampli…
Browse files Browse the repository at this point in the history
  • Loading branch information
Attila Hajdrik authored and jhockett committed Nov 12, 2020
1 parent 2742f5f commit 45c9449
Showing 1 changed file with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"s3PermissionsGuestPublic": {
"Type": "String",
"Default" : "DISALLOW"
},
},
"s3PermissionsGuestUploads": {
"Type": "String",
"Default" : "DISALLOW" },
Expand Down Expand Up @@ -171,7 +171,7 @@
"Resources": {
"S3Bucket": {
"Type": "AWS::S3::Bucket",
<% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
<% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
"DependsOn": [
"TriggerPermissions"
],
Expand Down Expand Up @@ -213,7 +213,7 @@
}
]
},
<% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
<% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
"NotificationConfiguration": {
"LambdaConfigurations": [
{
Expand Down Expand Up @@ -299,14 +299,33 @@
]
}
]
}
}
<% if (props.groupPolicyMap[props.groupList[i]].includes('s3:ListBucket')) { %>
,{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": [
{
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "S3Bucket"
}
]
]
}
]
}
<% } %>
]
}
}
},
<% } %>
<% } %>
<% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
<% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
"TriggerPermissions": {
"Type": "AWS::Lambda::Permission",
"Properties": {
Expand Down Expand Up @@ -429,7 +448,7 @@
"Action": {
"Fn::Split" : [ "," , {
"Ref": "s3PermissionsAuthenticatedPublic"
} ]
} ]
},
"Resource": [
{
Expand Down Expand Up @@ -473,7 +492,7 @@
"Action": {
"Fn::Split" : [ "," , {
"Ref": "s3PermissionsAuthenticatedProtected"
} ]
} ]
},
"Resource": [
{
Expand Down Expand Up @@ -517,7 +536,7 @@
"Action": {
"Fn::Split" : [ "," , {
"Ref": "s3PermissionsAuthenticatedPrivate"
} ]
} ]
},
"Resource": [
{
Expand Down Expand Up @@ -561,7 +580,7 @@
"Action": {
"Fn::Split" : [ "," , {
"Ref": "s3PermissionsAuthenticatedUploads"
} ]
} ]
},
"Resource": [
{
Expand Down Expand Up @@ -678,7 +697,7 @@
"Action": {
"Fn::Split" : [ "," , {
"Ref": "s3PermissionsGuestPublic"
} ]
} ]
},
"Resource": [
{
Expand Down Expand Up @@ -722,7 +741,7 @@
"Action": {
"Fn::Split" : [ "," , {
"Ref": "s3PermissionsGuestUploads"
} ]
} ]
},
"Resource": [
{
Expand Down

0 comments on commit 45c9449

Please sign in to comment.