@mavogel/awscdk-rootmail 0.0.318 → 0.0.319
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/.claude/settings.local.json +8 -0
- package/.jsii +2 -2
- package/CLAUDE.md +154 -0
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -4447,6 +4447,6 @@
|
|
|
4447
4447
|
"symbolId": "src/ses-receive:SESReceiveProps"
|
|
4448
4448
|
}
|
|
4449
4449
|
},
|
|
4450
|
-
"version": "0.0.
|
|
4451
|
-
"fingerprint": "
|
|
4450
|
+
"version": "0.0.319",
|
|
4451
|
+
"fingerprint": "WCHXkdxn0fYqqY3ntcl60PfdEcwQ5igpPtoNkxgLUQ4="
|
|
4452
4452
|
}
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Repository Overview
|
|
6
|
+
|
|
7
|
+
This repository contains `@mavogel/awscdk-rootmail`, an AWS CDK construct library that provides an opinionated way to secure root email addresses for AWS accounts. It implements a single email box solution for all root user emails across AWS organizations, based on the superwerker rootmail feature.
|
|
8
|
+
|
|
9
|
+
## Core Architecture
|
|
10
|
+
|
|
11
|
+
### Main Components
|
|
12
|
+
|
|
13
|
+
- **Rootmail Construct** (`src/rootmail.ts`) - Main construct that orchestrates the entire solution
|
|
14
|
+
- **SES Receive** (`src/ses-receive.ts`) - Handles incoming email processing through SES
|
|
15
|
+
- **Hosted Zone DKIM** (`src/hosted-zone-dkim.ts`) - Manages DNS setup and DKIM configuration
|
|
16
|
+
- **DNS Autowiring** (`src/rootmail-autowire-dns.ts`) - Automatically configures DNS records when parent hosted zone is in same account
|
|
17
|
+
|
|
18
|
+
### Architecture Pattern
|
|
19
|
+
|
|
20
|
+
The solution creates a subdomain (e.g., `aws.mycompany.com`) that receives all root emails. Key components:
|
|
21
|
+
|
|
22
|
+
1. **Route53 Hosted Zone** - For the subdomain
|
|
23
|
+
2. **SES Receipt Rules** - To process incoming emails
|
|
24
|
+
3. **S3 Bucket** - To store received emails
|
|
25
|
+
4. **Lambda Functions** - For email processing and DNS propagation
|
|
26
|
+
5. **SSM Parameters** - To store configuration values
|
|
27
|
+
|
|
28
|
+
### Custom Resource Handlers
|
|
29
|
+
|
|
30
|
+
The construct uses several custom resource handlers for orchestration:
|
|
31
|
+
- `hosted-zone-dkim-propagation.*` - Waits for DNS propagation
|
|
32
|
+
- `hosted-zone-dkim-verification-records.*` - Sets up DKIM verification
|
|
33
|
+
- `rootmail-autowire-dns.*` - Auto-configures parent DNS records
|
|
34
|
+
- `ses-receipt-ruleset-activation.*` - Activates SES receipt rules
|
|
35
|
+
|
|
36
|
+
## Development Commands
|
|
37
|
+
|
|
38
|
+
### Build and Test
|
|
39
|
+
```bash
|
|
40
|
+
# Build the project
|
|
41
|
+
yarn build
|
|
42
|
+
# or
|
|
43
|
+
npx projen build
|
|
44
|
+
|
|
45
|
+
# Run tests
|
|
46
|
+
yarn test
|
|
47
|
+
# or
|
|
48
|
+
npx projen test
|
|
49
|
+
|
|
50
|
+
# Watch mode for tests
|
|
51
|
+
yarn test:watch
|
|
52
|
+
|
|
53
|
+
# Type checking and linting
|
|
54
|
+
yarn eslint
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### CDK Operations
|
|
58
|
+
```bash
|
|
59
|
+
# Synthesize CloudFormation templates
|
|
60
|
+
yarn synth
|
|
61
|
+
# or
|
|
62
|
+
npx cdk synth -q
|
|
63
|
+
|
|
64
|
+
# Prepare for integration tests
|
|
65
|
+
yarn prepare-integ-test
|
|
66
|
+
|
|
67
|
+
# Run integration tests
|
|
68
|
+
yarn integ-test
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Development Workflow
|
|
72
|
+
```bash
|
|
73
|
+
# Install dependencies
|
|
74
|
+
yarn install
|
|
75
|
+
|
|
76
|
+
# Compile TypeScript
|
|
77
|
+
yarn compile
|
|
78
|
+
|
|
79
|
+
# Package for distribution
|
|
80
|
+
yarn package
|
|
81
|
+
|
|
82
|
+
# Publish assets (for releases)
|
|
83
|
+
yarn publish-assets
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Testing
|
|
87
|
+
|
|
88
|
+
### Unit Tests
|
|
89
|
+
- Located in `test/` directory
|
|
90
|
+
- Uses Jest with snapshot testing
|
|
91
|
+
- Run with `yarn test`
|
|
92
|
+
- Coverage reports generated in `coverage/` directory
|
|
93
|
+
|
|
94
|
+
### Integration Tests
|
|
95
|
+
- Located in `integ-tests/` directory
|
|
96
|
+
- Uses CDK Integration Testing framework
|
|
97
|
+
- Tests real AWS deployments in regions: `eu-west-1`, `eu-west-2`
|
|
98
|
+
- Run with `yarn integ-test`
|
|
99
|
+
- Includes cleanup scripts for post-test resource removal
|
|
100
|
+
|
|
101
|
+
### Test Requirements
|
|
102
|
+
- AWS credentials configured for integration tests
|
|
103
|
+
- Python environment for cleanup scripts (see `integ-tests/requirements.txt`)
|
|
104
|
+
|
|
105
|
+
## Key Configuration Files
|
|
106
|
+
|
|
107
|
+
### Projen Configuration
|
|
108
|
+
- `.projenrc.ts` - Projen project configuration with custom GitHub workflows
|
|
109
|
+
- Uses `@mavogel/mvc-projen` for standardized project setup
|
|
110
|
+
- Defines complex CI/CD workflows for multi-region releases
|
|
111
|
+
|
|
112
|
+
### CDK Configuration
|
|
113
|
+
- `cdk.json` - CDK app configuration pointing to `src/index-cli-synth.ts`
|
|
114
|
+
- `tsconfig.json` - TypeScript configuration for JSII compilation
|
|
115
|
+
|
|
116
|
+
### Package Configuration
|
|
117
|
+
- Uses Yarn Classic as package manager
|
|
118
|
+
- JSII-compatible TypeScript library for multi-language support
|
|
119
|
+
- Bundles AWS SDK dependencies to avoid version conflicts
|
|
120
|
+
|
|
121
|
+
## Supported AWS Regions
|
|
122
|
+
|
|
123
|
+
SES is not available in all regions. The construct validates deployment regions against:
|
|
124
|
+
- `us-east-1` (N. Virginia)
|
|
125
|
+
- `eu-west-1` (Ireland)
|
|
126
|
+
- `us-west-2` (Oregon)
|
|
127
|
+
- `eu-central-1` (Frankfurt)
|
|
128
|
+
- `us-east-2` (Ohio)
|
|
129
|
+
- `ca-central-1` (Canada Central)
|
|
130
|
+
- `ap-northeast-1` (Tokyo)
|
|
131
|
+
- `ap-southeast-1` (Singapore)
|
|
132
|
+
- `ap-southeast-2` (Sydney)
|
|
133
|
+
|
|
134
|
+
## Release Process
|
|
135
|
+
|
|
136
|
+
The project uses automated releases to S3 buckets across multiple regions:
|
|
137
|
+
- **Dev releases**: On every PR to development S3 bucket
|
|
138
|
+
- **Prod releases**: On version tags to production S3 bucket
|
|
139
|
+
- **CloudFormation templates**: Available in both JSON and YAML formats
|
|
140
|
+
|
|
141
|
+
## Security and Compliance
|
|
142
|
+
|
|
143
|
+
- Uses `cdk-nag` for AWS security best practices validation
|
|
144
|
+
- All resources follow AWS Well-Architected Framework principles
|
|
145
|
+
- S3 buckets have public access blocked and encryption enabled
|
|
146
|
+
- IAM policies follow principle of least privilege
|
|
147
|
+
- CDK Nag suppressions documented with justifications
|
|
148
|
+
|
|
149
|
+
## Important Notes
|
|
150
|
+
|
|
151
|
+
- **Email Size Limit**: AWS accounts can have maximum 64 characters for email addresses
|
|
152
|
+
- **Domain Requirements**: Parent domain must be registered in Route53 in the same AWS account for auto-wiring
|
|
153
|
+
- **SES Region Validation**: Construct will throw error if deployed to unsupported SES regions
|
|
154
|
+
- **Cleanup**: Integration tests include automated cleanup of created resources
|
package/lib/rootmail.js
CHANGED
|
@@ -82,7 +82,7 @@ class Rootmail extends constructs_1.Construct {
|
|
|
82
82
|
}
|
|
83
83
|
exports.Rootmail = Rootmail;
|
|
84
84
|
_a = JSII_RTTI_SYMBOL_1;
|
|
85
|
-
Rootmail[_a] = { fqn: "@mavogel/awscdk-rootmail.Rootmail", version: "0.0.
|
|
85
|
+
Rootmail[_a] = { fqn: "@mavogel/awscdk-rootmail.Rootmail", version: "0.0.319" };
|
|
86
86
|
/**
|
|
87
87
|
* Aspect for setting all removal policies to DESTROY
|
|
88
88
|
*/
|
package/lib/ses-receive.js
CHANGED
|
@@ -130,7 +130,7 @@ class SESReceive extends constructs_1.Construct {
|
|
|
130
130
|
}
|
|
131
131
|
exports.SESReceive = SESReceive;
|
|
132
132
|
_a = JSII_RTTI_SYMBOL_1;
|
|
133
|
-
SESReceive[_a] = { fqn: "@mavogel/awscdk-rootmail.SESReceive", version: "0.0.
|
|
133
|
+
SESReceive[_a] = { fqn: "@mavogel/awscdk-rootmail.SESReceive", version: "0.0.319" };
|
|
134
134
|
/**
|
|
135
135
|
* Aspect for setting all removal policies to DESTROY
|
|
136
136
|
*/
|