File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -586,23 +586,33 @@ function getS3ObjectPermissions(action, state) {
586
586
const bucket = state . Parameters . Bucket || '*' ;
587
587
const key = state . Parameters . Key || '*' ;
588
588
const prefix = state . Parameters . Prefix ;
589
- let arn ;
589
+ let resource ;
590
590
591
- if ( bucket === '*' && key === '*' ) {
592
- arn = '*' ;
591
+ if ( action === 's3:AmazonS3ReadOnlyAccess' ) {
592
+ action = [
593
+ 's3:Get*' ,
594
+ 's3:List*' ,
595
+ 's3:Describe*' ,
596
+ 's3-object-lambda:Get*' ,
597
+ 's3-object-lambda:List*'
598
+ ] ,
599
+ resource = [
600
+ `arn:aws:s3:::${ bucket } ` ,
601
+ `arn:aws:s3:::${ bucket } /*`
602
+ ] ,
603
+ } else if ( bucket === '*' && key === '*' ) {
604
+ resource = '*' ;
593
605
} else if ( prefix & key ) {
594
- arn = `arn:aws:s3:::${ bucket } /${ prefix } /${ key } ` ;
606
+ resource = `arn:aws:s3:::${ bucket } /${ prefix } /${ key } ` ;
595
607
} else if ( prefix ) {
596
- arn = `arn:aws:s3:::${ bucket } /${ prefix } ` ;
608
+ resource = `arn:aws:s3:::${ bucket } /${ prefix } ` ;
597
609
} else {
598
- arn = `arn:aws:s3:::${ bucket } /${ key } ` ;
610
+ resource = `arn:aws:s3:::${ bucket } /${ key } ` ;
599
611
}
600
612
601
613
return [ {
602
614
action,
603
- resource : [
604
- arn ,
605
- ] ,
615
+ resource,
606
616
} ] ;
607
617
}
608
618
You can’t perform that action at this time.
0 commit comments