@deployfoundation/foundation-deploy 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/app.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  FoundationNetwork,
8
8
  FoundationPipeline,
9
9
  NewsletterStack
10
- } from "../chunk-4z1tsy0m.js";
10
+ } from "../chunk-sxvts8bf.js";
11
11
  import {
12
12
  adminsFor,
13
13
  instanceNames,
@@ -2304,7 +2304,7 @@ class NewsletterStack extends cdk6.Stack {
2304
2304
  this.campaignQueue.grantConsumeMessages(campaignRole);
2305
2305
  this.campaignQueue.grantSendMessages(campaignRole);
2306
2306
  this.tokenSigningSecret.grantRead(campaignRole);
2307
- grantSesSend(campaignRole, identityArn, senderAddress);
2307
+ grantSesSend(campaignRole, identityArn, configurationSetArn, senderAddress);
2308
2308
  const publicFunction = new lambda2.Function(this, "PublicFunction", {
2309
2309
  runtime: lambda2.Runtime.NODEJS_22_X,
2310
2310
  handler: "index.handler",
@@ -2631,13 +2631,18 @@ function lambdaRole(scope, id, description) {
2631
2631
  ]
2632
2632
  });
2633
2633
  }
2634
- function grantSesSend(role, identityArn, senderAddress) {
2634
+ function grantSesSend(role, identityArn, configurationSetArn, senderAddress) {
2635
2635
  role.addToPolicy(new iam7.PolicyStatement({
2636
2636
  sid: "SendFromNewsletterIdentity",
2637
2637
  actions: ["ses:SendEmail"],
2638
2638
  resources: [identityArn],
2639
2639
  conditions: { StringEquals: { "ses:FromAddress": senderAddress } }
2640
2640
  }));
2641
+ role.addToPolicy(new iam7.PolicyStatement({
2642
+ sid: "SendThroughNewsletterConfigurationSet",
2643
+ actions: ["ses:SendEmail"],
2644
+ resources: [configurationSetArn]
2645
+ }));
2641
2646
  }
2642
2647
  function senderAddressFor(sender) {
2643
2648
  const address = /<([^>]+)>$/.exec(sender)?.[1];
package/dist/src/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  FoundationPipeline,
10
10
  NewsletterStack,
11
11
  deployStatements
12
- } from "../chunk-4z1tsy0m.js";
12
+ } from "../chunk-sxvts8bf.js";
13
13
  import {
14
14
  BUN_VERSION,
15
15
  LAMBDA_ENTRY_POINTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deployfoundation/foundation-deploy",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Deploys one Foundation instance from a published, signed release: the CDK app and the deploy tool.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -198,7 +198,7 @@ export class NewsletterStack extends cdk.Stack {
198
198
  this.campaignQueue.grantConsumeMessages(campaignRole);
199
199
  this.campaignQueue.grantSendMessages(campaignRole);
200
200
  this.tokenSigningSecret.grantRead(campaignRole);
201
- grantSesSend(campaignRole, identityArn, senderAddress);
201
+ grantSesSend(campaignRole, identityArn, configurationSetArn, senderAddress);
202
202
 
203
203
  const publicFunction = new lambda.Function(this, "PublicFunction", {
204
204
  runtime: lambda.Runtime.NODEJS_22_X,
@@ -554,7 +554,12 @@ function lambdaRole(scope: Construct, id: string, description: string): iam.Role
554
554
  });
555
555
  }
556
556
 
557
- function grantSesSend(role: iam.Role, identityArn: string, senderAddress: string): void {
557
+ function grantSesSend(
558
+ role: iam.Role,
559
+ identityArn: string,
560
+ configurationSetArn: string,
561
+ senderAddress: string,
562
+ ): void {
558
563
  role.addToPolicy(
559
564
  new iam.PolicyStatement({
560
565
  sid: "SendFromNewsletterIdentity",
@@ -563,6 +568,18 @@ function grantSesSend(role: iam.Role, identityArn: string, senderAddress: string
563
568
  conditions: { StringEquals: { "ses:FromAddress": senderAddress } },
564
569
  }),
565
570
  );
571
+ // SES v2 authorizes a send against EVERY resource it names, and each send
572
+ // names the configuration set (that is how delivery, bounce and complaint
573
+ // events reach the suppression queue). Without this, every confirmation and
574
+ // campaign send was an AccessDeniedException. The sender stays pinned by the
575
+ // identity statement above.
576
+ role.addToPolicy(
577
+ new iam.PolicyStatement({
578
+ sid: "SendThroughNewsletterConfigurationSet",
579
+ actions: ["ses:SendEmail"],
580
+ resources: [configurationSetArn],
581
+ }),
582
+ );
566
583
  }
567
584
 
568
585
  function senderAddressFor(sender: string): string {