@btc-embedded/cdk-extensions 0.22.14 → 0.22.15
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 +7 -0
- package/README.md +34 -60
- package/assets/cli/catnip.js +114 -154
- 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## CLI Commands\n\n### catnip — Cloud Toolkit by the CAT Department\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\n`catnip` provides operational helpers for CloudFormation, ECS, and Cognito.\n\nGlobal options (apply to all commands):\n- `--region <region>` — AWS region (defaults to `AWS_DEFAULT_REGION` / `AWS_REGION`)\n- `--profile <profile>` — AWS named profile\n\n#### stack-diagnose\n\nDiagnose failed CloudFormation deployments and show ECS failure context.\n\nUsage:\n\n```bash\ncatnip stack-diagnose\ncatnip stack-diagnose --stack-name my-stack\ncatnip stack-diagnose --stage prod\ncatnip stack-diagnose --stack-name my-stack --tail 200 --tasks 10\n```\n\nOptions:\n- `--stack-name <name>` — stack to diagnose (optional; auto-detects last failed stack if omitted)\n- `--stage <name>` — stage filter for auto-detection (ignored if `--stack-name` is provided)\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\n#### ecs-logs\n\nStream live logs from running ECS services in a CloudFormation stack.\n\nUsage:\n\n```bash\ncatnip ecs-logs --stack-name my-stack\ncatnip ecs-logs --stack-name my-stack --follow\ncatnip ecs-logs --stack-name my-stack --service api --tail 50\ncatnip ecs-logs --stack-name my-stack --output raw\ncatnip ecs-logs --stack-name my-stack --output pretty\n```\n\nOptions:\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\n#### oidc-token\n\nFetch a Cognito token using CloudFormation exports from a stack.\n\nUsage:\n\n```bash\ncatnip oidc-token --stack-name my-stack\ncatnip oidc-token --stack-name my-stack --output json\n```\n\nOptions:\n- `--stack-name <name>` — stack that exported Cognito resources (required)\n- `--output <token|json>` — print token only, or full response JSON (default: `token`)\n - `token` output is the `access_token`\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.15",
|
|
19887
|
+
"fingerprint": "axwLf8KDZSEYVbCwcQlEDJQHzf288NA3QXr3+g15BM8="
|
|
19888
19888
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.22.14](https://github.com/btc-embedded/cdk-extensions/compare/v0.22.13...v0.22.14) (2026-02-26)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **cli:** improve stack-diagnose fallback log retrieval ([73616eb](https://github.com/btc-embedded/cdk-extensions/commit/73616eb32e84586ed916f0d5075f785292befe59))
|
|
8
|
+
|
|
2
9
|
## [0.22.13](https://github.com/btc-embedded/cdk-extensions/compare/v0.22.12...v0.22.13) (2026-02-26)
|
|
3
10
|
|
|
4
11
|
|
package/README.md
CHANGED
|
@@ -77,93 +77,67 @@ createApplicationApp({
|
|
|
77
77
|
|
|
78
78
|
### catnip — Cloud Toolkit by the CAT Department
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
`catnip` provides operational helpers for CloudFormation, ECS, and Cognito.
|
|
81
|
+
|
|
82
|
+
Global options (apply to all commands):
|
|
83
|
+
- `--region <region>` — AWS region (defaults to `AWS_DEFAULT_REGION` / `AWS_REGION`)
|
|
84
|
+
- `--profile <profile>` — AWS named profile
|
|
81
85
|
|
|
82
86
|
#### stack-diagnose
|
|
83
87
|
|
|
84
|
-
Diagnose CloudFormation
|
|
88
|
+
Diagnose failed CloudFormation deployments and show ECS failure context.
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
Usage:
|
|
87
91
|
|
|
88
92
|
```bash
|
|
89
|
-
# Auto-detect and diagnose the last failed stack
|
|
90
93
|
catnip stack-diagnose
|
|
91
|
-
|
|
92
|
-
# Diagnose a specific stack
|
|
93
94
|
catnip stack-diagnose --stack-name my-stack
|
|
94
|
-
|
|
95
|
-
# Customize log output and task inspection
|
|
95
|
+
catnip stack-diagnose --stage prod
|
|
96
96
|
catnip stack-diagnose --stack-name my-stack --tail 200 --tasks 10
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
- `--stage <name>` — Filter stacks by stage name (e.g., 'prod', 'dev') when auto-detecting; only used if --stack-name is not provided
|
|
99
|
+
Options:
|
|
100
|
+
- `--stack-name <name>` — stack to diagnose (optional; auto-detects last failed stack if omitted)
|
|
101
|
+
- `--stage <name>` — stage filter for auto-detection (ignored if `--stack-name` is provided)
|
|
114
102
|
- `--tail <n>` — Number of log lines to show per container (default: 100)
|
|
115
103
|
- `--tasks <n>` — Number of recent stopped tasks to inspect (default: 5)
|
|
116
|
-
- `--region <region>` — AWS region (uses AWS_DEFAULT_REGION / AWS_REGION environment variable if not specified)
|
|
117
|
-
- `--profile <profile>` — AWS named profile for local development
|
|
118
|
-
|
|
119
|
-
**Examples:**
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# Quick diagnosis of last failed stack
|
|
123
|
-
catnip stack-diagnose
|
|
124
|
-
|
|
125
|
-
# Auto-detect failed stack for a specific stage (useful when multiple stages in same account)
|
|
126
|
-
catnip stack-diagnose --stage prod
|
|
127
|
-
|
|
128
|
-
# Diagnose specific stack with extended logging
|
|
129
|
-
catnip stack-diagnose --stack-name prod-api-stack --tail 500 --tasks 10
|
|
130
|
-
|
|
131
|
-
# Use specific AWS profile and region
|
|
132
|
-
catnip stack-diagnose --profile my-profile --region eu-central-1
|
|
133
|
-
```
|
|
134
104
|
|
|
135
105
|
#### ecs-logs
|
|
136
106
|
|
|
137
107
|
Stream live logs from running ECS services in a CloudFormation stack.
|
|
138
108
|
|
|
139
|
-
|
|
109
|
+
Usage:
|
|
140
110
|
|
|
141
111
|
```bash
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
# Filter by service name and show last 50 lines
|
|
149
|
-
npx catnip ecs-logs --stack-name my-stack --tail 50 --service api
|
|
150
|
-
|
|
151
|
-
# Raw JSON output (for piping to jq or pino-pretty)
|
|
152
|
-
npx catnip ecs-logs --stack-name my-stack --output raw
|
|
153
|
-
|
|
154
|
-
# Pretty-printed JSON with colors
|
|
155
|
-
npx catnip ecs-logs --stack-name my-stack --output pretty
|
|
112
|
+
catnip ecs-logs --stack-name my-stack
|
|
113
|
+
catnip ecs-logs --stack-name my-stack --follow
|
|
114
|
+
catnip ecs-logs --stack-name my-stack --service api --tail 50
|
|
115
|
+
catnip ecs-logs --stack-name my-stack --output raw
|
|
116
|
+
catnip ecs-logs --stack-name my-stack --output pretty
|
|
156
117
|
```
|
|
157
118
|
|
|
158
|
-
|
|
159
|
-
|
|
119
|
+
Options:
|
|
160
120
|
- `--stack-name <name>` — CloudFormation stack name (required)
|
|
161
121
|
- `--tail <n>` — Lines of history to show per container (default: 100)
|
|
162
122
|
- `-f, --follow` — Keep polling for new log events
|
|
163
123
|
- `--service <name>` — Filter services by name
|
|
164
124
|
- `-o, --output <mode>` — Output mode: `text`, `raw`, or `pretty` (default: text)
|
|
165
|
-
|
|
166
|
-
-
|
|
125
|
+
|
|
126
|
+
#### oidc-token
|
|
127
|
+
|
|
128
|
+
Fetch a Cognito token using CloudFormation exports from a stack.
|
|
129
|
+
|
|
130
|
+
Usage:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
catnip oidc-token --stack-name my-stack
|
|
134
|
+
catnip oidc-token --stack-name my-stack --output json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Options:
|
|
138
|
+
- `--stack-name <name>` — stack that exported Cognito resources (required)
|
|
139
|
+
- `--output <token|json>` — print token only, or full response JSON (default: `token`)
|
|
140
|
+
- `token` output is the `access_token`
|
|
167
141
|
|
|
168
142
|
## Documentation
|
|
169
143
|
|