konokenj.cdk-api-mcp-server 0.25.0__py3-none-any.whl → 0.27.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.

Files changed (43) hide show
  1. cdk_api_mcp_server/__about__.py +1 -1
  2. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-amplify-alpha/README.md +14 -0
  3. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-bedrock-alpha/README.md +608 -0
  4. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.model-schema-additional-items.ts +72 -0
  5. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront/README.md +8 -0
  6. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront/integ.distribution-basic.ts +1 -1
  7. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-config.ts +15 -4
  8. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-group.ts +40 -218
  9. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/README.md +34 -0
  10. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-ec2-deploy-ssm-managed.ts +140 -0
  11. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-ec2-deploy.ts +140 -0
  12. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/README.md +55 -1
  13. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.machine-image-cached.ts +53 -0
  14. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.volume-initialization-rate.ts +21 -0
  15. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +16 -0
  16. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.availability-zone-rebalancing.ts +4 -14
  17. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.enable-execute-command.ts +29 -35
  18. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.exec-command.ts +22 -16
  19. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.lb-awsvpc-nw.ts +16 -26
  20. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.pseudo-terminal.ts +8 -18
  21. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/README.md +6 -0
  22. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.custom-addons.ts +48 -0
  23. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/README.md +1 -0
  24. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/integ.expose-metric-with-dimensions.ts +47 -0
  25. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-opensearchservice/integ.opensearch.gp3.ts +16 -1
  26. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-opensearchservice/integ.opensearch.https.ts +54 -0
  27. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/README.md +25 -2
  28. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-serverless-v2-autopause.ts +27 -0
  29. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.instance-from-cluster-snapshot.ts +23 -0
  30. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ssm/README.md +16 -0
  31. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/README.md +21 -0
  32. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.map-jsonata-itemselector.ts +36 -0
  33. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke-jsonata.ts +80 -87
  34. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke.ts +69 -87
  35. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.start-job-run.ts +104 -102
  36. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/README.md +23 -0
  37. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary-dryrun-update.ts +32 -0
  38. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary.ts +2 -0
  39. {konokenj_cdk_api_mcp_server-0.25.0.dist-info → konokenj_cdk_api_mcp_server-0.27.0.dist-info}/METADATA +1 -1
  40. {konokenj_cdk_api_mcp_server-0.25.0.dist-info → konokenj_cdk_api_mcp_server-0.27.0.dist-info}/RECORD +43 -30
  41. {konokenj_cdk_api_mcp_server-0.25.0.dist-info → konokenj_cdk_api_mcp_server-0.27.0.dist-info}/WHEEL +0 -0
  42. {konokenj_cdk_api_mcp_server-0.25.0.dist-info → konokenj_cdk_api_mcp_server-0.27.0.dist-info}/entry_points.txt +0 -0
  43. {konokenj_cdk_api_mcp_server-0.25.0.dist-info → konokenj_cdk_api_mcp_server-0.27.0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,119 +1,101 @@
1
- import { Code, Function } from 'aws-cdk-lib/aws-lambda';
2
- import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
3
- import * as cdk from 'aws-cdk-lib';
4
- import { LambdaInvoke } from 'aws-cdk-lib/aws-stepfunctions-tasks';
1
+ import * as path from 'path';
5
2
  import { IntegTest, ExpectedResult } from '@aws-cdk/integ-tests-alpha';
6
- import { STANDARD_NODEJS_RUNTIME } from '../../../config';
3
+ import * as cdk from 'aws-cdk-lib';
4
+ import * as apigateway from 'aws-cdk-lib/aws-apigateway';
5
+ import * as events from 'aws-cdk-lib/aws-events';
6
+ import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
7
+ import * as lambda from 'aws-cdk-lib/aws-lambda-nodejs';
8
+ import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
9
+ import { password, username } from './my-lambda-handler';
7
10
 
8
11
  /*
9
- * Creates a state machine with a task state to invoke a Lambda function
10
- * The state machine creates a couple of Lambdas that pass results forward
11
- * and into a Choice state that validates the output.
12
- *
13
- * Stack verification steps:
14
- * The generated State Machine can be executed from the CLI (or Step Functions console)
15
- * and runs with an execution status of `Succeeded`.
12
+ * Creates an API Gateway instance with a GET method and mock integration,
13
+ * secured with basic auth. It then creates a matching Connection and uses it
14
+ * in a state machine with a task state to invoke the endpoint.
16
15
  *
17
- * -- aws stepfunctions start-execution --state-machine-arn <state-machine-arn-from-output> provides execution arn
18
- * -- aws stepfunctions describe-execution --execution-arn <state-machine-arn-from-output> returns a status of `Succeeded`
16
+ * Stack verification steps :
17
+ * * aws stepfunctions start-execution --state-machine-arn <deployed state machine arn> : should return execution arn
18
+ * * aws stepfunctions describe-execution --execution-arn <execution-arn generated before> : should return status as SUCCEEDED
19
19
  */
20
20
  const app = new cdk.App({
21
21
  postCliContext: {
22
22
  '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
23
23
  },
24
24
  });
25
- const stack = new cdk.Stack(app, 'aws-stepfunctions-tasks-lambda-invoke-integ');
25
+ const stack = new cdk.Stack(app, 'aws-stepfunctions-tasks-http-invoke-integ');
26
26
 
27
- const submitJobLambda = new Function(stack, 'submitJobLambda', {
28
- code: Code.fromInline(`exports.handler = async (event, context) => {
29
- return {
30
- statusCode: '200',
31
- body: 'hello, world!',
32
- ...event,
33
- };
34
- };`),
35
- runtime: STANDARD_NODEJS_RUNTIME,
36
- handler: 'index.handler',
27
+ const authorizerHandler = new lambda.NodejsFunction(stack, 'AuthorizerHandler', {
28
+ entry: path.resolve(__dirname, 'my-lambda-handler', 'index.ts'),
29
+ handler: 'handler',
37
30
  });
38
31
 
39
- const submitJob = new LambdaInvoke(stack, 'Invoke Handler', {
40
- lambdaFunction: submitJobLambda,
41
- payload: sfn.TaskInput.fromObject({
42
- execId: sfn.JsonPath.executionId,
43
- execInput: sfn.JsonPath.executionInput,
44
- execName: sfn.JsonPath.executionName,
45
- execRoleArn: sfn.JsonPath.executionRoleArn,
46
- execStartTime: sfn.JsonPath.executionStartTime,
47
- stateEnteredTime: sfn.JsonPath.stateEnteredTime,
48
- stateName: sfn.JsonPath.stateName,
49
- stateRetryCount: sfn.JsonPath.stateRetryCount,
50
- stateMachineId: sfn.JsonPath.stateMachineId,
51
- stateMachineName: sfn.JsonPath.stateMachineName,
52
- }),
53
- outputPath: '$.Payload',
32
+ const authorizer = new apigateway.TokenAuthorizer(stack, 'Authorizer', {
33
+ handler: authorizerHandler,
34
+ identitySource: 'method.request.header.Authorization',
35
+ resultsCacheTtl: cdk.Duration.seconds(0),
54
36
  });
55
37
 
56
- const checkJobStateLambda = new Function(stack, 'checkJobStateLambda', {
57
- code: Code.fromInline(`exports.handler = async function(event, context) {
58
- const expectedFields = [
59
- 'execId', 'execInput', 'execName', 'execRoleArn',
60
- 'execStartTime', 'stateEnteredTime', 'stateName',
61
- 'stateRetryCount', 'stateMachineId', 'stateMachineName',
62
- ];
63
- const fieldsAreSet = expectedFields.every(field => event[field] !== undefined);
64
- return {
65
- status: event.statusCode === '200' && fieldsAreSet ? 'SUCCEEDED' : 'FAILED'
66
- };
67
- };`),
68
- runtime: STANDARD_NODEJS_RUNTIME,
69
- handler: 'index.handler',
70
- });
38
+ const api = new apigateway.RestApi(stack, 'IntegRestApi');
71
39
 
72
- const checkJobState = new LambdaInvoke(stack, 'Check the job state', {
73
- lambdaFunction: checkJobStateLambda,
74
- resultSelector: {
75
- status: sfn.JsonPath.stringAt('$.Payload.status'),
40
+ api.root.addResource('test').addMethod(
41
+ 'GET',
42
+ new apigateway.MockIntegration({
43
+ integrationResponses: [
44
+ {
45
+ statusCode: '200',
46
+ responseTemplates: {
47
+ 'application/json': JSON.stringify({ message: 'Hello, tester!' }),
48
+ },
49
+ },
50
+ ],
51
+ passthroughBehavior: apigateway.PassthroughBehavior.NEVER,
52
+ requestTemplates: {
53
+ 'application/json': '{ "statusCode": 200 }',
54
+ },
55
+ }),
56
+ {
57
+ authorizer,
58
+ methodResponses: [
59
+ {
60
+ statusCode: '200',
61
+ },
62
+ ],
76
63
  },
77
- });
64
+ );
78
65
 
79
- const isComplete = new sfn.Choice(stack, 'Job Complete?');
80
- const jobFailed = new sfn.Fail(stack, 'Job Failed', {
81
- cause: 'Job Failed',
82
- error: 'Received a status that was not 200',
66
+ const connection = new events.Connection(stack, 'Connection', {
67
+ authorization: events.Authorization.basic(username, cdk.SecretValue.unsafePlainText(password)),
83
68
  });
84
- const finalStatus = new sfn.Pass(stack, 'Final step');
85
69
 
86
- const chain = sfn.Chain.start(submitJob)
87
- .next(checkJobState)
88
- .next(
89
- isComplete
90
- .when(sfn.Condition.stringEquals('$.status', 'FAILED'), jobFailed)
91
- .when(sfn.Condition.stringEquals('$.status', 'SUCCEEDED'), finalStatus),
92
- );
70
+ const httpInvokeTask = new tasks.HttpInvoke(stack, 'Invoke HTTP Endpoint', {
71
+ apiRoot: api.urlForPath('/'),
72
+ apiEndpoint: sfn.TaskInput.fromText('/test'),
73
+ connection,
74
+ method: sfn.TaskInput.fromText('GET'),
75
+ });
93
76
 
94
77
  const sm = new sfn.StateMachine(stack, 'StateMachine', {
95
- definition: chain,
78
+ definition: httpInvokeTask,
96
79
  timeout: cdk.Duration.seconds(30),
97
80
  });
98
81
 
99
- new cdk.CfnOutput(stack, 'stateMachineArn', {
100
- value: sm.stateMachineArn,
101
- });
102
-
103
- const integ = new IntegTest(app, 'IntegTest', {
82
+ const testCase = new IntegTest(app, 'HttpInvokeTest', {
104
83
  testCases: [stack],
105
84
  });
106
- const res = integ.assertions.awsApiCall('StepFunctions', 'startExecution', {
85
+
86
+ // Start an execution
87
+ const start = testCase.assertions.awsApiCall('StepFunctions', 'startExecution', {
107
88
  stateMachineArn: sm.stateMachineArn,
108
89
  });
109
- const executionArn = res.getAttString('executionArn');
110
- integ.assertions.awsApiCall('StepFunctions', 'describeExecution', {
111
- executionArn,
112
- }).expect(ExpectedResult.objectLike({
113
- status: 'SUCCEEDED',
114
- })).waitForAssertions({
115
- totalTimeout: cdk.Duration.seconds(10),
116
- interval: cdk.Duration.seconds(3),
90
+
91
+ // describe the results of the execution
92
+ const describe = testCase.assertions.awsApiCall('StepFunctions', 'describeExecution', {
93
+ executionArn: start.getAttString('executionArn'),
117
94
  });
118
95
 
96
+ // assert the results
97
+ describe.expect(ExpectedResult.objectLike({
98
+ status: 'SUCCEEDED',
99
+ }));
100
+
119
101
  app.synth();
@@ -1,122 +1,124 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- import * as eks from 'aws-cdk-lib/aws-eks';
3
- import { AwsAuthMapping } from 'aws-cdk-lib/aws-eks';
1
+ import * as databrew from 'aws-cdk-lib/aws-databrew';
4
2
  import * as iam from 'aws-cdk-lib/aws-iam';
3
+ import * as s3 from 'aws-cdk-lib/aws-s3';
5
4
  import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
6
5
  import * as cdk from 'aws-cdk-lib';
7
- import { Aws } from 'aws-cdk-lib';
8
- import * as integ from '@aws-cdk/integ-tests-alpha';
9
- import { KubectlV31Layer } from '@aws-cdk/lambda-layer-kubectl-v31';
10
- import { EmrContainersStartJobRun, ReleaseLabel, VirtualClusterInput } from 'aws-cdk-lib/aws-stepfunctions-tasks';
11
- import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api';
6
+ import { GlueDataBrewStartJobRun } from 'aws-cdk-lib/aws-stepfunctions-tasks';
12
7
 
13
- /**
8
+ /*
14
9
  * Stack verification steps:
15
- * Everything in the link below must be setup before running the state machine.
16
- * @see https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/setting-up-enable-IAM.html
17
- * aws stepfunctions start-execution --state-machine-arn <deployed state machine arn> : should return execution arn
18
- * aws stepfunctions describe-execution --execution-arn <exection-arn generated before> : should return status as SUCCEEDED
10
+ * * aws stepfunctions start-execution --state-machine-arn <deployed state machine arn> : should return execution arn
11
+ * * aws stepfunctions describe-execution --execution-arn <exection-arn generated before> : should return status as SUCCEEDED
19
12
  */
20
13
 
21
- const app = new cdk.App({
22
- postCliContext: {
23
- '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
24
- '@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': false,
25
- },
26
- });
27
- const stack = new cdk.Stack(app, 'aws-stepfunctions-tasks-emr-containers-start-job-run');
28
- stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false);
14
+ class GlueDataBrewJobStack extends cdk.Stack {
15
+ constructor(scope: cdk.App, id: string, props: cdk.StackProps = {}) {
16
+ super(scope, id, props);
29
17
 
30
- const eksCluster = new eks.Cluster(stack, 'integration-test-eks-cluster', {
31
- version: eks.KubernetesVersion.V1_30,
32
- defaultCapacity: 3,
33
- defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE),
34
- kubectlLayer: new KubectlV31Layer(stack, 'KubectlLayer'),
35
- });
18
+ const region = this.region;
36
19
 
37
- const virtualCluster = new cdk.CfnResource(stack, 'Virtual Cluster', {
38
- type: 'AWS::EMRContainers::VirtualCluster',
39
- properties: {
40
- ContainerProvider: {
41
- Id: eksCluster.clusterName,
42
- Info: {
43
- EksInfo: {
44
- Namespace: 'default',
45
- },
46
- },
47
- Type: 'EKS',
48
- },
49
- Name: 'Virtual-Cluster-Name',
50
- },
51
- });
52
-
53
- const emrRole = eksCluster.addManifest('emrRole', {
54
- apiVersion: 'rbac.authorization.k8s.io/v1',
55
- kind: 'Role',
56
- metadata: { name: 'emr-containers', namespace: 'default' },
57
- rules: [
58
- { apiGroups: [''], resources: ['namespaces'], verbs: ['get'] },
59
- { apiGroups: [''], resources: ['serviceaccounts', 'services', 'configmaps', 'events', 'pods', 'pods/log'], verbs: ['get', 'list', 'watch', 'describe', 'create', 'edit', 'delete', 'deletecollection', 'annotate', 'patch', 'label'] },
60
- { apiGroups: [''], resources: ['secrets'], verbs: ['create', 'patch', 'delete', 'watch'] },
61
- { apiGroups: ['apps'], resources: ['statefulsets', 'deployments'], verbs: ['get', 'list', 'watch', 'describe', 'create', 'edit', 'delete', 'annotate', 'patch', 'label'] },
62
- { apiGroups: ['batch'], resources: ['jobs'], verbs: ['get', 'list', 'watch', 'describe', 'create', 'edit', 'delete', 'annotate', 'patch', 'label'] },
63
- { apiGroups: ['extensions'], resources: ['ingresses'], verbs: ['get', 'list', 'watch', 'describe', 'create', 'edit', 'delete', 'annotate', 'patch', 'label'] },
64
- { apiGroups: ['rbac.authorization.k8s.io'], resources: ['roles', 'rolebindings'], verbs: ['get', 'list', 'watch', 'describe', 'create', 'edit', 'delete', 'deletecollection', 'annotate', 'patch', 'label'] },
65
- ],
66
- });
20
+ const outputBucket = new s3.Bucket(this, 'JobOutputBucket', {
21
+ removalPolicy: cdk.RemovalPolicy.DESTROY,
22
+ });
67
23
 
68
- const emrRoleBind = eksCluster.addManifest('emrRoleBind', {
69
- apiVersion: 'rbac.authorization.k8s.io/v1',
70
- kind: 'RoleBinding',
71
- metadata: { name: 'emr-containers', namespace: 'default' },
72
- subjects: [{ kind: 'User', name: 'emr-containers', apiGroup: 'rbac.authorization.k8s.io' }],
73
- roleRef: { kind: 'Role', name: 'emr-containers', apiGroup: 'rbac.authorization.k8s.io' },
74
- });
24
+ const role = new iam.Role(this, 'DataBrew Role', {
25
+ managedPolicies: [{
26
+ managedPolicyArn: 'arn:aws:iam::aws:policy/service-role/AWSGlueDataBrewServiceRole',
27
+ }],
28
+ path: '/',
29
+ assumedBy: new iam.ServicePrincipal('databrew.amazonaws.com'),
30
+ inlinePolicies: {
31
+ DataBrewPolicy: iam.PolicyDocument.fromJson({
32
+ Statement: [{
33
+ Effect: 'Allow',
34
+ Action: [
35
+ 's3:GetObject',
36
+ 's3:PutObject',
37
+ 's3:DeleteObject',
38
+ 's3:ListBucket',
39
+ ],
40
+ Resource: [
41
+ `arn:aws:s3:::databrew-public-datasets-${region}/*`,
42
+ `arn:aws:s3:::databrew-public-datasets-${region}`,
43
+ `${outputBucket.bucketArn}/*`,
44
+ `${outputBucket.bucketArn}`,
45
+ ],
46
+ }],
47
+ }),
48
+ },
49
+ });
75
50
 
76
- emrRoleBind.node.addDependency(emrRole);
51
+ const recipe = new databrew.CfnRecipe(this, 'DataBrew Recipe', {
52
+ name: 'recipe-1',
53
+ steps: [
54
+ {
55
+ action: {
56
+ operation: 'UPPER_CASE',
57
+ parameters: {
58
+ sourceColumn: 'description',
59
+ },
60
+ },
61
+ },
62
+ {
63
+ action: {
64
+ operation: 'DELETE',
65
+ parameters: {
66
+ sourceColumn: 'doc_id',
67
+ },
68
+ },
69
+ },
70
+ ],
71
+ });
77
72
 
78
- const emrServiceRole = iam.Role.fromRoleArn(stack, 'emrServiceRole', 'arn:aws:iam::'+Aws.ACCOUNT_ID+':role/AWSServiceRoleForAmazonEMRContainers');
79
- const authMapping: AwsAuthMapping = { groups: [], username: 'emr-containers' };
80
- eksCluster.awsAuth.addRoleMapping(emrServiceRole, authMapping);
73
+ const dataset = new databrew.CfnDataset(this, 'DataBrew Dataset', {
74
+ input: {
75
+ s3InputDefinition: {
76
+ bucket: `databrew-public-datasets-${region}`,
77
+ key: 'votes.csv',
78
+ },
79
+ },
80
+ name: 'dataset-1',
81
+ });
81
82
 
82
- virtualCluster.node.addDependency(emrRoleBind);
83
- virtualCluster.node.addDependency(eksCluster.awsAuth);
83
+ const project = new databrew.CfnProject(this, 'DataBrew Project', {
84
+ name: 'project-1',
85
+ roleArn: role.roleArn,
86
+ datasetName: dataset.name,
87
+ recipeName: recipe.name,
88
+ });
89
+ project.addDependency(dataset);
90
+ project.addDependency(recipe);
84
91
 
85
- const startJobRunJob = new EmrContainersStartJobRun(stack, 'Start a Job Run', {
86
- virtualCluster: VirtualClusterInput.fromVirtualClusterId(virtualCluster.getAtt('Id').toString()),
87
- releaseLabel: ReleaseLabel.EMR_6_2_0,
88
- jobName: 'EMR-Containers-Job',
89
- jobDriver: {
90
- sparkSubmitJobDriver: {
91
- entryPoint: sfn.TaskInput.fromText('local:///usr/lib/spark/examples/src/main/python/pi.py'),
92
- entryPointArguments: sfn.TaskInput.fromObject(['2']),
93
- sparkSubmitParameters: '--conf spark.driver.memory=512M --conf spark.kubernetes.driver.request.cores=0.2 --conf spark.kubernetes.executor.request.cores=0.2 --conf spark.sql.shuffle.partitions=60 --conf spark.dynamicAllocation.enabled=false',
94
- },
95
- },
96
- });
92
+ const job = new databrew.CfnJob(this, 'DataBrew Job', {
93
+ name: 'job-1',
94
+ type: 'RECIPE',
95
+ projectName: project.name,
96
+ roleArn: role.roleArn,
97
+ outputs: [{
98
+ location: {
99
+ bucket: outputBucket.bucketName,
100
+ },
101
+ }],
102
+ });
103
+ job.addDependency(project);
97
104
 
98
- const chain = sfn.Chain.start(startJobRunJob);
105
+ const startGlueDataBrewJob = new GlueDataBrewStartJobRun(this, 'Start DataBrew Job run', {
106
+ name: job.name,
107
+ });
99
108
 
100
- const sm = new sfn.StateMachine(stack, 'StateMachine', {
101
- definition: chain,
102
- timeout: cdk.Duration.seconds(1000),
103
- });
109
+ const chain = sfn.Chain.start(startGlueDataBrewJob);
104
110
 
105
- new cdk.CfnOutput(stack, 'stateMachineArn', {
106
- value: sm.stateMachineArn,
107
- });
111
+ const sm = new sfn.StateMachine(this, 'StateMachine', {
112
+ definition: chain,
113
+ timeout: cdk.Duration.seconds(30),
114
+ });
108
115
 
109
- new integ.IntegTest(app, 'aws-stepfunctions-tasks-emr-containers-start-job-run-integ', {
110
- testCases: [stack],
111
- // Test includes assets that are updated weekly. If not disabled, the upgrade PR will fail.
112
- diffAssets: false,
113
- cdkCommandOptions: {
114
- deploy: {
115
- args: {
116
- rollback: true,
117
- },
118
- },
119
- },
120
- });
116
+ new cdk.CfnOutput(this, 'stateMachineArn', {
117
+ value: sm.stateMachineArn,
118
+ });
119
+ }
120
+ }
121
121
 
122
+ const app = new cdk.App();
123
+ new GlueDataBrewJobStack(app, 'aws-stepfunctions-tasks-databrew-start-job-run-integ');
122
124
  app.synth();
@@ -298,6 +298,29 @@ new cloudwatch.Alarm(this, 'CanaryAlarm', {
298
298
  });
299
299
  ```
300
300
 
301
+ ### Performing safe canary updates
302
+
303
+ You can configure a canary to first perform a dry run before applying any updates. The `dryRunAndUpdate` property can be used to safely update canaries by validating the changes before they're applied.
304
+ This feature is supported for canary runtime versions `syn-nodejs-puppeteer-10.0+`, `syn-nodejs-playwright-2.0+`, and `syn-python-selenium-5.1+`.
305
+
306
+ When `dryRunAndUpdate` is set to `true`, CDK will execute a dry run to validate the changes before applying them to the canary.
307
+ If the dry run succeeds, the canary will be updated with the changes.
308
+ If the dry run fails, the CloudFormation deployment will fail with the dry run's failure reason.
309
+
310
+ ```ts
311
+ const canary = new synthetics.Canary(this, 'MyCanary', {
312
+ schedule: synthetics.Schedule.rate(Duration.minutes(5)),
313
+ test: synthetics.Test.custom({
314
+ code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
315
+ handler: 'index.handler',
316
+ }),
317
+ runtime: synthetics.Runtime.SYNTHETICS_PYTHON_SELENIUM_5_1,
318
+ dryRunAndUpdate: true, // Enable dry run before updating
319
+ });
320
+ ```
321
+
322
+ For more information, see [Performing safe canary updates](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/performing-safe-canary-upgrades.html).
323
+
301
324
  ### Artifacts
302
325
 
303
326
  You can pass an S3 bucket to store artifacts from canary runs. If you do not,
@@ -0,0 +1,32 @@
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, 'DryRunCanary', {
14
+ canaryName: 'dryrun',
15
+ runtime: synthetics.Runtime.SYNTHETICS_PYTHON_SELENIUM_5_1,
16
+ test: synthetics.Test.custom({
17
+ handler: 'canary.handler',
18
+ code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
19
+ }),
20
+ memory: Size.mebibytes(2048),
21
+ timeout: Duration.minutes(4),
22
+ dryRunAndUpdate: true,
23
+ });
24
+ }
25
+ }
26
+
27
+ const app = new App();
28
+ const testStack = new TestStack(app, 'SyntheticsCanaryDryRunAndUpdateStack');
29
+
30
+ new IntegTest(app, 'SyntheticsCanaryDryRunAndUpdate', {
31
+ testCases: [testStack],
32
+ });
@@ -113,6 +113,7 @@ const selenium40 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_4_0
113
113
  const selenium41 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_4_1);
114
114
  const selenium50 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_5_0);
115
115
  const selenium51 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_5_1);
116
+ const selenium60 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_6_0);
116
117
 
117
118
  const test = new IntegTest(app, 'IntegCanaryTest', {
118
119
  testCases: [stack],
@@ -140,6 +141,7 @@ const test = new IntegTest(app, 'IntegCanaryTest', {
140
141
  selenium41,
141
142
  selenium50,
142
143
  selenium51,
144
+ selenium60,
143
145
  ].forEach((canary) => test.assertions
144
146
  .awsApiCall('Synthetics', 'getCanaryRuns', {
145
147
  Name: canary.canaryName,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: konokenj.cdk-api-mcp-server
3
- Version: 0.25.0
3
+ Version: 0.27.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