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.

Files changed (35) hide show
  1. cdk_api_mcp_server/__about__.py +1 -1
  2. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-glue-alpha/README.md +9 -9
  3. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-iot-alpha/README.md +1 -1
  4. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/README.md +8 -0
  5. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api.ts +4 -0
  6. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/README.md +34 -0
  7. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/integ.ecs-exec-batch-job.ts +148 -0
  8. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-certificatemanager/README.md +11 -0
  9. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/README.md +13 -0
  10. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.dashboard-with-graphwidget-with-labels-visible.ts +92 -0
  11. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codebuild/README.md +1 -0
  12. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codebuild/integ.project-docker-server.ts +44 -0
  13. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-elastic-beanstalk-deploy.ts +22 -16
  14. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr-assets/README.md +4 -0
  15. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +2 -0
  16. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/README.md +64 -2
  17. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/README.md +3 -3
  18. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.dependencies-bun-lock.ts +50 -0
  19. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/README.md +38 -0
  20. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster.ts +1 -1
  21. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.proxy-endpoint.ts +36 -0
  22. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3/integ.bucket.notifications-scoped-permissions.ts +71 -0
  23. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-assets/integ.assets.bundling.docker-opts.ts +4 -1
  24. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.distributed-map-parallel.ts +82 -0
  25. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.distributed-map-redrive.ts +130 -0
  26. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.map-with-catch.ts +1 -0
  27. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-nodejs22.ts +27 -0
  28. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/README.md +27 -0
  29. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary-browser-type.ts +35 -0
  30. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +2 -2
  31. {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/METADATA +2 -2
  32. {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/RECORD +35 -25
  33. {konokenj_cdk_api_mcp_server-0.42.0.dist-info → konokenj_cdk_api_mcp_server-0.44.0.dist-info}/WHEEL +0 -0
  34. {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
  35. {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
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2025-present Kenji Kono <konoken@amazon.co.jp>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.42.0"
4
+ __version__ = "0.44.0"
@@ -68,7 +68,7 @@ for more granular details.
68
68
 
69
69
  ### Spark Jobs
70
70
 
71
- 1. **ETL Jobs**
71
+ #### ETL Jobs
72
72
 
73
73
  ETL jobs support pySpark and Scala languages, for which there are separate but
74
74
  similar constructors. ETL jobs default to the G2 worker type, but you can
@@ -130,7 +130,7 @@ new glue.PySparkEtlJob(stack, 'PySparkETLJob', {
130
130
  });
131
131
  ```
132
132
 
133
- **Streaming Jobs**
133
+ #### Streaming Jobs
134
134
 
135
135
  Streaming jobs are similar to ETL jobs, except that they perform ETL on data
136
136
  streams using the Apache Spark Structured Streaming framework. Some Spark
@@ -186,7 +186,7 @@ new glue.PySparkStreamingJob(stack, 'PySparkStreamingJob', {
186
186
  });
187
187
  ```
188
188
 
189
- **Flex Jobs**
189
+ #### Flex Jobs
190
190
 
191
191
  The flexible execution class is appropriate for non-urgent jobs such as
192
192
  pre-production jobs, testing, and one-time data loads. Flexible jobs default
@@ -419,14 +419,14 @@ override it if you prefer for your trigger not to start on creation.
419
419
  Reference the workflow-triggers.test.ts unit tests for examples of creating
420
420
  workflows and triggers.
421
421
 
422
- 1. **On-Demand Triggers**
422
+ #### **1. On-Demand Triggers**
423
423
 
424
424
  On-demand triggers can start glue jobs or crawlers. This construct provides
425
425
  convenience functions to create on-demand crawler or job triggers. The constructor
426
426
  takes an optional description parameter, but abstracts the requirement of an
427
427
  actions list using the job or crawler objects using conditional types.
428
428
 
429
- 1. **Scheduled Triggers**
429
+ #### **2. Scheduled Triggers**
430
430
 
431
431
  You can create scheduled triggers using cron expressions. This construct
432
432
  provides daily, weekly, and monthly convenience functions,
@@ -454,13 +454,13 @@ The trigger actions are executed when the predicateCondition is true.
454
454
  A `Connection` allows Glue jobs, crawlers and development endpoints to access
455
455
  certain types of data stores.
456
456
 
457
- ***Secrets Management
458
- **You must specify JDBC connection credentials in Secrets Manager and
457
+ * **Secrets Management**
458
+ You must specify JDBC connection credentials in Secrets Manager and
459
459
  provide the Secrets Manager Key name as a property to the job connection.
460
460
 
461
461
  * **Networking - the CDK determines the best fit subnet for Glue connection
462
- configuration
463
- **The prior version of the glue-alpha-module requires the developer to
462
+ configuration**
463
+ The prior version of the glue-alpha-module requires the developer to
464
464
  specify the subnet of the Connection when it’s defined. Now, you can still
465
465
  specify the specific subnet you want to use, but are no longer required
466
466
  to. You are only required to provide a VPC and either a public or private
@@ -150,7 +150,7 @@ new iot.AccountAuditConfiguration(this, 'AuditConfiguration', {
150
150
  checkConfiguration: {
151
151
  deviceCertificateAgeCheck: true,
152
152
  // The default value is 365 days
153
- // Valid values range from 30 days (minimum) to 3652 days (10 years, maximum)
153
+ // Valid values range from 30 days (minimum) to 3650 days (10 years, maximum)
154
154
  deviceCertificateAgeCheckDuration: Duration.days(365),
155
155
  },
156
156
  });
@@ -524,6 +524,14 @@ const arn = api.arnForExecuteApiV2('$connect', 'dev');
524
524
 
525
525
  For a detailed explanation of this function, including usage and examples, please refer to the [Generating ARN for Execute API](#generating-arn-for-execute-api) section under HTTP API.
526
526
 
527
+ To disable schema validation, set `disableSchemaValidation` to true.
528
+
529
+ ```ts
530
+ new apigwv2.WebSocketApi(this, 'api', {
531
+ disableSchemaValidation: true,
532
+ });
533
+ ```
534
+
527
535
  You can configure IP address type for the API endpoint using `ipAddressType` property.
528
536
  Valid values are `IPV4` (default) and `DUAL_STACK`.
529
537
 
@@ -8,6 +8,10 @@ const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2');
8
8
 
9
9
  new apigw.WebSocketApi(stack, 'WebSocketApi');
10
10
 
11
+ new apigw.WebSocketApi(stack, 'WebSocketApiWithProps', {
12
+ disableSchemaValidation: true,
13
+ });
14
+
11
15
  new IntegTest(app, 'web-socket-api', {
12
16
  testCases: [stack],
13
17
  });
@@ -532,6 +532,40 @@ const jobDefn = new batch.EcsJobDefinition(this, 'JobDefn', {
532
532
  });
533
533
  ```
534
534
 
535
+ ### Enable Execute Command (ECS Exec)
536
+
537
+ You can enable [ECS Exec](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) for interactive debugging and troubleshooting by setting `enableExecuteCommand` to `true`.
538
+ When enabled, you'll be able to execute commands interactively in running containers.
539
+
540
+ ```ts
541
+ const jobDefn = new batch.EcsJobDefinition(this, 'JobDefn', {
542
+ container: new batch.EcsEc2ContainerDefinition(this, 'Ec2Container', {
543
+ image: ecs.ContainerImage.fromRegistry('public.ecr.aws/amazonlinux/amazonlinux:latest'),
544
+ memory: cdk.Size.mebibytes(2048),
545
+ cpu: 256,
546
+ enableExecuteCommand: true, // Enable ECS Exec
547
+ }),
548
+ });
549
+ ```
550
+
551
+ The same functionality is available for Fargate containers:
552
+
553
+ ```ts
554
+ const jobDefn = new batch.EcsJobDefinition(this, 'JobDefn', {
555
+ container: new batch.EcsFargateContainerDefinition(this, 'FargateContainer', {
556
+ image: ecs.ContainerImage.fromRegistry('public.ecr.aws/amazonlinux/amazonlinux:latest'),
557
+ memory: cdk.Size.mebibytes(2048),
558
+ cpu: 256,
559
+ enableExecuteCommand: true, // Enable ECS Exec for Fargate
560
+ }),
561
+ });
562
+ ```
563
+
564
+ When `enableExecuteCommand` is set to `true`:
565
+
566
+ - If no `jobRole` is provided, a new IAM role will be automatically created with the required SSM permissions
567
+ - If a `jobRole` is already provided, the necessary SSM permissions will be added to the existing role
568
+
535
569
  ### Secrets
536
570
 
537
571
  You can expose SecretsManager Secret ARNs or SSM Parameters to your container as environment variables.
@@ -0,0 +1,148 @@
1
+ import * as batch from 'aws-cdk-lib/aws-batch';
2
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
3
+ import * as ecs from 'aws-cdk-lib/aws-ecs';
4
+ import * as cdk from 'aws-cdk-lib';
5
+ import { IntegTest, ExpectedResult } from '@aws-cdk/integ-tests-alpha';
6
+
7
+ class EcsExecBatchStack extends cdk.Stack {
8
+ public readonly ec2ComputeEnvironment: batch.ManagedEc2EcsComputeEnvironment;
9
+ public readonly fargateComputeEnvironment: batch.FargateComputeEnvironment;
10
+ public readonly ec2JobQueue: batch.JobQueue;
11
+ public readonly fargateJobQueue: batch.JobQueue;
12
+ public readonly ec2JobDefinition: batch.EcsJobDefinition;
13
+ public readonly fargateJobDefinition: batch.EcsJobDefinition;
14
+
15
+ constructor(scope: cdk.App, id: string, props: cdk.StackProps = {}) {
16
+ super(scope, id, props);
17
+
18
+ const vpc = new ec2.Vpc(this, 'Vpc', {
19
+ maxAzs: 2,
20
+ });
21
+
22
+ this.ec2ComputeEnvironment = new batch.ManagedEc2EcsComputeEnvironment(this, 'ComputeEnv', {
23
+ vpc,
24
+ instanceTypes: [ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.LARGE)],
25
+ minvCpus: 0,
26
+ maxvCpus: 256,
27
+ });
28
+
29
+ this.ec2JobQueue = new batch.JobQueue(this, 'JobQueue', {
30
+ computeEnvironments: [
31
+ {
32
+ order: 1,
33
+ computeEnvironment: this.ec2ComputeEnvironment,
34
+ },
35
+ ],
36
+ });
37
+
38
+ this.ec2JobDefinition = new batch.EcsJobDefinition(this, 'EcsExecEc2JobDefinition', {
39
+ jobDefinitionName: 'EcsExecEc2TestJob',
40
+ container: new batch.EcsEc2ContainerDefinition(this, 'Ec2Container', {
41
+ image: ecs.ContainerImage.fromRegistry('public.ecr.aws/amazonlinux/amazonlinux:latest'),
42
+ cpu: 2,
43
+ memory: cdk.Size.mebibytes(2048),
44
+ enableExecuteCommand: true,
45
+ command: ['sh', '-c', 'echo "Job started with ECS Exec enabled"; sleep 300'], // Keep container running
46
+ }),
47
+ });
48
+
49
+ this.fargateJobDefinition = new batch.EcsJobDefinition(this, 'EcsExecFargateJobDefinition', {
50
+ container: new batch.EcsFargateContainerDefinition(this, 'FargateContainer', {
51
+ image: ecs.ContainerImage.fromRegistry('public.ecr.aws/amazonlinux/amazonlinux:latest'),
52
+ cpu: 0.25,
53
+ memory: cdk.Size.gibibytes(1),
54
+ enableExecuteCommand: true, // Enable ECS Exec
55
+ command: ['sh', '-c', 'echo "Fargate Job started with ECS Exec enabled"; sleep 300'], // Keep container running
56
+ }),
57
+ });
58
+
59
+ // Create Fargate compute environment
60
+ this.fargateComputeEnvironment = new batch.FargateComputeEnvironment(this, 'FargateComputeEnv', {
61
+ vpc,
62
+ });
63
+
64
+ this.fargateJobQueue = new batch.JobQueue(this, 'FargateJobQueue', {
65
+ computeEnvironments: [
66
+ {
67
+ order: 1,
68
+ computeEnvironment: this.fargateComputeEnvironment,
69
+ },
70
+ ],
71
+ });
72
+ }
73
+ }
74
+
75
+ const app = new cdk.App();
76
+ const stack = new EcsExecBatchStack(app, 'EcsExecBatchStack');
77
+
78
+ const integ = new IntegTest(app, 'EcsExecBatchTest', {
79
+ testCases: [stack],
80
+ });
81
+
82
+ // Helper function to test ECS Exec for a job
83
+ function testEcsExecForJob(
84
+ jobName: string,
85
+ jobQueue: batch.JobQueue,
86
+ jobDefinition: batch.EcsJobDefinition,
87
+ computeEnvironment: batch.IManagedComputeEnvironment,
88
+ ) {
89
+ // Get cluster ARN from compute environment
90
+ const describeComputeEnv = integ.assertions.awsApiCall('Batch', 'describeComputeEnvironments', {
91
+ computeEnvironments: [computeEnvironment.computeEnvironmentArn],
92
+ });
93
+
94
+ const clusterArn = describeComputeEnv.getAttString('computeEnvironments.0.ecsClusterArn');
95
+
96
+ // Submit the job
97
+ const submitJobResult = describeComputeEnv.next(
98
+ integ.assertions.awsApiCall('Batch', 'submitJob', {
99
+ jobName,
100
+ jobQueue: jobQueue.jobQueueArn,
101
+ jobDefinition: jobDefinition.jobDefinitionArn,
102
+ }),
103
+ ).waitForAssertions();
104
+
105
+ // Get the job ID from the submit response
106
+ const jobId = submitJobResult.getAttString('jobId');
107
+
108
+ // Wait for job to reach RUNNING state and have a task ARN
109
+ const waitForJobRunning = integ.assertions.awsApiCall('Batch', 'describeJobs', {
110
+ jobs: [jobId],
111
+ }).assertAtPath('jobs.0.status', ExpectedResult.stringLikeRegexp('RUNNING'))
112
+ .waitForAssertions({
113
+ totalTimeout: cdk.Duration.minutes(10),
114
+ interval: cdk.Duration.seconds(30),
115
+ });
116
+
117
+ const taskArn = waitForJobRunning.getAttString('jobs.0.container.taskArn');
118
+
119
+ // Execute ECS command to verify ECS Exec is enabled
120
+ waitForJobRunning.next(
121
+ integ.assertions.awsApiCall('ECS', 'executeCommand', {
122
+ cluster: clusterArn,
123
+ task: taskArn,
124
+ container: 'default',
125
+ interactive: true,
126
+ command: '/bin/bash',
127
+ }).waitForAssertions({
128
+ totalTimeout: cdk.Duration.minutes(10),
129
+ interval: cdk.Duration.seconds(30),
130
+ }),
131
+ );
132
+ }
133
+
134
+ // Test EC2 job
135
+ testEcsExecForJob(
136
+ 'test-ecs-exec-ec2-job',
137
+ stack.ec2JobQueue,
138
+ stack.ec2JobDefinition,
139
+ stack.ec2ComputeEnvironment,
140
+ );
141
+
142
+ // Test Fargate job
143
+ testEcsExecForJob(
144
+ 'test-ecs-exec-fargate-job',
145
+ stack.fargateJobQueue,
146
+ stack.fargateJobDefinition,
147
+ stack.fargateComputeEnvironment,
148
+ );
@@ -146,6 +146,17 @@ new acm.PrivateCertificate(this, 'PrivateCertificate', {
146
146
  });
147
147
  ```
148
148
 
149
+ ## Requesting public SSL/TLS certificates exportable to use anywhere
150
+
151
+ AWS Certificate Manager can issue an exportable public certificate. There is a charge at certificate issuance and again when the certificate renews. See [opting out of certificate transparency logging](https://docs.aws.amazon.com/acm/latest/userguide/acm-exportable-certificates.html) for details.
152
+
153
+ ```ts
154
+ new acm.Certificate(this, 'Certificate', {
155
+ domainName: 'test.example.com',
156
+ allowExport: true,
157
+ });
158
+ ```
159
+
149
160
  ## Requesting certificates without transparency logging
150
161
 
151
162
  Transparency logging can be opted out of for AWS Certificate Manager certificates. See [opting out of certificate transparency logging](https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency) for limits.
@@ -600,6 +600,19 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({
600
600
  }));
601
601
  ```
602
602
 
603
+ The `displayLabelsOnChart` property can be set to `true` to show labels on the chart. Note that this only has an effect when the `view` property is set to `cloudwatch.GraphWidgetView.PIE`.
604
+
605
+ ```ts
606
+ declare const dashboard: cloudwatch.Dashboard;
607
+
608
+ dashboard.addWidgets(new cloudwatch.GraphWidget({
609
+ // ...
610
+
611
+ view: cloudwatch.GraphWidgetView.PIE,
612
+ displayLabelsOnChart: true,
613
+ }));
614
+ ```
615
+
603
616
  The `start` and `end` properties can be used to specify the time range for each graph widget independently from those of the dashboard.
604
617
  The parameters can be specified at `GraphWidget`, `GaugeWidget`, and `SingleValueWidget`.
605
618
 
@@ -0,0 +1,92 @@
1
+ import { App, Stack, StackProps } from 'aws-cdk-lib';
2
+ import {
3
+ Dashboard,
4
+ GraphWidget,
5
+ GraphWidgetProps,
6
+ GraphWidgetView,
7
+ Metric,
8
+ Shading,
9
+ Stats,
10
+ VerticalShading,
11
+ } from 'aws-cdk-lib/aws-cloudwatch';
12
+ import { IntegTest } from '@aws-cdk/integ-tests-alpha';
13
+
14
+ class DashboardWithGraphWidgetWithLabelsVisibleIntegrationTest extends Stack {
15
+ constructor(scope: App, id: string, props?: StackProps) {
16
+ super(scope, id, props);
17
+ const dashboard = new Dashboard(this, 'Dash');
18
+ const metrics = [
19
+ new Metric({
20
+ namespace: 'CDK/Test',
21
+ metricName: 'Metric',
22
+ label: 'Metric left 1 - p99',
23
+ statistic: Stats.p(99),
24
+ }),
25
+
26
+ new Metric({
27
+ namespace: 'CDK/Test',
28
+ metricName: 'Metric',
29
+ label: 'Metric left 2 - TC_10P_90P',
30
+ statistic: Stats.tc(10, 90),
31
+ }),
32
+
33
+ new Metric({
34
+ namespace: 'CDK/Test',
35
+ metricName: 'Metric',
36
+ label: 'Metric left 3 - TS(5%:95%)',
37
+ statistic: 'TS(5%:95%)',
38
+ }),
39
+ ];
40
+
41
+ const widgetProps: GraphWidgetProps = {
42
+ title: 'My fancy graph',
43
+ left: metrics,
44
+ right: [],
45
+ view: GraphWidgetView.PIE,
46
+ leftAnnotations: [
47
+ {
48
+ value: 10,
49
+ label: 'Left annotation',
50
+ color: '#00ff00',
51
+ fill: Shading.ABOVE,
52
+ visible: true,
53
+ },
54
+ ],
55
+ rightAnnotations: [
56
+ {
57
+ value: 20,
58
+ label: 'Right annotation',
59
+ color: '#e30d0d',
60
+ fill: Shading.BELOW,
61
+ visible: false,
62
+ },
63
+ ],
64
+ verticalAnnotations: [
65
+ {
66
+ date: '2023-08-20T00:00:00.000Z',
67
+ label: 'Vertical annotation',
68
+ color: '#2556f6',
69
+ fill: VerticalShading.AFTER,
70
+ visible: true,
71
+ },
72
+ ],
73
+ };
74
+
75
+ dashboard.addWidgets(
76
+ new GraphWidget({
77
+ ...widgetProps,
78
+ displayLabelsOnChart: true,
79
+ }),
80
+ new GraphWidget({
81
+ ...widgetProps,
82
+ displayLabelsOnChart: false,
83
+ }),
84
+ new GraphWidget(widgetProps),
85
+ );
86
+ }
87
+ }
88
+
89
+ const app = new App();
90
+ new IntegTest(app, 'cdk-integ-dashboard-with-graph-widget-with-annotations', {
91
+ testCases: [new DashboardWithGraphWidgetWithLabelsVisibleIntegrationTest(app, 'DashboardWithGraphWidgetWithLabelsVisibleIntegrationTest')],
92
+ });
@@ -376,6 +376,7 @@ can use the `environment` property to customize the build environment:
376
376
  details on how to define build images.
377
377
  * `certificate` defines the location of a PEM encoded certificate to import.
378
378
  * `computeType` defines the instance type used for the build.
379
+ * `dockerServer` defines the docker server used for the build.
379
380
  * `privileged` can be set to `true` to allow privileged access.
380
381
  * `environmentVariables` can be set at this level (and also at the project
381
382
  level).
@@ -0,0 +1,44 @@
1
+ import { App, Stack } from 'aws-cdk-lib';
2
+ import { Project, BuildSpec, DockerServerComputeType, Source, ComputeType } from 'aws-cdk-lib/aws-codebuild';
3
+ import { IntegTest } from '@aws-cdk/integ-tests-alpha';
4
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
5
+
6
+ const app = new App();
7
+ const stack = new Stack(app, 'codebuild-project-docker-server');
8
+
9
+ const vpc = new ec2.Vpc(stack, 'Vpc', { restrictDefaultSecurityGroup: false });
10
+ const sg = new ec2.SecurityGroup(stack, 'SecurityGroup', { vpc });
11
+
12
+ const project = new Project(stack, 'MyProject', {
13
+ source: Source.gitHub({
14
+ owner: 'dockersamples',
15
+ repo: 'helloworld-demo-python',
16
+ }),
17
+ buildSpec: BuildSpec.fromObject({
18
+ version: '0.2',
19
+ phases: {
20
+ build: {
21
+ commands: [
22
+ 'cd sample',
23
+ 'docker buildx build .',
24
+ ],
25
+ },
26
+ },
27
+ }),
28
+ environment: {
29
+ computeType: ComputeType.SMALL,
30
+ dockerServer: {
31
+ computeType: DockerServerComputeType.SMALL,
32
+ securityGroups: [sg],
33
+ },
34
+ },
35
+ });
36
+
37
+ const integ = new IntegTest(app, 'codebuild-project-docker-server-integ', {
38
+ testCases: [stack],
39
+ });
40
+
41
+ // Execute the `startBuild` API to confirm that the build can be done correctly.
42
+ integ.assertions.awsApiCall('CodeBuild', 'startBuild', {
43
+ projectName: project.projectName,
44
+ }).waitForAssertions();
@@ -2,11 +2,13 @@ import * as path from 'path';
2
2
  import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
3
3
  import * as elasticbeanstalk from 'aws-cdk-lib/aws-elasticbeanstalk';
4
4
  import * as iam from 'aws-cdk-lib/aws-iam';
5
+ import { IManagedPolicy, ManagedPolicyReference } from 'aws-cdk-lib/aws-iam';
5
6
  import * as s3 from 'aws-cdk-lib/aws-s3';
6
7
  import * as deploy from 'aws-cdk-lib/aws-s3-deployment';
7
- import { App, Fn, RemovalPolicy, Stack } from 'aws-cdk-lib';
8
+ import { App, Fn, RemovalPolicy, Stack, UnscopedValidationError } from 'aws-cdk-lib';
8
9
  import * as integ from '@aws-cdk/integ-tests-alpha';
9
10
  import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
11
+ import { Node } from 'constructs';
10
12
 
11
13
  /**
12
14
  * To validate that the deployment actually succeeds, perform the following actions:
@@ -43,16 +45,26 @@ const artifact = new deploy.BucketDeployment(stack, 'DeployApp', {
43
45
  extract: false,
44
46
  });
45
47
 
48
+ function makePolicy(arn: string): IManagedPolicy {
49
+ return {
50
+ managedPolicyArn: arn,
51
+ get managedPolicyRef(): ManagedPolicyReference {
52
+ return {
53
+ policyArn: this.managedPolicyArn,
54
+ };
55
+ },
56
+ get node(): Node {
57
+ throw new UnscopedValidationError('The result of fromAwsManagedPolicyName can not be used in this API');
58
+ },
59
+ };
60
+ }
61
+
46
62
  const serviceRole = new iam.Role(stack, 'service-role', {
47
63
  roleName: 'codepipeline-elasticbeanstalk-action-test-serivce-role',
48
64
  assumedBy: new iam.ServicePrincipal('elasticbeanstalk.amazonaws.com'),
49
65
  managedPolicies: [
50
- {
51
- managedPolicyArn: 'arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkEnhancedHealth',
52
- },
53
- {
54
- managedPolicyArn: 'arn:aws:iam::aws:policy/AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy',
55
- },
66
+ makePolicy('arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkEnhancedHealth'),
67
+ makePolicy('arn:aws:iam::aws:policy/AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy'),
56
68
  ],
57
69
  });
58
70
 
@@ -60,15 +72,9 @@ const instanceProfileRole = new iam.Role(stack, 'instance-profile-role', {
60
72
  roleName: 'codepipeline-elasticbeanstalk-action-test-instance-profile-role',
61
73
  assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'),
62
74
  managedPolicies: [
63
- {
64
- managedPolicyArn: 'arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier',
65
- },
66
- {
67
- managedPolicyArn: 'arn:aws:iam::aws:policy/AWSElasticBeanstalkMulticontainerDocker',
68
- },
69
- {
70
- managedPolicyArn: 'arn:aws:iam::aws:policy/AWSElasticBeanstalkWorkerTier',
71
- },
75
+ makePolicy('arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier'),
76
+ makePolicy('arn:aws:iam::aws:policy/AWSElasticBeanstalkMulticontainerDocker'),
77
+ makePolicy('arn:aws:iam::aws:policy/AWSElasticBeanstalkWorkerTier'),
72
78
  ],
73
79
  });
74
80
 
@@ -163,6 +163,10 @@ This will instruct the toolkit to add the tarball as a file asset. During deploy
163
163
  from `local-image.tar`, push it to an Amazon ECR repository and wire the name of the repository as CloudFormation parameters
164
164
  to your stack.
165
165
 
166
+ Similar to `DockerImageAsset`, you can set the `CDK_DOCKER` environment variable to provide a custom Docker executable
167
+ command or path. This may be needed when building in environments where the standard docker cannot be executed or when
168
+ using alternative container runtimes like Finch.
169
+
166
170
  ## Publishing images to ECR repositories
167
171
 
168
172
  `DockerImageAsset` is designed for seamless build & consumption of image assets by CDK code deployed to multiple environments
@@ -1591,6 +1591,8 @@ it in the constructor. Then add the Capacity Provider to the cluster. Finally,
1591
1591
  you can refer to the Provider by its name in your service's or task's Capacity
1592
1592
  Provider strategy.
1593
1593
 
1594
+ > **Note**: Cross-stack capacity provider registration is not supported. The ECS cluster and its capacity providers must be created in the same stack to avoid circular dependency issues.
1595
+
1594
1596
  By default, Auto Scaling Group Capacity Providers will manage the scale-in and
1595
1597
  scale-out behavior of the auto scaling group based on the load your tasks put on
1596
1598
  the cluster, this is called [Managed Scaling](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html#asg-capacity-providers-managed-scaling). If you'd
@@ -15,6 +15,7 @@ Currently supported are:
15
15
  - [Start a StepFunctions state machine](#start-a-stepfunctions-state-machine)
16
16
  - [Queue a Batch job](#queue-a-batch-job)
17
17
  - [Invoke an API Gateway REST API](#invoke-an-api-gateway-rest-api)
18
+ - [Invoke an AWS API](#invoke-an-aws-api)
18
19
  - [Invoke an API Destination](#invoke-an-api-destination)
19
20
  - [Invoke an AppSync GraphQL API](#invoke-an-appsync-graphql-api)
20
21
  - [Put an event on an EventBridge bus](#put-an-event-on-an-eventbridge-bus)
@@ -333,6 +334,67 @@ declare const rule: events.Rule;
333
334
  rule.addTarget(new targets.ApiGatewayV2(httpApi));
334
335
  ```
335
336
 
337
+ ## Invoke an AWS API
338
+
339
+ Use the `AwsApi` target to make direct AWS API calls from EventBridge rules. This is useful for invoking AWS services that don't have a dedicated EventBridge target.
340
+
341
+ ### Basic Usage
342
+
343
+ The following example shows how to update an ECS service when a rule is triggered:
344
+
345
+ ```ts
346
+ const rule = new events.Rule(this, 'Rule', {
347
+ schedule: events.Schedule.rate(Duration.hours(1)),
348
+ });
349
+
350
+ rule.addTarget(new targets.AwsApi({
351
+ service: 'ECS',
352
+ action: 'updateService',
353
+ parameters: {
354
+ service: 'my-service',
355
+ forceNewDeployment: true,
356
+ },
357
+ }));
358
+ ```
359
+
360
+ ### IAM Permissions
361
+
362
+ By default, the AwsApi target automatically creates the necessary IAM permissions based on the service and action you specify. The permission format follows the pattern: `service:Action`.
363
+
364
+ For example:
365
+
366
+ - `ECS` service with `updateService` action → `ecs:UpdateService` permission
367
+ - `RDS` service with `createDBSnapshot` action → `rds:CreateDBSnapshot` permission
368
+
369
+ ### Custom IAM Policy
370
+
371
+ In some cases, you may need to provide a custom IAM policy statement, especially when:
372
+
373
+ - You need to restrict permissions to specific resources (instead of `*`)
374
+ - The service requires additional permissions beyond the main action
375
+ - You want more granular control over the permissions
376
+
377
+ ```ts
378
+ import * as iam from 'aws-cdk-lib/aws-iam';
379
+ import * as s3 from 'aws-cdk-lib/aws-s3';
380
+
381
+ declare const rule: events.Rule;
382
+ declare const bucket: s3.Bucket;
383
+
384
+ rule.addTarget(new targets.AwsApi({
385
+ service: 's3',
386
+ action: 'GetBucketEncryption',
387
+ parameters: {
388
+ Bucket: bucket.bucketName,
389
+ },
390
+ policyStatement: new iam.PolicyStatement({
391
+ effect: iam.Effect.ALLOW,
392
+ actions: ['s3:GetEncryptionConfiguration'],
393
+ resources: [bucket.bucketArn],
394
+ }),
395
+ }));
396
+ ```
397
+
336
398
  ## Invoke an API Destination
337
399
 
338
400
  Use the `targets.ApiDestination` target to trigger an external API. You need to
@@ -636,7 +698,7 @@ rule.addTarget(new targets.RedshiftQuery(workgroup.attrWorkgroupWorkgroupArn, {
636
698
 
637
699
  ## Publish to an SNS Topic
638
700
 
639
- Use the `SnsTopic` target to publish to an SNS Topic.
701
+ Use the `SnsTopic` target to publish to an SNS Topic.
640
702
 
641
703
  The code snippet below creates the scheduled event rule that publishes to an SNS Topic using a resource policy.
642
704
 
@@ -664,4 +726,4 @@ const rule = new events.Rule(this, 'Rule', {
664
726
  });
665
727
 
666
728
  rule.addTarget(new targets.SnsTopic(topic, { authorizeUsingRole: true }));
667
- ```
729
+ ```