Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 69a49fc

Browse files
authored
[DOP-3637]: Create AWS CDK Project (#796)
* [DOP-3637]: Create directory and add nvmrc * [DOP-3637]: Create AWS CDK project * [DOP-3637]: Modify tsconfig to use outdir * [DOP-3637]: Rename stack * [DOP-3637]: created simple dummy test * [DOP-3637]: Update jest config to not call tests on cdk infra from root * [DOP-3637]: Update cdk.json to exclude dist
1 parent 8c53dc6 commit 69a49fc

File tree

13 files changed

+4300
-1
lines changed

13 files changed

+4300
-1
lines changed

cdk-infra/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.js
2+
!jest.config.js
3+
*.d.ts
4+
node_modules
5+
6+
# CDK asset staging directory
7+
.cdk.staging
8+
cdk.out
9+
10+
# Build artifacts
11+
dist

cdk-infra/.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.ts
2+
!*.d.ts
3+
4+
# CDK asset staging directory
5+
.cdk.staging
6+
cdk.out

cdk-infra/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.16.0

cdk-infra/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Welcome to your CDK TypeScript project
2+
3+
This is a blank project for CDK development with TypeScript.
4+
5+
The `cdk.json` file tells the CDK Toolkit how to execute your app.
6+
7+
## Useful commands
8+
9+
- `npm run build` compile typescript to js
10+
- `npm run watch` watch for changes and compile
11+
- `npm run test` perform the jest unit tests
12+
- `cdk deploy` deploy this stack to your default AWS account/region
13+
- `cdk diff` compare deployed stack with current state
14+
- `cdk synth` emits the synthesized CloudFormation template

cdk-infra/bin/cdk-infra.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env node
2+
import 'source-map-support/register';
3+
import * as cdk from 'aws-cdk-lib';
4+
import { AutoBuilderStack } from '../lib/auto-builder-stack';
5+
6+
const app = new cdk.App();
7+
new AutoBuilderStack(app, 'AutoBuilderStack', {
8+
/* If you don't specify 'env', this stack will be environment-agnostic.
9+
* Account/Region-dependent features and context lookups will not work,
10+
* but a single synthesized template can be deployed anywhere. */
11+
/* Uncomment the next line to specialize this stack for the AWS Account
12+
* and Region that are implied by the current CLI configuration. */
13+
// env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },
14+
/* Uncomment the next line if you know exactly what Account and Region you
15+
* want to deploy the stack to. */
16+
// env: { account: '123456789012', region: 'us-east-1' },
17+
/* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */
18+
});

cdk-infra/cdk.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"app": "npx ts-node --prefer-ts-exts bin/cdk-infra.ts",
3+
"watch": {
4+
"include": ["**"],
5+
"exclude": [
6+
"README.md",
7+
"cdk*.json",
8+
"**/*.d.ts",
9+
"**/*.js",
10+
"tsconfig.json",
11+
"package*.json",
12+
"yarn.lock",
13+
"node_modules",
14+
"dist",
15+
"test"
16+
]
17+
},
18+
"context": {
19+
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
20+
"@aws-cdk/core:checkSecretUsage": true,
21+
"@aws-cdk/core:target-partitions": ["aws", "aws-cn"],
22+
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23+
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24+
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25+
"@aws-cdk/aws-iam:minimizePolicies": true,
26+
"@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27+
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28+
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29+
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30+
"@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31+
"@aws-cdk/core:enablePartitionLiterals": true,
32+
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33+
"@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34+
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35+
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36+
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37+
"@aws-cdk/aws-route53-patters:useCertificate": true,
38+
"@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39+
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40+
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41+
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42+
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43+
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44+
"@aws-cdk/aws-redshift:columnId": true,
45+
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true
46+
}
47+
}

cdk-infra/jest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
testEnvironment: 'node',
3+
roots: ['<rootDir>/test'],
4+
testMatch: ['**/*.test.ts'],
5+
transform: {
6+
'^.+\\.tsx?$': 'ts-jest',
7+
},
8+
};

cdk-infra/lib/auto-builder-stack.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as cdk from 'aws-cdk-lib';
2+
import { Construct } from 'constructs';
3+
// import * as sqs from 'aws-cdk-lib/aws-sqs';
4+
5+
export class AutoBuilderStack extends cdk.Stack {
6+
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
7+
super(scope, id, props);
8+
9+
// The code that defines your stack goes here
10+
}
11+
}

0 commit comments

Comments
 (0)