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) {
588588 const prefix = state . Parameters . Prefix ;
589589 let arn ;
590590
591- if ( prefix ) {
592- arn = `arn:aws:s3:::${ bucket } /${ prefix } /${ key } ` ;
593- } else if ( bucket === '*' && key === '*' ) {
591+ if ( bucket === '*' && key === '*' ) {
594592 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 } ` ;
595597 } else {
596598 arn = `arn:aws:s3:::${ bucket } /${ key } ` ;
597599 }
@@ -737,6 +739,9 @@ function getIamPermissions(taskStates) {
737739 case 'arn:aws:states:::s3:putObject' :
738740 case 'arn:aws:states:::aws-sdk:s3:putObject' :
739741 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 ) ;
740745
741746 default :
742747 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