@btc-embedded/cdk-extensions 0.22.9 → 0.22.11
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/.jsii +3 -3
- package/CHANGELOG.md +24 -0
- package/README.md +88 -0
- package/assets/cli/catnip.js +95 -87
- package/lib/constructs/EventPipe.js +1 -1
- package/lib/constructs/ExportedService.js +1 -1
- package/lib/constructs/S3Bucket.js +1 -1
- package/lib/constructs/SecureRestApi.js +1 -1
- package/lib/constructs/SecureRestApiV2.js +1 -1
- package/lib/constructs/api-keys/ApiKeyClientAuthorization.js +1 -1
- package/lib/constructs/api-keys/ApiKeyManagement.js +1 -1
- package/lib/constructs/api-keys/ApiKeyPreTokenHandler.js +1 -1
- package/lib/constructs/api-keys/ApiKeyStore.js +1 -1
- package/lib/extensions/ApiGatewayExtension.js +1 -1
- package/lib/extensions/ApplicationContainer.js +1 -1
- package/lib/extensions/ApplicationLoadBalancerExtension.js +1 -1
- package/lib/extensions/ApplicationLoadBalancerExtensionV2.js +1 -1
- package/lib/extensions/CloudMapExtension.js +1 -1
- package/lib/extensions/DeactivatableServiceExtension.js +1 -1
- package/lib/extensions/DeploymentConfigExtension.js +1 -1
- package/lib/extensions/DocumentDbAccessExtension.js +1 -1
- package/lib/extensions/DomainEventMessagingExtension.js +1 -1
- package/lib/extensions/EfsMountExtension.js +1 -1
- package/lib/extensions/ExtraContainerExtension.js +1 -1
- package/lib/extensions/HTTPApiExtension.js +1 -1
- package/lib/extensions/LogExtension.js +1 -1
- package/lib/extensions/ModifyContainerDefinitionExtension.js +1 -1
- package/lib/extensions/ModifyTaskDefinitionExtension.js +1 -1
- package/lib/extensions/OpenIdExtension.js +1 -1
- package/lib/extensions/OpenTelemetryExtension.js +1 -1
- package/lib/extensions/PostgresDbAccessExtension.js +1 -1
- package/lib/extensions/SharedVolumeExtension.js +1 -1
- package/lib/extensions/TcpKeepAliveExtension.js +1 -1
- package/lib/platform/ApiGateway.js +1 -1
- package/lib/platform/ApiGatewayVpcLink.js +2 -2
- package/lib/platform/ApplicationLoadBalancer.js +1 -1
- package/lib/platform/ApplicationLoadBalancerV2.js +2 -2
- package/lib/platform/BTCLogGroup.js +1 -1
- package/lib/platform/CognitoUserPool.js +2 -2
- package/lib/platform/DefaultUserPoolClients.js +1 -1
- package/lib/platform/DocumentDB.js +2 -2
- package/lib/platform/EcsCluster.js +1 -1
- package/lib/platform/EfsFileSystem.js +1 -1
- package/lib/platform/HostedZone.js +1 -1
- package/lib/platform/PrivateDnsNamespace.js +1 -1
- package/lib/platform/ResourceServer.js +1 -1
- package/lib/platform/Vpc.js +1 -1
- package/lib/platform/VpcV2.js +1 -1
- package/lib/stacks/ApplicationStack.js +1 -1
- package/lib/utils/BasePlatformStackResolver.js +1 -1
- package/lib/utils/StackParameter.js +1 -1
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -8497,7 +8497,7 @@
|
|
|
8497
8497
|
},
|
|
8498
8498
|
"name": "@btc-embedded/cdk-extensions",
|
|
8499
8499
|
"readme": {
|
|
8500
|
-
"markdown": "# BTC Embedded CDK Extensions\n\n# @btc-embedded/cdk-extensions\n\nA collection of reusable AWS CDK (Cloud Development Kit) extensions and constructs for building cloud infrastructure with TypeScript.\n\n## Features\n\n- **CDK Constructs**: Includes ready-to-use constructs for API Gateway, Application Load Balancer, Cognito, VPC, DocumentDB, and more.\n- **ECS Service Extensions**: Provides ECS service extensions for advanced container orchestration.\n- **Utilities**: Common utilities and helpers for stack parameters, value imports, and configuration parsing.\n- **Modular Extensions**: Easily extend AWS resources with features like logging, OpenTelemetry, EFS, Cloud Map, and custom containers.\n\n## Installation\n\n```sh\nyarn install @btc-embedded/cdk-extensions\n```\n\n## Usage Example\n\n### Basic Usage\n\n```typescript\nimport { ApiGateway } from \"@btc-embedded/cdk-extensions\";\n\n// Use constructs and extensions in your CDK app\n```\n\n### Using ApplicationStack for Simplified Configuration\n\nFor application-level stacks that reference a base platform stack, use `ApplicationStack` to ensure consistent use of the base platform stack name:\n\n```typescript\nimport { ApplicationStack } from \"@btc-embedded/cdk-extensions\";\n\nexport class MyAppStack extends ApplicationStack {\n constructor(scope: Construct, id: string) {\n super(scope, id, {\n basePlatformStackName: \"my-platform-stack\",\n env: {\n account: \"123456789012\",\n region: \"eu-central-1\",\n },\n });\n\n // Constructs and extensions automatically resolve the platform stack name\n // No need to pass basePlatformStackName repeatedly\n }\n}\n```\n\n### Config-Driven Deployments\n\nUse `createApplicationApp` for configuration-driven deployments:\n\n```typescript\nimport {\n createApplicationApp,\n ApplicationStack,\n} from \"@btc-embedded/cdk-extensions\";\nimport { z } from \"zod\";\n\nconst configSchema = z.object({\n env: z.object({ account: z.string(), region: z.string() }),\n basePlatformStackName: z.string(),\n});\n\ncreateApplicationApp({\n directory: \"./config\",\n schema: configSchema,\n createStack: (scope, config) => new MyAppStack(scope, \"MyApp\", config),\n});\n```\n\n## Documentation\n\n- [API Reference](./API.md)\n\n## License\n\nApache-2.0 © BTC Embedded Systems AG\n"
|
|
8500
|
+
"markdown": "# BTC Embedded CDK Extensions\n\n# @btc-embedded/cdk-extensions\n\nA collection of reusable AWS CDK (Cloud Development Kit) extensions and constructs for building cloud infrastructure with TypeScript.\n\n## Features\n\n- **CDK Constructs**: Includes ready-to-use constructs for API Gateway, Application Load Balancer, Cognito, VPC, DocumentDB, and more.\n- **ECS Service Extensions**: Provides ECS service extensions for advanced container orchestration.\n- **Utilities**: Common utilities and helpers for stack parameters, value imports, and configuration parsing.\n- **Modular Extensions**: Easily extend AWS resources with features like logging, OpenTelemetry, EFS, Cloud Map, and custom containers.\n\n## Installation\n\n```sh\nyarn install @btc-embedded/cdk-extensions\n```\n\n## Usage Example\n\n### Basic Usage\n\n```typescript\nimport { ApiGateway } from \"@btc-embedded/cdk-extensions\";\n\n// Use constructs and extensions in your CDK app\n```\n\n### Using ApplicationStack for Simplified Configuration\n\nFor application-level stacks that reference a base platform stack, use `ApplicationStack` to ensure consistent use of the base platform stack name:\n\n```typescript\nimport { ApplicationStack } from \"@btc-embedded/cdk-extensions\";\n\nexport class MyAppStack extends ApplicationStack {\n constructor(scope: Construct, id: string) {\n super(scope, id, {\n basePlatformStackName: \"my-platform-stack\",\n env: {\n account: \"123456789012\",\n region: \"eu-central-1\",\n },\n });\n\n // Constructs and extensions automatically resolve the platform stack name\n // No need to pass basePlatformStackName repeatedly\n }\n}\n```\n\n### Config-Driven Deployments\n\nUse `createApplicationApp` for configuration-driven deployments:\n\n```typescript\nimport {\n createApplicationApp,\n ApplicationStack,\n} from \"@btc-embedded/cdk-extensions\";\nimport { z } from \"zod\";\n\nconst configSchema = z.object({\n env: z.object({ account: z.string(), region: z.string() }),\n basePlatformStackName: z.string(),\n});\n\ncreateApplicationApp({\n directory: \"./config\",\n schema: configSchema,\n createStack: (scope, config) => new MyAppStack(scope, \"MyApp\", config),\n});\n```\n\n## CLI Commands\n\n### catnip — Cloud Toolkit by the CAT Department\n\nThe `catnip` CLI tool provides commands for cloud infrastructure diagnostics and management.\n\n#### stack-diagnose\n\nDiagnose CloudFormation stack deployment failures.\n\n**Usage:**\n\n```bash\n# Auto-detect and diagnose the last failed stack\ncatnip stack-diagnose\n\n# Diagnose a specific stack\ncatnip stack-diagnose --stack-name my-stack\n\n# Customize log output and task inspection\ncatnip stack-diagnose --stack-name my-stack --tail 200 --tasks 10\n```\n\n**Description:**\n\nThe `stack-diagnose` command provides comprehensive diagnostics for failed CloudFormation stacks. If no stack name is provided, it automatically detects and diagnoses the last failed stack in your AWS account. The command displays:\n\n- **Stack Status**: Current CloudFormation stack status and reason for failure\n- **CloudFormation Events**: Recent stack events showing what failed during deployment\n- **ECS Diagnostics** (if applicable): If the stack contains ECS services, additional diagnostics are performed including:\n - Service event history\n - Recent stopped task logs\n - Container output for troubleshooting\n\n**Options:**\n\n- `--stack-name <name>` — CloudFormation stack name (optional; auto-detects last failed stack if omitted)\n- `--tail <n>` — Number of log lines to show per container (default: 100)\n- `--tasks <n>` — Number of recent stopped tasks to inspect (default: 5)\n- `--region <region>` — AWS region (uses AWS_DEFAULT_REGION / AWS_REGION environment variable if not specified)\n- `--profile <profile>` — AWS named profile for local development\n\n**Examples:**\n\n```bash\n# Quick diagnosis of last failed stack\ncatnip stack-diagnose\n\n# Diagnose specific stack with extended logging\ncatnip stack-diagnose --stack-name prod-api-stack --tail 500 --tasks 10\n\n# Use specific AWS profile and region\ncatnip stack-diagnose --profile my-profile --region eu-central-1\n```\n\n#### ecs-logs\n\nStream live logs from running ECS services in a CloudFormation stack.\n\n**Usage:**\n\n```bash\n# Stream logs from all ECS services in a stack\nnpx catnip ecs-logs --stack-name my-stack\n\n# Follow logs in real-time\nnpx catnip ecs-logs --stack-name my-stack --follow\n\n# Filter by service name and show last 50 lines\nnpx catnip ecs-logs --stack-name my-stack --tail 50 --service api\n\n# Raw JSON output (for piping to jq or pino-pretty)\nnpx catnip ecs-logs --stack-name my-stack --output raw\n\n# Pretty-printed JSON with colors\nnpx catnip ecs-logs --stack-name my-stack --output pretty\n```\n\n**Options:**\n\n- `--stack-name <name>` — CloudFormation stack name (required)\n- `--tail <n>` — Lines of history to show per container (default: 100)\n- `-f, --follow` — Keep polling for new log events\n- `--service <name>` — Filter services by name\n- `-o, --output <mode>` — Output mode: `text`, `raw`, or `pretty` (default: text)\n- `--region <region>` — AWS region\n- `--profile <profile>` — AWS profile\n\n## Documentation\n\n- [API Reference](./API.md)\n\n## License\n\nApache-2.0 © BTC Embedded Systems AG\n"
|
|
8501
8501
|
},
|
|
8502
8502
|
"repository": {
|
|
8503
8503
|
"type": "git",
|
|
@@ -19883,6 +19883,6 @@
|
|
|
19883
19883
|
"symbolId": "src/platform/VpcV2:VpcV2Props"
|
|
19884
19884
|
}
|
|
19885
19885
|
},
|
|
19886
|
-
"version": "0.22.
|
|
19887
|
-
"fingerprint": "
|
|
19886
|
+
"version": "0.22.11",
|
|
19887
|
+
"fingerprint": "tFOP05AizrkdYOh25E8nhxF4BCsuHDrs+B731DuvmNQ="
|
|
19888
19888
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.22.10](https://github.com/btc-embedded/cdk-extensions/compare/v0.22.9...v0.22.10) (2026-02-25)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **cli:** add CloudFormation stack status utilities ([dfff3ed](https://github.com/btc-embedded/cdk-extensions/commit/dfff3edfa6cbf0f15a531e320ab8a43f80dcd4e3))
|
|
8
|
+
* **cli:** add stack-diagnose command ([7d60af8](https://github.com/btc-embedded/cdk-extensions/commit/7d60af8979affeeb8ba6e087860228a640c08de1))
|
|
9
|
+
* **cli:** register stack-diagnose command ([a82d60a](https://github.com/btc-embedded/cdk-extensions/commit/a82d60a78a6ae5737a6bd149d9306ce0ac13cc88))
|
|
10
|
+
|
|
11
|
+
## [0.22.9](https://github.com/btc-embedded/cdk-extensions/compare/v0.22.8...v0.22.9) (2026-02-20)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add catnip CLI tool with ecs-diagnose and oidc-token commands ([242e3e3](https://github.com/btc-embedded/cdk-extensions/commit/242e3e3bc70fef200aafa81f0e43a41a30c65ee0))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* enforce no-any and no-type-assertion ESLint rules ([dc60f7d](https://github.com/btc-embedded/cdk-extensions/commit/dc60f7d9fc92c8bd56d4a597442fdae02a7bcd6e))
|
|
22
|
+
* handle old ECS ARN format and validate parseInt inputs ([fd4adce](https://github.com/btc-embedded/cdk-extensions/commit/fd4adce2a6297291388ddd8b52a7873da120acef))
|
|
23
|
+
* resolve @smithy/types version conflict in DynamoDB mock tests ([5cc979d](https://github.com/btc-embedded/cdk-extensions/commit/5cc979d62db4e270e0199abe8a57efeaa43ade21))
|
|
24
|
+
* resolve Cognito token endpoint from full FQDN or domain prefix ([4b9e04e](https://github.com/btc-embedded/cdk-extensions/commit/4b9e04e14f82af902512d61ca486978e2e4f690f))
|
|
25
|
+
|
|
2
26
|
## [0.22.8](https://github.com/btc-embedded/cdk-extensions/compare/v0.22.7...v0.22.8) (2026-02-12)
|
|
3
27
|
|
|
4
28
|
|
package/README.md
CHANGED
|
@@ -73,6 +73,94 @@ createApplicationApp({
|
|
|
73
73
|
});
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
## CLI Commands
|
|
77
|
+
|
|
78
|
+
### catnip — Cloud Toolkit by the CAT Department
|
|
79
|
+
|
|
80
|
+
The `catnip` CLI tool provides commands for cloud infrastructure diagnostics and management.
|
|
81
|
+
|
|
82
|
+
#### stack-diagnose
|
|
83
|
+
|
|
84
|
+
Diagnose CloudFormation stack deployment failures.
|
|
85
|
+
|
|
86
|
+
**Usage:**
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Auto-detect and diagnose the last failed stack
|
|
90
|
+
catnip stack-diagnose
|
|
91
|
+
|
|
92
|
+
# Diagnose a specific stack
|
|
93
|
+
catnip stack-diagnose --stack-name my-stack
|
|
94
|
+
|
|
95
|
+
# Customize log output and task inspection
|
|
96
|
+
catnip stack-diagnose --stack-name my-stack --tail 200 --tasks 10
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Description:**
|
|
100
|
+
|
|
101
|
+
The `stack-diagnose` command provides comprehensive diagnostics for failed CloudFormation stacks. If no stack name is provided, it automatically detects and diagnoses the last failed stack in your AWS account. The command displays:
|
|
102
|
+
|
|
103
|
+
- **Stack Status**: Current CloudFormation stack status and reason for failure
|
|
104
|
+
- **CloudFormation Events**: Recent stack events showing what failed during deployment
|
|
105
|
+
- **ECS Diagnostics** (if applicable): If the stack contains ECS services, additional diagnostics are performed including:
|
|
106
|
+
- Service event history
|
|
107
|
+
- Recent stopped task logs
|
|
108
|
+
- Container output for troubleshooting
|
|
109
|
+
|
|
110
|
+
**Options:**
|
|
111
|
+
|
|
112
|
+
- `--stack-name <name>` — CloudFormation stack name (optional; auto-detects last failed stack if omitted)
|
|
113
|
+
- `--tail <n>` — Number of log lines to show per container (default: 100)
|
|
114
|
+
- `--tasks <n>` — Number of recent stopped tasks to inspect (default: 5)
|
|
115
|
+
- `--region <region>` — AWS region (uses AWS_DEFAULT_REGION / AWS_REGION environment variable if not specified)
|
|
116
|
+
- `--profile <profile>` — AWS named profile for local development
|
|
117
|
+
|
|
118
|
+
**Examples:**
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Quick diagnosis of last failed stack
|
|
122
|
+
catnip stack-diagnose
|
|
123
|
+
|
|
124
|
+
# Diagnose specific stack with extended logging
|
|
125
|
+
catnip stack-diagnose --stack-name prod-api-stack --tail 500 --tasks 10
|
|
126
|
+
|
|
127
|
+
# Use specific AWS profile and region
|
|
128
|
+
catnip stack-diagnose --profile my-profile --region eu-central-1
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### ecs-logs
|
|
132
|
+
|
|
133
|
+
Stream live logs from running ECS services in a CloudFormation stack.
|
|
134
|
+
|
|
135
|
+
**Usage:**
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Stream logs from all ECS services in a stack
|
|
139
|
+
npx catnip ecs-logs --stack-name my-stack
|
|
140
|
+
|
|
141
|
+
# Follow logs in real-time
|
|
142
|
+
npx catnip ecs-logs --stack-name my-stack --follow
|
|
143
|
+
|
|
144
|
+
# Filter by service name and show last 50 lines
|
|
145
|
+
npx catnip ecs-logs --stack-name my-stack --tail 50 --service api
|
|
146
|
+
|
|
147
|
+
# Raw JSON output (for piping to jq or pino-pretty)
|
|
148
|
+
npx catnip ecs-logs --stack-name my-stack --output raw
|
|
149
|
+
|
|
150
|
+
# Pretty-printed JSON with colors
|
|
151
|
+
npx catnip ecs-logs --stack-name my-stack --output pretty
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Options:**
|
|
155
|
+
|
|
156
|
+
- `--stack-name <name>` — CloudFormation stack name (required)
|
|
157
|
+
- `--tail <n>` — Lines of history to show per container (default: 100)
|
|
158
|
+
- `-f, --follow` — Keep polling for new log events
|
|
159
|
+
- `--service <name>` — Filter services by name
|
|
160
|
+
- `-o, --output <mode>` — Output mode: `text`, `raw`, or `pretty` (default: text)
|
|
161
|
+
- `--region <region>` — AWS region
|
|
162
|
+
- `--profile <profile>` — AWS profile
|
|
163
|
+
|
|
76
164
|
## Documentation
|
|
77
165
|
|
|
78
166
|
- [API Reference](./API.md)
|