feat(ses): sending-side builders — configuration set, event destinations, send grants, reputation alarms - #304
Open
laazyj wants to merge 2 commits into
Open
feat(ses): sending-side builders — configuration set, event destinations, send grants, reputation alarms#304laazyj wants to merge 2 commits into
laazyj wants to merge 2 commits into
Conversation
…ons, send grants, reputation alarms
Extend @composurecdk/ses beyond the receiving path with the outbound
sending surface:
- createConfigurationSetBuilder: the unit that tracks a stream of
outbound mail. TLS is required and reputation metrics are enabled by
default (both overridable). .addEventDestination(key, {destination,
events}) routes send events, with snsDestination / eventBusDestination
/ cloudWatchDestination helpers that accept Resolvables so a
destination can ref() a sibling topic or bus.
- identityGrants: consumer-side send grants (ADR-0013). .send delegates
to the identity's native grantSendEmail; .sendFrom scopes the grant
with a ses:FromAddress condition for least privilege.
- createReputationAlarmBuilder: account-level Reputation.BounceRate (>=5%)
and Reputation.ComplaintRate (>=0.1%) alarms with the AWS-recommended
thresholds and treatMissingData: IGNORE. The metrics are account/Region
scoped and dimensionless, so this builder is deliberately independent of
any configuration set.
- EmailIdentity builder gains a Resolvable .configurationSet() method to
associate an identity with a sibling-built configuration set.
Adds @composurecdk/cloudformation and @composurecdk/cloudwatch peer
dependencies. Deferred to follow-ups: dedicated IP pools, account VDM
attributes, and SES templates.
Refs #303
Contributor
CoverageOverall line coverage: 99.35% across 23 package(s).
|
…isabled
createReputationAlarms short-circuited on `recommendedAlarms: false` and
`{ enabled: false }` before appending custom alarms, so an explicitly
added `.addAlarm()` alarm was silently dropped whenever the recommended
set was turned off.
Suppress only the recommended definitions when disabled and always
append custom alarms, matching the corrected pattern already used by the
split-alarm builders (cloudfront/route53/budgets, ADR-0004). Clarify the
`recommendedAlarms` / `enabled` docs and add regression tests covering
both disable paths.
Refs #303
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Extends
@composurecdk/sesbeyond the receiving path (#279) with the outbound sending surface. Design, research, and the key decisions (each compared to two alternatives) are in #303.A production sender needs a configuration set to track its mail, a least-privilege grant to whatever role sends, event routing so bounces/complaints can drive suppression, and an account-level reputation safety net — all raw
aws-cdk-libuntil now. This adds:createConfigurationSetBuilder()— the unit that tracks a stream of outbound mail. Secure defaults:tlsPolicy: REQUIRE(encrypt in transit) andreputationMetrics: true(per-config-set bounce/complaint metrics), both overridable..addEventDestination(key, { destination, events })routes send events, withsnsDestination/eventBusDestination/cloudWatchDestinationhelpers that acceptResolvables so a destination canref()a sibling topic or bus (mirrors the existing receipt-actions/helpers).identityGrants— consumer-side send grants (ADR-0013).identityGrants.send(ref)delegates to the identity's nativegrantSendEmail(ses:SendEmail+ses:SendRawEmail);identityGrants.sendFrom(ref, addresses)scopes the grant with ases:FromAddresscondition for least privilege.createReputationAlarmBuilder()— the AWS-recommended account-level alarms:Reputation.BounceRate(>= 0.05) andReputation.ComplaintRate(>= 0.001),Average/1 hr,treatMissingData: IGNORE, per the SES reputation-alarm guidance. These metrics are account/Region-scoped and dimensionless, so this builder is deliberately independent of any configuration set (build it once per account/Region) — that's the main design decision called out in feat(ses): sending-side builders — ConfigurationSet + event destinations, send grants, account reputation alarms #303.EmailIdentitybuilder gains aResolvable.configurationSet()method to associate an identity with a sibling-built configuration set.Adds
@composurecdk/cloudformationand@composurecdk/cloudwatchas peer dependencies (fortaggedBuilderand the shared alarm helpers). SES sending is available in all commercial Regions, so no region-gating is needed (unlike receiving).Deferred to follow-ups (noted in #303): dedicated IP pool builder, account-level
VdmAttributes, SES templates (L1-only), and production-access/quota/suppression-list domain actions (SDK-only, ADR-0016). An example stack underpackages/examples/will follow.Refs #303.
Checklist
npm run verifypasses locally (also enforced by the pre-push hook across all 23 projects)sendFrom's hand-rolled action set tograntSendEmail🤖 Generated with Claude Code
Generated by Claude Code