The CDK application ships with default values pointing to a specific AWS account, region, and GitHub repository. Before you deploy, you need to update these values to match your own environment. All configuration lives in two files:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/okruti-raghuraj/aws-1/llms.txt
Use this file to discover all available pages before exploring further.
bin/aws-cdk-pipeline.ts (environment targeting) and lib/aws-cdk-pipeline-stack.ts (pipeline definition).
Environment Configuration
The entry point filebin/aws-cdk-pipeline.ts instantiates the CDK app and passes environment details to the stack. Here is the full source as it exists in the project:
env block pins the stack to a specific AWS account and region:
account— the 12-digit AWS account ID where the pipeline and all its resources will be created. Replace'602143770054'with your own account ID.region— the AWS region code (e.g.'ap-south-1'for Mumbai). Replace this with your preferred region such as'us-east-1'or'eu-west-1'.
env property entirely, the stack becomes environment-agnostic — it can be synthesized and deployed anywhere, but features that require a known account or region (such as certain context lookups and cross-region references) will not work.
GitHub Source Configuration
The pipeline stack (lib/aws-cdk-pipeline-stack.ts) defines the pipeline and its source:
CodePipelineSource.gitHub('RaghurajSingh/SMS', 'aws-pipeline'):
- The first argument (
'RaghurajSingh/SMS') is the GitHub repository inowner/repoformat. Replace this with your own GitHub repository, e.g.'myorg/my-cdk-app'. - The second argument (
'aws-pipeline') is the branch name the pipeline watches for commits. Change this to whatever branch you want to trigger pipeline runs, e.g.'main'or'production'.
Pipeline Name
The pipeline is named'TestPipeline' via the pipelineName property. This is the name that appears in the AWS CodePipeline console. Update it to something meaningful for your project:
Cross-Account Keys Setting
ThecrossAccountKeys: false option controls artifact encryption:
false(default here) — pipeline artifacts stored in S3 are encrypted with SSE-S3 (Amazon-managed keys). This is simpler and incurs no extra cost. Use this when all pipeline stages deploy to the same AWS account.true— artifacts are encrypted with AWS KMS customer-managed keys (CMK). This is required when the pipeline deploys to a different AWS account (cross-account deployments), because S3-managed keys cannot be shared across account boundaries.
crossAccountKeys: false is the correct choice.
Synth Commands
TheShellStep runs three commands inside the CodeBuild project to produce the CDK cloud assembly:
| Command | Purpose |
|---|---|
npm ci | Clean install of all dependencies from the lock file — reproducible and faster than npm install |
npm run build | Compiles TypeScript source to JavaScript via tsc — required because CDK reads .js files at runtime |
npx cdk synth | Synthesizes all stacks into CloudFormation templates inside cdk.out/ — the pipeline reads these templates to determine what to deploy |
npx cdk synth.
CDK Context
Thecdk.json file at the project root holds feature flags under the context key. These flags opt in to specific CDK behaviours such as lowercase RDS identifiers, minimized IAM policies, and TLS 1.2 enforcement for CloudFront. They are already set to the recommended values for CDK v2.20.0. See CDK Overview for a detailed explanation of each flag.