Skip to content

Commit

Permalink
add email sending permissions to task role
Browse files Browse the repository at this point in the history
  • Loading branch information
lbjay committed Nov 15, 2024
1 parent ea33a92 commit 95bd887
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- task role now gets SES permissions to send email

### Modified

- dropped node v12 and v14 from testing matrix; added v20
Expand Down
9 changes: 9 additions & 0 deletions cdk/lib/taskdef.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
aws_ecs as ecs,
aws_logs as logs,
aws_iam as iam,
Stack,
RemovalPolicy,
CfnOutput,
Expand Down Expand Up @@ -63,6 +64,14 @@ export class CacclTaskDef extends Construct {
memoryLimitMiB: taskMemory,
});

const sendEmailPolicy = new iam.PolicyStatement({
actions: ['ses:SendEmail', 'ses:SendRawEmail'],
resources: ['*'],
});

this.taskDef.addToTaskRolePolicy(sendEmailPolicy);
this.appOnlyTaskDef.addToTaskRolePolicy(sendEmailPolicy);

// params for the fargate service's app container
const appContainerParams = {
image: appContainerImage.image,
Expand Down

0 comments on commit 95bd887

Please sign in to comment.