konokenj.cdk-api-mcp-server 0.42.0__py3-none-any.whl → 0.44.0__py3-none-any.whl
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.
Potentially problematic release.
This version of konokenj.cdk-api-mcp-server might be problematic. Click here for more details.
- cdk_api_mcp_server/__about__.py +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-glue-alpha/README.md +9 -9
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-iot-alpha/README.md +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/README.md +8 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api.ts +4 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/README.md +34 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/integ.ecs-exec-batch-job.ts +148 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-certificatemanager/README.md +11 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/README.md +13 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.dashboard-with-graphwidget-with-labels-visible.ts +92 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codebuild/README.md +1 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codebuild/integ.project-docker-server.ts +44 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-elastic-beanstalk-deploy.ts +22 -16
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr-assets/README.md +4 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/README.md +64 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/README.md +3 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.dependencies-bun-lock.ts +50 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/README.md +38 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.proxy-endpoint.ts +36 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3/integ.bucket.notifications-scoped-permissions.ts +71 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-assets/integ.assets.bundling.docker-opts.ts +4 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.distributed-map-parallel.ts +82 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.distributed-map-redrive.ts +130 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.map-with-catch.ts +1 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-nodejs22.ts +27 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/README.md +27 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary-browser-type.ts +35 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +2 -2
- {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/METADATA +2 -2
- {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/RECORD +35 -25
- {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/WHEEL +0 -0
- {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/entry_points.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -108,8 +108,8 @@ With the `@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion` disabled, the runt
|
|
|
108
108
|
|
|
109
109
|
## Lock file
|
|
110
110
|
|
|
111
|
-
The `NodejsFunction` requires a dependencies lock file (`yarn.lock`, `pnpm-lock.yaml`, `bun.lockb
|
|
112
|
-
`package-lock.json`). When bundling in a Docker container, the path containing this lock file is
|
|
111
|
+
The `NodejsFunction` requires a dependencies lock file (`yarn.lock`, `pnpm-lock.yaml`, `bun.lockb`,
|
|
112
|
+
`bun.lock` or `package-lock.json`). When bundling in a Docker container, the path containing this lock file is
|
|
113
113
|
used as the source (`/asset-input`) for the volume mounted in the container.
|
|
114
114
|
|
|
115
115
|
By default, the construct will try to automatically determine your project lock file.
|
|
@@ -201,7 +201,7 @@ new nodejs.NodejsFunction(this, 'my-handler', {
|
|
|
201
201
|
|
|
202
202
|
The modules listed in `nodeModules` must be present in the `package.json`'s dependencies or
|
|
203
203
|
installed. The same version will be used for installation. The lock file (`yarn.lock`,
|
|
204
|
-
`pnpm-lock.yaml`, `bun.lockb` or `package-lock.json`) will be used along with the right installer (`yarn`,
|
|
204
|
+
`pnpm-lock.yaml`, `bun.lockb`, `bun.lock` or `package-lock.json`) will be used along with the right installer (`yarn`,
|
|
205
205
|
`pnpm`, `bun` or `npm`).
|
|
206
206
|
|
|
207
207
|
When working with `nodeModules` using native dependencies, you might want to force bundling in a
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import { Runtime } from 'aws-cdk-lib/aws-lambda';
|
|
3
|
+
import * as cdk from 'aws-cdk-lib';
|
|
4
|
+
import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';
|
|
5
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda-nodejs';
|
|
6
|
+
|
|
7
|
+
const app = new cdk.App({
|
|
8
|
+
postCliContext: {
|
|
9
|
+
'@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const stack = new cdk.Stack(app, 'TestStack');
|
|
14
|
+
|
|
15
|
+
const handler = new lambda.NodejsFunction(stack, 'Function', {
|
|
16
|
+
entry: path.join(__dirname, 'integ-handlers/bun_lock/dependencies-bun.ts'),
|
|
17
|
+
runtime: Runtime.NODEJS_22_X,
|
|
18
|
+
bundling: {
|
|
19
|
+
minify: true,
|
|
20
|
+
// Will be installed, not bundled
|
|
21
|
+
// (axios is a package with sub-dependencies,
|
|
22
|
+
// will be used to ensure bun bundling works as expected)
|
|
23
|
+
nodeModules: ['axios'],
|
|
24
|
+
forceDockerBundling: true,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
// To (re-)generate this lockfile:
|
|
28
|
+
// 1. Ensure your local version of bun matches the version in packages/aws-cdk-lib/aws-lambda-nodejs/lib/Dockerfile
|
|
29
|
+
// 2. `cd` to `packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ-handlers/bun`
|
|
30
|
+
// 3. Rename the `_package.json` file to `package.json`
|
|
31
|
+
// 4. Run `bun install`
|
|
32
|
+
depsLockFilePath: path.join(__dirname, 'integ-handlers/bun_lock/bun.lock'),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const integ = new IntegTest(app, 'BunTest', {
|
|
36
|
+
testCases: [stack],
|
|
37
|
+
stackUpdateWorkflow: false, // this will tell the runner to not check in assets.
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const response = integ.assertions.invokeFunction({
|
|
41
|
+
functionName: handler.functionName,
|
|
42
|
+
});
|
|
43
|
+
response.expect(
|
|
44
|
+
ExpectedResult.objectLike({
|
|
45
|
+
// expect invoking without error
|
|
46
|
+
StatusCode: 200,
|
|
47
|
+
ExecutedVersion: '$LATEST',
|
|
48
|
+
Payload: 'null',
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
@@ -418,6 +418,24 @@ To apply changes of the cluster, such as engine version, in the next scheduled m
|
|
|
418
418
|
|
|
419
419
|
For details, see [Modifying an Amazon Aurora DB cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Modifying.html).
|
|
420
420
|
|
|
421
|
+
### Retaining Automated Backups
|
|
422
|
+
|
|
423
|
+
By default, when a database cluster is deleted, automated backups are removed immediately unless an AWS Backup policy specifies a point-in-time restore rule. You can control this behavior using the `deleteAutomatedBackups` property:
|
|
424
|
+
|
|
425
|
+
```ts
|
|
426
|
+
declare const vpc: ec2.IVpc;
|
|
427
|
+
// Retain automated backups after cluster deletion
|
|
428
|
+
new rds.DatabaseCluster(this, 'Database', {
|
|
429
|
+
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_01_0 }),
|
|
430
|
+
writer: rds.ClusterInstance.provisioned('writer'),
|
|
431
|
+
vpc,
|
|
432
|
+
deleteAutomatedBackups: false,
|
|
433
|
+
});
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
When set to `false`, automated backups are retained according to the configured retention period after the cluster is deleted. When set to `true` or not specified (default), automated backups are deleted immediately when the cluster is deleted.
|
|
437
|
+
Detail about this feature can be found in the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.Retaining.html).
|
|
438
|
+
|
|
421
439
|
### Migrating from instanceProps
|
|
422
440
|
|
|
423
441
|
Creating instances in a `DatabaseCluster` using `instanceProps` & `instances` is
|
|
@@ -1148,6 +1166,26 @@ const proxy = dbInstance.addProxy('proxy', {
|
|
|
1148
1166
|
});
|
|
1149
1167
|
```
|
|
1150
1168
|
|
|
1169
|
+
### Proxy Endpoint
|
|
1170
|
+
The following example add additional endpoint to RDS Proxy.
|
|
1171
|
+
|
|
1172
|
+
```ts
|
|
1173
|
+
declare const vpc: ec2.Vpc;
|
|
1174
|
+
declare const secrets: secretsmanager.Secret[];
|
|
1175
|
+
declare const dbInstance: rds.DatabaseInstance;
|
|
1176
|
+
|
|
1177
|
+
const proxy = dbInstance.addProxy('Proxy', {
|
|
1178
|
+
secrets,
|
|
1179
|
+
vpc,
|
|
1180
|
+
});
|
|
1181
|
+
|
|
1182
|
+
// Add a reader endpoint
|
|
1183
|
+
proxy.addEndpoint('ProxyEndpoint', {
|
|
1184
|
+
vpc,
|
|
1185
|
+
targetRole: rds.ProxyEndpointTargetRole.READ_ONLY,
|
|
1186
|
+
});
|
|
1187
|
+
```
|
|
1188
|
+
|
|
1151
1189
|
## Exporting Logs
|
|
1152
1190
|
|
|
1153
1191
|
You can publish database logs to Amazon CloudWatch Logs. With CloudWatch Logs, you can perform real-time analysis of the log data,
|
|
@@ -63,6 +63,7 @@ class TestStack extends cdk.Stack {
|
|
|
63
63
|
parameterGroup: params,
|
|
64
64
|
storageEncryptionKey: kmsKey,
|
|
65
65
|
autoMinorVersionUpgrade: false,
|
|
66
|
+
deleteAutomatedBackups: false,
|
|
66
67
|
});
|
|
67
68
|
|
|
68
69
|
cluster.connections.allowDefaultPortFromAnyIpv4('Open to the world');
|
|
@@ -100,4 +101,3 @@ const stackWithFeatureFlag = new TestStack(appWithFeatureFlag, 'aws-cdk-rds-inte
|
|
|
100
101
|
new IntegTest(appWithFeatureFlag, 'test-rds-cluster-with-feature-flag', {
|
|
101
102
|
testCases: [stackWithFeatureFlag],
|
|
102
103
|
});
|
|
103
|
-
appWithFeatureFlag.synth();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
2
|
+
import { App, RemovalPolicy, Stack } from 'aws-cdk-lib';
|
|
3
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
4
|
+
import * as rds from 'aws-cdk-lib/aws-rds';
|
|
5
|
+
|
|
6
|
+
const app = new App();
|
|
7
|
+
const stack = new Stack(app, 'cdk-rds-proxy-endpoint');
|
|
8
|
+
|
|
9
|
+
const vpc = new ec2.Vpc(stack, 'vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
|
|
10
|
+
|
|
11
|
+
const dbInstance = new rds.DatabaseInstance(stack, 'dbInstance', {
|
|
12
|
+
engine: rds.DatabaseInstanceEngine.postgres({
|
|
13
|
+
version: rds.PostgresEngineVersion.VER_17_5,
|
|
14
|
+
}),
|
|
15
|
+
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM),
|
|
16
|
+
vpc,
|
|
17
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const dbProxy = new rds.DatabaseProxy(stack, 'dbProxy', {
|
|
21
|
+
secrets: [dbInstance.secret!],
|
|
22
|
+
proxyTarget: rds.ProxyTarget.fromInstance(dbInstance),
|
|
23
|
+
vpc,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const securityGroup = ec2.SecurityGroup.fromSecurityGroupId(stack, 'SecurityGroup', vpc.vpcDefaultSecurityGroup);
|
|
27
|
+
|
|
28
|
+
dbProxy.addEndpoint('dbProxyEndpoint', {
|
|
29
|
+
vpc,
|
|
30
|
+
targetRole: rds.ProxyEndpointTargetRole.READ_ONLY,
|
|
31
|
+
securityGroups: [securityGroup],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
new integ.IntegTest(app, 'cdk-rds-proxy-endpoint-integ', {
|
|
35
|
+
testCases: [stack],
|
|
36
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import * as cdk from 'aws-cdk-lib';
|
|
3
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
4
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
5
|
+
import * as sns from 'aws-cdk-lib/aws-sns';
|
|
6
|
+
import * as sqs from 'aws-cdk-lib/aws-sqs';
|
|
7
|
+
import * as s3n from 'aws-cdk-lib/aws-s3-notifications';
|
|
8
|
+
import { Match, Template } from 'aws-cdk-lib/assertions';
|
|
9
|
+
|
|
10
|
+
const app = new cdk.App();
|
|
11
|
+
|
|
12
|
+
const stack = new cdk.Stack(app, 'aws-cdk-s3-notifications-scoped-permissions');
|
|
13
|
+
|
|
14
|
+
// Create multiple buckets to test consolidated policy with scoped permissions
|
|
15
|
+
const bucket1 = new s3.Bucket(stack, 'Bucket1', {
|
|
16
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const bucket2 = new s3.Bucket(stack, 'Bucket2', {
|
|
20
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const topic = new sns.Topic(stack, 'Topic');
|
|
24
|
+
const queue = new sqs.Queue(stack, 'Queue', {
|
|
25
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Add notifications to multiple buckets with different event types - this should create scoped IAM permissions
|
|
29
|
+
bucket1.addEventNotification(s3.EventType.OBJECT_CREATED_PUT, new s3n.SnsDestination(topic));
|
|
30
|
+
bucket1.addEventNotification(s3.EventType.OBJECT_CREATED_POST, new s3n.SqsDestination(queue));
|
|
31
|
+
bucket2.addEventNotification(s3.EventType.OBJECT_REMOVED_DELETE, new s3n.SnsDestination(topic));
|
|
32
|
+
bucket2.addEventNotification(s3.EventType.OBJECT_REMOVED_DELETE_MARKER_CREATED, new s3n.SnsDestination(topic));
|
|
33
|
+
|
|
34
|
+
// Create integration test with snapshot comparison enabled
|
|
35
|
+
new integ.IntegTest(app, 'ScopedPermissionsTest', {
|
|
36
|
+
testCases: [stack],
|
|
37
|
+
diffAssets: true,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Add assertions to verify IAM policies are scoped to specific bucket ARNs
|
|
41
|
+
const template = Template.fromStack(stack);
|
|
42
|
+
|
|
43
|
+
// Verify that IAM policies do not contain wildcard permissions
|
|
44
|
+
template.hasResourceProperties('AWS::IAM::Policy', {
|
|
45
|
+
PolicyDocument: {
|
|
46
|
+
Statement: Match.arrayWith([
|
|
47
|
+
Match.objectLike({
|
|
48
|
+
Effect: 'Allow',
|
|
49
|
+
Action: 's3:PutBucketNotification',
|
|
50
|
+
Resource: Match.not('*'), // Ensure no wildcard permissions
|
|
51
|
+
}),
|
|
52
|
+
]),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Verify that the IAM policy contains specific bucket ARNs
|
|
57
|
+
template.hasResourceProperties('AWS::IAM::Policy', {
|
|
58
|
+
PolicyDocument: {
|
|
59
|
+
Statement: Match.arrayWith([
|
|
60
|
+
Match.objectLike({
|
|
61
|
+
Effect: 'Allow',
|
|
62
|
+
Action: 's3:PutBucketNotification',
|
|
63
|
+
Resource: Match.arrayWith([
|
|
64
|
+
Match.objectLike({
|
|
65
|
+
'Fn::GetAtt': Match.arrayWith([Match.stringLikeRegexp('Bucket[12]'), 'Arn']),
|
|
66
|
+
}),
|
|
67
|
+
]),
|
|
68
|
+
}),
|
|
69
|
+
]),
|
|
70
|
+
},
|
|
71
|
+
});
|
|
@@ -9,7 +9,10 @@ const stack = new Stack(app, 'cdk-integ-assets-bundling-docker-opts');
|
|
|
9
9
|
new assets.Asset(stack, 'BundledAsset', {
|
|
10
10
|
path: path.join(__dirname, 'markdown-asset'), // /asset-input and working directory in the container
|
|
11
11
|
bundling: {
|
|
12
|
-
|
|
12
|
+
// Build an image
|
|
13
|
+
image: DockerImage.fromBuild(path.join(__dirname, 'alpine-markdown'), {
|
|
14
|
+
platform: 'linux/amd64',
|
|
15
|
+
}),
|
|
13
16
|
command: [
|
|
14
17
|
'sh', '-c', `
|
|
15
18
|
markdown index.md > /asset-output/index.html
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
2
|
+
import * as cdk from 'aws-cdk-lib/core';
|
|
3
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
4
|
+
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
5
|
+
|
|
6
|
+
const CSV_KEY = 'my-key.csv';
|
|
7
|
+
|
|
8
|
+
class DistributedMapParallelStack extends cdk.Stack {
|
|
9
|
+
readonly bucket: s3.Bucket;
|
|
10
|
+
readonly stateMachine: sfn.StateMachine;
|
|
11
|
+
|
|
12
|
+
constructor(scope: cdk.App, id: string) {
|
|
13
|
+
super(scope, id);
|
|
14
|
+
|
|
15
|
+
this.bucket = new s3.Bucket(this, 'Bucket', {
|
|
16
|
+
autoDeleteObjects: true,
|
|
17
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const parallel = new sfn.Parallel(this, 'Parallel');
|
|
21
|
+
|
|
22
|
+
const distributedMap = new sfn.DistributedMap(this, 'DistributedMap', {
|
|
23
|
+
itemReader: new sfn.S3CsvItemReader({
|
|
24
|
+
bucket: this.bucket,
|
|
25
|
+
key: CSV_KEY,
|
|
26
|
+
csvHeaders: sfn.CsvHeaders.useFirstRow(),
|
|
27
|
+
}),
|
|
28
|
+
}).itemProcessor(new sfn.Pass(this, 'Pass'));
|
|
29
|
+
|
|
30
|
+
this.stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
31
|
+
definitionBody: sfn.ChainDefinitionBody.fromChainable(parallel.branch(distributedMap)),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function setupAssertions(testCaseStack: DistributedMapParallelStack, assertions: integ.IDeployAssert) {
|
|
37
|
+
const waitForStateMachineActive = assertions
|
|
38
|
+
.awsApiCall('StepFunctions', 'describeStateMachine', {
|
|
39
|
+
stateMachineArn: testCaseStack.stateMachine.stateMachineArn,
|
|
40
|
+
})
|
|
41
|
+
.expect(integ.ExpectedResult.objectLike({ status: 'ACTIVE' }))
|
|
42
|
+
.waitForAssertions({
|
|
43
|
+
interval: cdk.Duration.seconds(10),
|
|
44
|
+
totalTimeout: cdk.Duration.minutes(5),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Upload the input to the DistributedMap
|
|
48
|
+
const uploadInput = assertions.awsApiCall('S3', 'putObject', {
|
|
49
|
+
Bucket: testCaseStack.bucket.bucketName,
|
|
50
|
+
Key: CSV_KEY,
|
|
51
|
+
Body: 'a,b,c\n1,2,3\n4,5,6',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Start an execution
|
|
55
|
+
const startExecution = assertions.awsApiCall('StepFunctions', 'startExecution', {
|
|
56
|
+
stateMachineArn: testCaseStack.stateMachine.stateMachineArn,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const executionArn = startExecution.getAttString('executionArn');
|
|
60
|
+
|
|
61
|
+
const expectSucceededExecution = assertions
|
|
62
|
+
.awsApiCall('StepFunctions', 'describeExecution', { executionArn: executionArn })
|
|
63
|
+
.expect(integ.ExpectedResult.objectLike({ status: 'SUCCEEDED' }))
|
|
64
|
+
.waitForAssertions({
|
|
65
|
+
interval: cdk.Duration.seconds(10),
|
|
66
|
+
totalTimeout: cdk.Duration.minutes(1),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
waitForStateMachineActive
|
|
70
|
+
.next(uploadInput)
|
|
71
|
+
.next(startExecution)
|
|
72
|
+
.next(expectSucceededExecution);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const app = new cdk.App();
|
|
76
|
+
const parallelStack = new DistributedMapParallelStack(app, 'DistributedMapParallelStack');
|
|
77
|
+
|
|
78
|
+
const testCase = new integ.IntegTest(app, 'DistributedMapParallel', {
|
|
79
|
+
testCases: [parallelStack],
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
setupAssertions(parallelStack, testCase.assertions);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
2
|
+
import * as cdk from 'aws-cdk-lib/core';
|
|
3
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
4
|
+
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
5
|
+
import * as aws_stepfunction_tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
|
|
6
|
+
|
|
7
|
+
const CSV_KEY = 'my-key.csv';
|
|
8
|
+
const SUCCESS_MARKER_KEY = 'pass-flag.txt';
|
|
9
|
+
|
|
10
|
+
interface DistributedMapRedriveStackProps extends cdk.StackProps {
|
|
11
|
+
readonly mapRunLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class DistributedMapRedriveStack extends cdk.Stack {
|
|
15
|
+
readonly bucket: s3.Bucket;
|
|
16
|
+
readonly stateMachine: sfn.StateMachine;
|
|
17
|
+
|
|
18
|
+
constructor(scope: cdk.App, id: string, props?: DistributedMapRedriveStackProps) {
|
|
19
|
+
super(scope, id, props);
|
|
20
|
+
|
|
21
|
+
this.bucket = new s3.Bucket(this, 'Bucket', {
|
|
22
|
+
autoDeleteObjects: true,
|
|
23
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const distributedMap = new sfn.DistributedMap(this, 'DistributedMap', {
|
|
27
|
+
label: props?.mapRunLabel,
|
|
28
|
+
itemReader: new sfn.S3CsvItemReader({
|
|
29
|
+
bucket: this.bucket,
|
|
30
|
+
key: CSV_KEY,
|
|
31
|
+
csvHeaders: sfn.CsvHeaders.useFirstRow(),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Existence of the success marker object determines if the distributed map succeeds or fails
|
|
36
|
+
const getSuccessMarker = new aws_stepfunction_tasks.CallAwsService(this, 'GetData', {
|
|
37
|
+
action: 'getObject',
|
|
38
|
+
iamResources: [this.bucket.arnForObjects('*')],
|
|
39
|
+
parameters: {
|
|
40
|
+
Bucket: this.bucket.bucketName,
|
|
41
|
+
Key: SUCCESS_MARKER_KEY,
|
|
42
|
+
},
|
|
43
|
+
service: 's3',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
distributedMap.itemProcessor(getSuccessMarker);
|
|
47
|
+
|
|
48
|
+
this.stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
49
|
+
definitionBody: sfn.ChainDefinitionBody.fromChainable(distributedMap),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function setupAssertions(testCaseStack: DistributedMapRedriveStack, assertions: integ.IDeployAssert) {
|
|
55
|
+
const waitForStateMachineActive = assertions
|
|
56
|
+
.awsApiCall('StepFunctions', 'describeStateMachine', {
|
|
57
|
+
stateMachineArn: testCaseStack.stateMachine.stateMachineArn,
|
|
58
|
+
})
|
|
59
|
+
.expect(integ.ExpectedResult.objectLike({ status: 'ACTIVE' }))
|
|
60
|
+
.waitForAssertions({
|
|
61
|
+
interval: cdk.Duration.seconds(10),
|
|
62
|
+
totalTimeout: cdk.Duration.minutes(5),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Upload the input to the DistributedMap
|
|
66
|
+
const uploadInput = assertions.awsApiCall('S3', 'putObject', {
|
|
67
|
+
Bucket: testCaseStack.bucket.bucketName,
|
|
68
|
+
Key: CSV_KEY,
|
|
69
|
+
Body: 'a,b,c\n1,2,3\n4,5,6',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Start an execution
|
|
73
|
+
const startExecution = assertions.awsApiCall('StepFunctions', 'startExecution', {
|
|
74
|
+
stateMachineArn: testCaseStack.stateMachine.stateMachineArn,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const executionArn = startExecution.getAttString('executionArn');
|
|
78
|
+
|
|
79
|
+
// describe the results of the execution
|
|
80
|
+
const expectFailedExecution = assertions
|
|
81
|
+
.awsApiCall('StepFunctions', 'describeExecution', {
|
|
82
|
+
executionArn: executionArn,
|
|
83
|
+
})
|
|
84
|
+
.expect(integ.ExpectedResult.objectLike({ status: 'FAILED' }))
|
|
85
|
+
.waitForAssertions({
|
|
86
|
+
interval: cdk.Duration.seconds(10),
|
|
87
|
+
totalTimeout: cdk.Duration.minutes(1),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Upload the success marker, so that the next execution succeeds
|
|
91
|
+
const uploadSucceedMarker = assertions.awsApiCall('S3', 'putObject', {
|
|
92
|
+
Bucket: testCaseStack.bucket.bucketName,
|
|
93
|
+
Key: SUCCESS_MARKER_KEY,
|
|
94
|
+
Body: '',
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const redriveExecution = assertions.awsApiCall('StepFunctions', 'redriveExecution', {
|
|
98
|
+
executionArn: executionArn,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const expectRedrivenExecution = assertions
|
|
102
|
+
.awsApiCall('StepFunctions', 'describeExecution', { executionArn: executionArn })
|
|
103
|
+
.expect(integ.ExpectedResult.objectLike({ status: 'SUCCEEDED' }))
|
|
104
|
+
.waitForAssertions({
|
|
105
|
+
interval: cdk.Duration.seconds(10),
|
|
106
|
+
totalTimeout: cdk.Duration.minutes(1),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
waitForStateMachineActive
|
|
110
|
+
.next(uploadInput)
|
|
111
|
+
.next(startExecution)
|
|
112
|
+
.next(expectFailedExecution)
|
|
113
|
+
.next(uploadSucceedMarker)
|
|
114
|
+
.next(redriveExecution)
|
|
115
|
+
.next(expectRedrivenExecution);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const app = new cdk.App();
|
|
119
|
+
|
|
120
|
+
const unlabeledDistributedMapStack = new DistributedMapRedriveStack(app, 'UnlabeledDistributedMapRedrive');
|
|
121
|
+
const labeledDistributedMapStack = new DistributedMapRedriveStack(app, 'LabeledDistributedMapRedrive', {
|
|
122
|
+
mapRunLabel: 'myLabel',
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const testCase = new integ.IntegTest(app, 'DistributedMap', {
|
|
126
|
+
testCases: [unlabeledDistributedMapStack, labeledDistributedMapStack],
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
setupAssertions(labeledDistributedMapStack, testCase.assertions);
|
|
130
|
+
setupAssertions(unlabeledDistributedMapStack, testCase.assertions);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { App, Stack, StackProps } from 'aws-cdk-lib';
|
|
2
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
5
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
6
|
+
import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
|
|
7
|
+
|
|
8
|
+
class TestStack extends Stack {
|
|
9
|
+
constructor(scope: Construct, id: string, props?: StackProps) {
|
|
10
|
+
super(scope, id, props);
|
|
11
|
+
|
|
12
|
+
const task = new tasks.EvaluateExpression(this, 'Task', {
|
|
13
|
+
expression: '$.a + $.b',
|
|
14
|
+
runtime: lambda.Runtime.NODEJS_22_X,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
new sfn.StateMachine(this, 'StateMachine', {
|
|
18
|
+
definition: task,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const app = new App();
|
|
24
|
+
|
|
25
|
+
new integ.IntegTest(app, 'EvaluateExpressionNodejs22', {
|
|
26
|
+
testCases: [new TestStack(app, 'evaluate-expression-nodejs22')],
|
|
27
|
+
});
|
|
@@ -165,6 +165,33 @@ const canary = new synthetics.Canary(this, 'MyCanary', {
|
|
|
165
165
|
});
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
### Browser Type Configuration
|
|
169
|
+
|
|
170
|
+
You can configure which browsers your canary uses for testing by specifying the `browserConfigs` property. This allows you to test your application across different browsers to ensure compatibility.
|
|
171
|
+
|
|
172
|
+
Available browser types:
|
|
173
|
+
- `BrowserType.CHROME` - Google Chrome browser
|
|
174
|
+
- `BrowserType.FIREFOX` - Mozilla Firefox browser
|
|
175
|
+
|
|
176
|
+
You can specify up to 2 browser configurations. When multiple browsers are configured, the canary will run tests on each browser sequentially.
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
const canary = new synthetics.Canary(this, 'MyCanary', {
|
|
180
|
+
schedule: synthetics.Schedule.rate(Duration.minutes(5)),
|
|
181
|
+
test: synthetics.Test.custom({
|
|
182
|
+
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
|
|
183
|
+
handler: 'index.handler',
|
|
184
|
+
}),
|
|
185
|
+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_9_1,
|
|
186
|
+
browserConfigs: [
|
|
187
|
+
synthetics.BrowserType.CHROME,
|
|
188
|
+
synthetics.BrowserType.FIREFOX,
|
|
189
|
+
],
|
|
190
|
+
});
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
> **Note:** Firefox support is available for Node.js runtimes (Puppeteer and Playwright) but not for Python Selenium runtimes. When using Firefox, ensure your runtime version supports it.
|
|
194
|
+
|
|
168
195
|
### Deleting underlying resources on canary deletion
|
|
169
196
|
|
|
170
197
|
When you delete a lambda, the following underlying resources are isolated in your AWS account:
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { App, Duration, Size, Stack, StackProps } from 'aws-cdk-lib/core';
|
|
3
|
+
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
|
|
4
|
+
import { Construct } from 'constructs';
|
|
5
|
+
import * as synthetics from 'aws-cdk-lib/aws-synthetics';
|
|
6
|
+
|
|
7
|
+
class TestStack extends Stack {
|
|
8
|
+
public canary: synthetics.Canary;
|
|
9
|
+
|
|
10
|
+
constructor(scope: Construct, id: string, props?: StackProps) {
|
|
11
|
+
super(scope, id, props);
|
|
12
|
+
|
|
13
|
+
this.canary = new synthetics.Canary(this, 'BrowserTypeCanary', {
|
|
14
|
+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_11_0,
|
|
15
|
+
test: synthetics.Test.custom({
|
|
16
|
+
handler: 'canary.handler',
|
|
17
|
+
code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
|
|
18
|
+
}),
|
|
19
|
+
memory: Size.mebibytes(2048),
|
|
20
|
+
timeout: Duration.minutes(4),
|
|
21
|
+
maxRetries: 2,
|
|
22
|
+
browserConfigs: [
|
|
23
|
+
synthetics.BrowserType.CHROME,
|
|
24
|
+
synthetics.BrowserType.FIREFOX,
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const app = new App();
|
|
31
|
+
const testStack = new TestStack(app, 'SyntheticsCanaryBrowserTypeStack');
|
|
32
|
+
|
|
33
|
+
new IntegTest(app, 'SyntheticsCanaryBrowserType', {
|
|
34
|
+
testCases: [testStack],
|
|
35
|
+
});
|
|
@@ -106,7 +106,7 @@ Flags come in three types:
|
|
|
106
106
|
| [@aws-cdk/aws-kms:applyImportedAliasPermissionsToPrincipal](#aws-cdkaws-kmsapplyimportedaliaspermissionstoprincipal) | Enable grant methods on Aliases imported by name to use kms:ResourceAliases condition | 2.202.0 | fix |
|
|
107
107
|
| [@aws-cdk/core:explicitStackTags](#aws-cdkcoreexplicitstacktags) | When enabled, stack tags need to be assigned explicitly on a Stack. | 2.205.0 | new default |
|
|
108
108
|
| [@aws-cdk/aws-signer:signingProfileNamePassedToCfn](#aws-cdkaws-signersigningprofilenamepassedtocfn) | Pass signingProfileName to CfnSigningProfile | 2.212.0 | fix |
|
|
109
|
-
| [@aws-cdk/aws-ecs-patterns:secGroupsDisablesImplicitOpenListener](#aws-cdkaws-ecs-patternssecgroupsdisablesimplicitopenlistener) | Disable implicit openListener when custom security groups are provided |
|
|
109
|
+
| [@aws-cdk/aws-ecs-patterns:secGroupsDisablesImplicitOpenListener](#aws-cdkaws-ecs-patternssecgroupsdisablesimplicitopenlistener) | Disable implicit openListener when custom security groups are provided | 2.214.0 | new default |
|
|
110
110
|
|
|
111
111
|
<!-- END table -->
|
|
112
112
|
|
|
@@ -2272,7 +2272,7 @@ override this behavior.
|
|
|
2272
2272
|
| Since | Unset behaves like | Recommended value |
|
|
2273
2273
|
| ----- | ----- | ----- |
|
|
2274
2274
|
| (not in v1) | | |
|
|
2275
|
-
|
|
|
2275
|
+
| 2.214.0 | `false` | `true` |
|
|
2276
2276
|
|
|
2277
2277
|
**Compatibility with old behavior:** You can pass `openListener: true` explicitly to maintain the old behavior.
|
|
2278
2278
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: konokenj.cdk-api-mcp-server
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.44.0
|
|
4
4
|
Summary: An MCP server provides AWS CDK API Reference
|
|
5
5
|
Project-URL: Documentation, https://github.com/konokenj/cdk-api-mcp-server#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/konokenj/cdk-api-mcp-server/issues
|
|
@@ -26,7 +26,7 @@ Description-Content-Type: text/markdown
|
|
|
26
26
|
[](https://pypi.org/project/konokenj.cdk-api-mcp-server)
|
|
27
27
|
|
|
28
28
|
<!-- DEP-VERSIONS-START -->
|
|
29
|
-
[](https://github.com/konokenj/cdk-api-mcp-server/blob/main/current-versions/aws-cdk.txt)
|
|
30
30
|
<!-- DEP-VERSIONS-END -->
|
|
31
31
|
|
|
32
32
|
---
|