AWS CDK infrastructure for deploying Threat Composer web application.
For deployment guides, configuration options, and CI/CD setup, see docs/WEB-APP.md
This package contains AWS CDK infrastructure code for deploying Threat Composer as a static website with:
- CloudFront distribution
- S3 website bucket
- AWS WAF WebACL
- Optional CI/CD pipeline with CodePipeline
- Node.js 20 or higher
- Yarn package manager
- AWS CLI configured
- AWS CDK CLI (
npm install -g aws-cdk) - CDK bootstrapped in target account
# From repository root
pdk install --frozen-lockfile
# Bootstrap CDK (if not already done)
cdk bootstrap aws://<account-id>/<region>
# Deploy dev stack
./scripts/deployDev.sh
# Or deploy with CI/CD
./scripts/deployAll.shsrc/
├── application-stack.ts # Main application stack
├── application-stage.ts # Application stage
├── pipeline-stack.ts # CI/CD pipeline stack
├── pipeline.ts # Pipeline definition
└── constants.ts # Configuration constants
Configuration is managed in cdk.context.json. Key settings:
accountDev/accountProd- AWS accounts for deploymentscidrRangesDev/cidrRangesProd- IP allowlist for WAFdomainNameDev/domainNameProd- Custom domain namescertificateDev/certificateProd- ACM certificate ARNsuseCodeConnection- Use external git repository via CodeConnectionsrepositoryOwnerAndName- External repository (e.g., "owner/repo")codeConnectionArn- CodeStar Connection ARN
See docs/WEB-APP.md for complete configuration reference.
# Synthesize CloudFormation
cd packages/threat-composer-infra
cdk synth
# Deploy application stack
cdk deploy ThreatComposerApplicationStack
# Deploy pipeline stack
cdk deploy ThreatComposerPipelineStack
# Diff changes
cdk diff
# Destroy stack
cdk destroy ThreatComposerApplicationStackDeploys just the application stack (CloudFront + S3 + WAF):
./scripts/deployDev.shDeploys full CI/CD infrastructure (CodePipeline + Application):
./scripts/deployAll.sh# Run infrastructure tests
cd packages/threat-composer-infra
yarn test
# Run with coverage
yarn test --coverageWhen contributing to this package:
- Follow AWS CDK best practices
- Maintain security configurations (WAF, HTTPS, etc.)
- Update deployment documentation in docs/WEB-APP.md
- Test deployments in isolated accounts
- Document configuration changes
- Deployment Guide: docs/WEB-APP.md
- Main README: README.md
- Development Guide: docs/DEVELOPMENT.md
Licensed under Apache-2.0. See LICENSE for details.