@@ -351,9 +351,8 @@ export class StacksCloud extends Stack {
351
351
if ( config . cloud . cdn ?. enableLogging ) {
352
352
logBucket = new s3 . Bucket ( this , 'LogBucket' , {
353
353
bucketName : `${ this . appName } -logs-${ appEnv } -${ timestamp } ` ,
354
- removalPolicy : RemovalPolicy . RETAIN , // removed via buddy cloud:cleanup because oddly the files in the bucket don't get auto-deleted
355
- // removalPolicy: RemovalPolicy.DESTROY,
356
- // autoDeleteObjects: true,
354
+ removalPolicy : RemovalPolicy . DESTROY ,
355
+ autoDeleteObjects : true ,
357
356
blockPublicAccess : new s3 . BlockPublicAccess ( {
358
357
blockPublicAcls : false ,
359
358
ignorePublicAcls : true ,
@@ -370,7 +369,7 @@ export class StacksCloud extends Stack {
370
369
// Daily 35 day retention
371
370
const vault = new backup . BackupVault ( this , 'BackupVault' , {
372
371
backupVaultName : `${ this . appName } -${ appEnv } -daily-backup-vault-${ timestamp } ` ,
373
- // encryptionKey: this.storage?.encryptionKey,
372
+ encryptionKey : this . storage ?. emailBucket ?. encryptionKey ,
374
373
} )
375
374
const plan = backup . BackupPlan . daily35DayRetention ( this , 'BackupPlan' , vault )
376
375
@@ -757,6 +756,7 @@ export class StacksCloud extends Stack {
757
756
} )
758
757
759
758
const ruleName = 'Inbound'
759
+ // const receiptRule = new ses.CfnReceiptRule(this, 'SESReceiptRule', {
760
760
new ses . CfnReceiptRule ( this , 'SESReceiptRule' , {
761
761
ruleSetName : ruleSet . ref ,
762
762
rule : {
@@ -766,7 +766,7 @@ export class StacksCloud extends Stack {
766
766
{
767
767
s3Action : {
768
768
bucketName : this . storage . emailBucket . bucketName ,
769
- // kmsKeyArn: this.storage.emailBucket.encryptionKey?.keyArn,
769
+ kmsKeyArn : this . storage . emailBucket . encryptionKey ?. keyArn ,
770
770
objectKeyPrefix : 'tmp/email_in' ,
771
771
} ,
772
772
} ,
@@ -804,10 +804,10 @@ export class StacksCloud extends Stack {
804
804
'kms:Decrypt' ,
805
805
'kms:GenerateDataKey' ,
806
806
] ,
807
- resources : [ '*' ] ,
807
+ resources : [ this . storage . emailBucket . encryptionKey ?. keyArn || '*' ] ,
808
808
conditions : {
809
809
StringEquals : {
810
- 'aws:SourceAccount' : this . account ,
810
+ 'aws:SourceAccount' : Stack . of ( this ) . account ,
811
811
} ,
812
812
ArnLike : {
813
813
'aws:SourceArn' : `arn:aws:ses:${ this . region } :${ Stack . of ( this ) . account } :receipt-rule-set/${ ruleSetName } :receipt-rule/${ ruleName } ` ,
@@ -1195,7 +1195,7 @@ export class StacksCloud extends Stack {
1195
1195
versioned : true ,
1196
1196
removalPolicy : RemovalPolicy . DESTROY ,
1197
1197
autoDeleteObjects : true ,
1198
- encryption : s3 . BucketEncryption . S3_MANAGED ,
1198
+ encryption : s3 . BucketEncryption . KMS_MANAGED ,
1199
1199
enforceSSL : true ,
1200
1200
publicReadAccess : false ,
1201
1201
blockPublicAccess : {
@@ -1223,7 +1223,7 @@ export class StacksCloud extends Stack {
1223
1223
versioned : true ,
1224
1224
removalPolicy : RemovalPolicy . DESTROY ,
1225
1225
autoDeleteObjects : true ,
1226
- // encryption: s3.BucketEncryption.S3_MANAGED ,
1226
+ encryption : s3 . BucketEncryption . KMS_MANAGED ,
1227
1227
lifecycleRules : [
1228
1228
{
1229
1229
id : '24h' ,
0 commit comments