@@ -805,26 +805,26 @@ export class StacksCloud extends Stack {
805
805
} ) ,
806
806
)
807
807
808
- // this.storage.emailBucket.addToResourcePolicy(
809
- // new iam.PolicyStatement({
810
- // sid: `AllowSESToEncryptMessagesBelongingToThisAccount`,
811
- // effect: iam.Effect.ALLOW,
812
- // principals: [sesPrincipal],
813
- // actions: [
814
- // 'kms:Decrypt',
815
- // 'kms:GenerateDataKey*',
816
- // ],
817
- // resources: ['*'],
818
- // conditions: {
819
- // StringEquals: {
820
- // 'aws:SourceAccount': Stack.of(this).account,
821
- // },
822
- // ArnLike: {
823
- // 'aws:SourceArn': `arn:aws:ses:${this.region}:${Stack.of(this).account}:receipt-rule-set/${ruleSetName}:receipt-rule/${ruleName}`,
824
- // },
825
- // },
826
- // }),
827
- // )
808
+ this . storage . emailBucket . addToResourcePolicy (
809
+ new iam . PolicyStatement ( {
810
+ sid : `AllowSESToEncryptMessagesBelongingToThisAccount` ,
811
+ effect : iam . Effect . ALLOW ,
812
+ principals : [ sesPrincipal ] ,
813
+ actions : [
814
+ 'kms:Decrypt' ,
815
+ 'kms:GenerateDataKey*' ,
816
+ ] ,
817
+ resources : [ '*' ] ,
818
+ conditions : {
819
+ StringEquals : {
820
+ 'aws:SourceAccount' : Stack . of ( this ) . account ,
821
+ } ,
822
+ ArnLike : {
823
+ 'aws:SourceArn' : `arn:aws:ses:${ this . region } :${ Stack . of ( this ) . account } :receipt-rule-set/${ ruleSetName } :receipt-rule/${ ruleName } ` ,
824
+ } ,
825
+ } ,
826
+ } ) ,
827
+ )
828
828
829
829
const iamGroup = new iam . Group ( this , 'IAMGroup' , {
830
830
groupName : `${ this . appName } -${ appEnv } -email-management-s3-group` ,
@@ -1039,7 +1039,7 @@ export class StacksCloud extends Stack {
1039
1039
actions : [ 's3:*' ] ,
1040
1040
resources : [
1041
1041
`arn:aws:s3:::${ this . storage . emailBucket . bucketName } ` ,
1042
- `arn:aws:s3:::${ this . storage . emailBucket . bucketName } /` ,
1042
+ `arn:aws:s3:::${ this . storage . emailBucket . bucketName } /* ` ,
1043
1043
] ,
1044
1044
} )
1045
1045
@@ -1053,15 +1053,10 @@ export class StacksCloud extends Stack {
1053
1053
1054
1054
this . storage . emailBucket . addToResourcePolicy ( new iam . PolicyStatement ( {
1055
1055
sid : `AllowSESToInvokeLambda` ,
1056
- effect : iam . Effect . ALLOW ,
1057
1056
principals : [ sesPrincipal ] ,
1058
1057
actions : [
1059
1058
'lambda:InvokeFunction' ,
1060
1059
] ,
1061
- resources : [
1062
- `arn:aws:lambda:${ this . region } :${ Stack . of ( this ) . account } :function:${ lambdaEmailInbound . functionName } ` ,
1063
- `arn:aws:lambda:${ this . region } :${ Stack . of ( this ) . account } :function:${ lambdaEmailConverter . functionName } ` ,
1064
- ] ,
1065
1060
conditions : {
1066
1061
StringEquals : {
1067
1062
'aws:SourceAccount' : Stack . of ( this ) . account ,
@@ -1075,6 +1070,8 @@ export class StacksCloud extends Stack {
1075
1070
this . storage . emailBucket . addEventNotification ( s3 . EventType . OBJECT_CREATED_PUT , new s3n . LambdaDestination ( lambdaEmailInbound ) , { prefix : 'tmp/email_in' } )
1076
1071
this . storage . emailBucket . addEventNotification ( s3 . EventType . OBJECT_CREATED_PUT , new s3n . LambdaDestination ( lambdaEmailOutbound ) , { prefix : 'tmp/email_out/json' } )
1077
1072
this . storage . emailBucket . addEventNotification ( s3 . EventType . OBJECT_CREATED_COPY , new s3n . LambdaDestination ( lambdaEmailConverter ) , { prefix : 'sent/' } )
1073
+ this . storage . emailBucket . addEventNotification ( s3 . EventType . OBJECT_CREATED_COPY , new s3n . LambdaDestination ( lambdaEmailConverter ) , { prefix : 'inbox/' } )
1074
+ this . storage . emailBucket . addEventNotification ( s3 . EventType . OBJECT_CREATED_COPY , new s3n . LambdaDestination ( lambdaEmailConverter ) , { prefix : 'today/' } )
1078
1075
}
1079
1076
1080
1077
additionalBehaviors ( ) : Record < string , cloudfront . BehaviorOptions > {
0 commit comments