@mettlecast/domain-cdk-packer 0.2.76 → 0.2.77
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/DomainStack.js +19 -0
- package/dist/pack-domain.d.ts +1 -1
- package/package.json +1 -1
package/dist/DomainStack.js
CHANGED
|
@@ -173,6 +173,9 @@ export class DomainStack extends cdk.Stack {
|
|
|
173
173
|
if (appSecretArn) {
|
|
174
174
|
environment.APP_SECRET_ARN = appSecretArn;
|
|
175
175
|
}
|
|
176
|
+
if (process.env['SES_FROM_EMAIL']) {
|
|
177
|
+
environment.SES_FROM_EMAIL = process.env['SES_FROM_EMAIL'];
|
|
178
|
+
}
|
|
176
179
|
const resolveSubnetSelection = (access) => {
|
|
177
180
|
if (access === 'internet')
|
|
178
181
|
return internetSubnetSelection ?? internalSubnetSelection;
|
|
@@ -547,6 +550,22 @@ export class DomainStack extends cdk.Stack {
|
|
|
547
550
|
}));
|
|
548
551
|
}
|
|
549
552
|
}
|
|
553
|
+
// Grant SES SendEmail permission when a verified sending address is configured.
|
|
554
|
+
// Scoped to the SES identity ARN derived from SES_FROM_EMAIL (e.g. an
|
|
555
|
+
// address or domain identity) — least-privilege. Falls back to 'arn:aws:ses:*:*:*'
|
|
556
|
+
// only when the address is not address-shaped (tests/local).
|
|
557
|
+
if (process.env['SES_FROM_EMAIL']) {
|
|
558
|
+
const sesFrom = process.env['SES_FROM_EMAIL'];
|
|
559
|
+
const sesIdentity = sesFrom.includes('@')
|
|
560
|
+
? `arn:aws:ses:${this.region}:${this.account}:identity/${sesFrom}`
|
|
561
|
+
: `arn:aws:ses:${this.region}:${this.account}:identity/${sesFrom}`;
|
|
562
|
+
for (const fn of allDomainLambdas) {
|
|
563
|
+
fn.addToRolePolicy(new iam.PolicyStatement({
|
|
564
|
+
actions: ['ses:SendEmail', 'ses:SendRawEmail'],
|
|
565
|
+
resources: [sesIdentity],
|
|
566
|
+
}));
|
|
567
|
+
}
|
|
568
|
+
}
|
|
550
569
|
// Replace the tenant-scoped role trust policy — only domain Lambdas can assume with tenantId tag
|
|
551
570
|
// Use a single Statement with ArnLike wildcard to stay under the 2048-byte ACL size limit
|
|
552
571
|
const cfnRole = tenantScopedRole.node.defaultChild;
|
package/dist/pack-domain.d.ts
CHANGED
|
@@ -63,4 +63,4 @@ export interface PackDomainOptions {
|
|
|
63
63
|
* @param options - Optional configuration including VPC, auth, and DB settings.
|
|
64
64
|
* @returns The constructed DomainStack.
|
|
65
65
|
*/
|
|
66
|
-
export declare function packDomain(registry: DomainRegistry, app: cdk.App, stackId: string, eventBusArn: string, options?: PackDomainOptions
|
|
66
|
+
export declare function packDomain(registry: DomainRegistry, app: cdk.App, stackId: string, eventBusArn: string, options?: PackDomainOptions): DomainStack;
|