File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -588,10 +588,12 @@ function getS3ObjectPermissions(action, state) {
588
588
const prefix = state . Parameters . Prefix ;
589
589
let arn ;
590
590
591
- if ( prefix ) {
592
- arn = `arn:aws:s3:::${ bucket } /${ prefix } /${ key } ` ;
593
- } else if ( bucket === '*' && key === '*' ) {
591
+ if ( bucket === '*' && key === '*' ) {
594
592
arn = '*' ;
593
+ } else if ( prefix & key ) {
594
+ arn = `arn:aws:s3:::${ bucket } /${ prefix } /${ key } ` ;
595
+ } else if ( prefix ) {
596
+ arn = `arn:aws:s3:::${ bucket } /${ prefix } ` ;
595
597
} else {
596
598
arn = `arn:aws:s3:::${ bucket } /${ key } ` ;
597
599
}
@@ -737,6 +739,9 @@ function getIamPermissions(taskStates) {
737
739
case 'arn:aws:states:::s3:putObject' :
738
740
case 'arn:aws:states:::aws-sdk:s3:putObject' :
739
741
return getS3ObjectPermissions ( 's3:PutObject' , state ) ;
742
+ case 'arn:aws:states:::s3:listObjectsV2' :
743
+ case 'arn:aws:states:::aws-sdk:s3:listObjectsV2' :
744
+ return getS3ObjectPermissions ( 's3:listObjectsV2' , state ) ;
740
745
741
746
default :
742
747
if ( isIntrinsic ( state . Resource ) || ! ! state . Resource . match ( / a r n : a w s ( - [ a - z ] + ) * : l a m b d a / ) ) {
You can’t perform that action at this time.
0 commit comments