konokenj.cdk-api-mcp-server 0.28.0__py3-none-any.whl → 0.30.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 (45) 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 +71 -0
  3. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/integ-tests-alpha/README.md +1 -1
  4. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api-dualstack.ts +4 -3
  5. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api.ts +4 -2
  6. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.stage.ts +20 -7
  7. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.iam.ts +38 -34
  8. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.sqs.ts +71 -58
  9. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-backup/README.md +2 -0
  10. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-backup/integ.backup.ts +12 -1
  11. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront/README.md +18 -1
  12. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/README.md +32 -0
  13. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.alarm-and-dashboard.ts +1 -0
  14. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.math-alarm-and-dashboard.ts +4 -0
  15. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-config.ts +4 -15
  16. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-group.ts +218 -40
  17. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-elastic-beanstalk-deploy.ts +1 -1
  18. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/README.md +13 -0
  19. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.client-vpn-endpoint-client-route-enforcement.ts +68 -0
  20. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/README.md +83 -83
  21. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-al2023-nodegroup.ts +1 -2
  22. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.fargate-cluster.ts +1 -3
  23. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.helm-chart-logging.ts +55 -0
  24. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kms/README.md +4 -3
  25. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kms/integ.alias-from-alias-name.ts +26 -0
  26. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/README.md +15 -0
  27. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.log-retention.ts +8 -2
  28. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-event-sources/README.md +68 -0
  29. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-event-sources/integ.kafka-schema-registry.ts +186 -0
  30. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/README.md +23 -13
  31. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-snapshot.ts +3 -71
  32. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.instance-engine-lifecycle-support.ts +53 -0
  33. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3/README.md +16 -0
  34. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-notifications/integ.bucket-notifications.ts +42 -80
  35. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.call-aws-service-cross-region-lambda.ts +97 -0
  36. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.start-job-run.ts +51 -106
  37. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +21 -0
  38. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/README.md +14 -0
  39. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/pipelines/README.md +7 -1
  40. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/pipelines/integ.newpipeline-single-publisher.ts +53 -0
  41. {konokenj_cdk_api_mcp_server-0.28.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/METADATA +2 -2
  42. {konokenj_cdk_api_mcp_server-0.28.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/RECORD +45 -38
  43. {konokenj_cdk_api_mcp_server-0.28.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/WHEEL +0 -0
  44. {konokenj_cdk_api_mcp_server-0.28.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/entry_points.txt +0 -0
  45. {konokenj_cdk_api_mcp_server-0.28.0.dist-info → konokenj_cdk_api_mcp_server-0.30.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.28.0"
4
+ __version__ = "0.30.0"
@@ -238,6 +238,68 @@ const amplifyApp = new amplify.App(this, 'App', {
238
238
  });
239
239
  ```
240
240
 
241
+ If the app uses a monorepo structure, define which appRoot from the build spec the custom response headers should apply to by using the `appRoot` property:
242
+
243
+ ```ts
244
+ import * as codebuild from 'aws-cdk-lib/aws-codebuild';
245
+
246
+ const amplifyApp = new amplify.App(this, 'App', {
247
+ sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
248
+ owner: '<user>',
249
+ repository: '<repo>',
250
+ oauthToken: SecretValue.secretsManager('my-github-token'),
251
+ }),
252
+ buildSpec: codebuild.BuildSpec.fromObjectToYaml({
253
+ version: '1.0',
254
+ applications: [
255
+ {
256
+ appRoot: 'frontend',
257
+ frontend: {
258
+ phases: {
259
+ preBuild: {
260
+ commands: ['npm install'],
261
+ },
262
+ build: {
263
+ commands: ['npm run build'],
264
+ },
265
+ },
266
+ },
267
+ },
268
+ {
269
+ appRoot: 'backend',
270
+ backend: {
271
+ phases: {
272
+ preBuild: {
273
+ commands: ['npm install'],
274
+ },
275
+ build: {
276
+ commands: ['npm run build'],
277
+ },
278
+ },
279
+ },
280
+ },
281
+ ],
282
+ }),
283
+ customResponseHeaders: [
284
+ {
285
+ appRoot: 'frontend',
286
+ pattern: '*.json',
287
+ headers: {
288
+ 'custom-header-name-1': 'custom-header-value-1',
289
+ 'custom-header-name-2': 'custom-header-value-2',
290
+ },
291
+ },
292
+ {
293
+ appRoot: 'backend',
294
+ pattern: '/path/*',
295
+ headers: {
296
+ 'custom-header-name-1': 'custom-header-value-2',
297
+ },
298
+ },
299
+ ],
300
+ });
301
+ ```
302
+
241
303
  ## Configure server side rendering when hosting app
242
304
 
243
305
  Setting the `platform` field on the Amplify `App` construct can be used to control whether the app will host only static assets or server side rendered assets in addition to static. By default, the value is set to `WEB` (static only), however, server side rendering can be turned on by setting to `WEB_COMPUTE` as follows:
@@ -268,6 +330,15 @@ const amplifyApp = new amplify.App(this, 'MyApp', {
268
330
  });
269
331
  ```
270
332
 
333
+ It is also possible to override the compute role for a specific branch by setting `computeRole` in `Branch`:
334
+
335
+ ```ts
336
+ declare const computeRole: iam.Role;
337
+ declare const amplifyApp: amplify.App
338
+
339
+ const branch = amplifyApp.addBranch("dev", { computeRole });
340
+ ```
341
+
271
342
  ## Cache Config
272
343
 
273
344
  Amplify uses Amazon CloudFront to manage the caching configuration for your hosted applications. A cache configuration is applied to each app to optimize for the best performance.
@@ -18,7 +18,7 @@
18
18
 
19
19
  ## Overview
20
20
 
21
- This library is meant to be used in combination with the [integ-runner](https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-runner) CLI
21
+ This library is meant to be used in combination with the [integ-runner](https://github.com/aws/aws-cdk-cli/tree/main/packages/%40aws-cdk/integ-runner) CLI
22
22
  to enable users to write and execute integration tests for AWS CDK Constructs.
23
23
 
24
24
  An integration test should be defined as a CDK application, and
@@ -4,13 +4,14 @@ import * as cdk from 'aws-cdk-lib';
4
4
  import * as apigw from 'aws-cdk-lib/aws-apigatewayv2';
5
5
 
6
6
  const app = new cdk.App();
7
- const stack = new cdk.Stack(app, 'DualStackWebsocketApiStack');
7
+ const stack = new cdk.Stack(app, 'DualStackHttpApiStack');
8
8
 
9
- new apigw.WebSocketApi(stack, 'WebSocketApi', {
9
+ new apigw.HttpApi(stack, 'HttpApi', {
10
+ routeSelectionExpression: true,
10
11
  ipAddressType: apigw.IpAddressType.DUAL_STACK,
11
12
  });
12
13
 
13
- new IntegTest(app, 'DualStackWebsocketApiInteg', {
14
+ new IntegTest(app, 'DualStackHttpApiInteg', {
14
15
  testCases: [stack],
15
16
  });
16
17
 
@@ -6,9 +6,11 @@ import * as apigw from 'aws-cdk-lib/aws-apigatewayv2';
6
6
  const app = new cdk.App();
7
7
  const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2');
8
8
 
9
- new apigw.WebSocketApi(stack, 'WebSocketApi');
9
+ new apigw.HttpApi(stack, 'HttpApi', {
10
+ routeSelectionExpression: true,
11
+ });
10
12
 
11
- new IntegTest(app, 'web-socket-api', {
13
+ new IntegTest(app, 'http-api', {
12
14
  testCases: [stack],
13
15
  });
14
16
 
@@ -1,20 +1,33 @@
1
1
  #!/usr/bin/env node
2
+ import { IntegTest } from '@aws-cdk/integ-tests-alpha';
2
3
  import * as cdk from 'aws-cdk-lib';
3
- import * as apigw from 'aws-cdk-lib/aws-apigatewayv2';
4
+ import * as apigwv2 from 'aws-cdk-lib/aws-apigatewayv2';
5
+ import * as apigw from 'aws-cdk-lib/aws-apigateway';
6
+ import * as logs from 'aws-cdk-lib/aws-logs';
4
7
 
5
8
  const app = new cdk.App();
6
- const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-websocket-stage');
9
+ const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-http-stage');
7
10
 
8
- const webSocketApi = new apigw.WebSocketApi(stack, 'WebSocketApi');
9
- new apigw.WebSocketStage(stack, 'WebSocketStage', {
10
- webSocketApi,
11
- stageName: 'dev',
11
+ const testLogGroup = new logs.LogGroup(stack, 'MyLogGroup');
12
+
13
+ const httpApi = new apigwv2.HttpApi(stack, 'HttpApi', { createDefaultStage: false });
14
+ new apigwv2.HttpStage(stack, 'HttpStageWithProperties', {
15
+ httpApi,
12
16
  throttle: {
13
17
  rateLimit: 1000,
14
18
  burstLimit: 1000,
15
19
  },
16
20
  detailedMetricsEnabled: true,
17
21
  description: 'My Stage',
22
+ accessLogSettings: {
23
+ destination: new apigwv2.LogGroupLogDestination(testLogGroup),
24
+ format: apigw.AccessLogFormat.custom(JSON.stringify({
25
+ extendedRequestId: apigw.AccessLogField.contextExtendedRequestId(),
26
+ requestTime: apigw.AccessLogField.contextRequestTime(),
27
+ })),
28
+ },
18
29
  });
19
30
 
20
- app.synth();
31
+ new IntegTest(app, 'aws-cdk-aws-apigatewayv2-http-stage-test', {
32
+ testCases: [stack],
33
+ });
@@ -1,53 +1,46 @@
1
1
  import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
2
- import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
3
2
  import * as iam from 'aws-cdk-lib/aws-iam';
4
- import { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda';
5
3
  import * as cdk from 'aws-cdk-lib';
6
- import { Stack } from 'aws-cdk-lib';
7
- import * as integ from '@aws-cdk/integ-tests-alpha';
8
- import { WebSocketIamAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
4
+ import { HttpIamAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
9
5
 
10
- const app = new cdk.App({
11
- postCliContext: {
12
- '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
13
- },
14
- });
6
+ class ExampleComIntegration extends apigatewayv2.HttpRouteIntegration {
7
+ public bind(): apigatewayv2.HttpRouteIntegrationConfig {
8
+ return {
9
+ type: apigatewayv2.HttpIntegrationType.HTTP_PROXY,
10
+ payloadFormatVersion: apigatewayv2.PayloadFormatVersion.VERSION_1_0,
11
+ method: apigatewayv2.HttpMethod.GET,
12
+ uri: 'https://www.example.com/',
13
+ };
14
+ }
15
+ }
16
+
17
+ const app = new cdk.App();
15
18
  const stack = new cdk.Stack(app, 'IntegApiGatewayV2Iam');
16
19
  const user = new iam.User(stack, 'User');
17
20
  const userAccessKey = new iam.AccessKey(stack, 'UserAccess', {
18
21
  user,
19
22
  });
20
23
 
21
- const handler = new Function(stack, 'auth-function', {
22
- runtime: Runtime.NODEJS_18_X,
23
- code: Code.fromInline('exports.handler = () => {return true}'),
24
- handler: 'index.handler',
24
+ const httpApi = new apigatewayv2.HttpApi(stack, 'HttpApi', {
25
+ defaultAuthorizer: new HttpIamAuthorizer(),
25
26
  });
26
27
 
27
- const webSocketApi = new apigatewayv2.WebSocketApi(stack, 'WebSocketApi', {
28
- connectRouteOptions: {
29
- integration: new WebSocketLambdaIntegration('WebSocketLambdaIntegration', handler),
30
- authorizer: new WebSocketIamAuthorizer(),
31
- },
28
+ const [fooRoute] = httpApi.addRoutes({
29
+ integration: new ExampleComIntegration('examplecom'),
30
+ path: '/foo',
32
31
  });
33
32
 
34
- const arn = Stack.of(stack).formatArn({
35
- service: 'execute-api',
36
- resource: webSocketApi.apiId,
33
+ fooRoute.grantInvoke(user);
34
+
35
+ const [booksRoute] = httpApi.addRoutes({
36
+ integration: new ExampleComIntegration('examplecom'),
37
+ path: '/books/{book}',
37
38
  });
38
39
 
39
- user.attachInlinePolicy(new iam.Policy(stack, 'AllowInvoke', {
40
- statements: [
41
- new iam.PolicyStatement({
42
- actions: ['execute-api:Invoke'],
43
- effect: iam.Effect.ALLOW,
44
- resources: [arn],
45
- }),
46
- ],
47
- }));
40
+ booksRoute.grantInvoke(user);
48
41
 
49
- new integ.IntegTest(app, 'ApiGatewayV2WebSocketIamTest', {
50
- testCases: [stack],
42
+ new cdk.CfnOutput(stack, 'API', {
43
+ value: httpApi.url!,
51
44
  });
52
45
 
53
46
  new cdk.CfnOutput(stack, 'TESTACCESSKEYID', {
@@ -62,4 +55,15 @@ new cdk.CfnOutput(stack, 'TESTREGION', {
62
55
  value: stack.region,
63
56
  });
64
57
 
65
- app.synth();
58
+ /*
59
+ * Stack verification steps:
60
+ * * Get cURL version 7.75.0 or later so you can use the --aws-sigv4 option
61
+ * * Curl <url>/foo without sigv4 and expect a 403
62
+ * * Curl <url>/books/something without sigv4 and expect a 403
63
+ * * Curl <url>/foo with sigv4 from the authorized user and expect 200
64
+ * * Curl <url>/books/something with sigv4 from the authorized user and expect 200
65
+ *
66
+ * Reference:
67
+ * * Using cURL 7.75.0 or later via the official docker image: docker run --rm curlimages/curl -s -o/dev/null -w"%{http_code}" <url>
68
+ * * Args to enable sigv4 with authorized credentials: --user "$TESTACCESSKEYID:$TESTSECRETACCESSKEY" --aws-sigv4 "aws:amz:$TESTREGION:execute-api"
69
+ */
@@ -1,72 +1,85 @@
1
- import { HttpMethod, PassthroughBehavior, WebSocketApi, WebSocketStage } from 'aws-cdk-lib/aws-apigatewayv2';
1
+ import * as apigwv2 from 'aws-cdk-lib/aws-apigatewayv2';
2
2
  import * as sqs from 'aws-cdk-lib/aws-sqs';
3
- import * as iam from 'aws-cdk-lib/aws-iam';
4
- import { App, Stack, Aws } from 'aws-cdk-lib';
5
- import { WebSocketAwsIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
6
- import { IntegTest } from '@aws-cdk/integ-tests-alpha';
7
-
8
- /*
9
- * Stack verification steps:
10
- * 1. Verify manually that the integration has type "AWS"
11
- */
3
+ import { App, Stack } from 'aws-cdk-lib';
4
+ import { HttpSqsIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
5
+ import * as integ from '@aws-cdk/integ-tests-alpha';
12
6
 
13
7
  const app = new App();
14
- const stack = new Stack(app, 'integ-aws-websocket-sqs-integration');
8
+ const stack = new Stack(app, 'sqs-integration');
15
9
 
16
- const sqsMessageQueue = new sqs.Queue(stack, 'MessageSQSQueue', {
17
- fifo: true,
18
- queueName: 'MessageSQSQueue.fifo',
19
- });
10
+ const queue = new sqs.Queue(stack, 'Queue');
20
11
 
21
- // API Gateway WebSocket API
22
- const webSocketApi = new WebSocketApi(stack, 'webSocketApi', {
23
- description: 'Send websocket data to SQS which is then processed by a Lambda 2',
24
- routeSelectionExpression: '$request.body.action',
12
+ const httpApi = new apigwv2.HttpApi(stack, 'Api');
13
+ httpApi.addRoutes({
14
+ path: '/default',
15
+ methods: [apigwv2.HttpMethod.POST],
16
+ integration: new HttpSqsIntegration('defaultIntegration', {
17
+ queue,
18
+ }),
25
19
  });
26
-
27
- // Optionally, create a WebSocket stage
28
- new WebSocketStage(stack, 'DevStage', {
29
- webSocketApi: webSocketApi,
30
- stageName: 'dev',
31
- autoDeploy: true,
20
+ httpApi.addRoutes({
21
+ path: '/send-message',
22
+ methods: [apigwv2.HttpMethod.POST],
23
+ integration: new HttpSqsIntegration('sendMessageIntegration', {
24
+ queue,
25
+ subtype: apigwv2.HttpIntegrationSubtype.SQS_SEND_MESSAGE,
26
+ }),
32
27
  });
33
-
34
- // IAM Role for API Gateway
35
- const webSocketApiRole = new iam.Role(stack, 'webSocketApiRole', {
36
- assumedBy: new iam.ServicePrincipal('apigateway.amazonaws.com'),
28
+ httpApi.addRoutes({
29
+ path: '/receive-message',
30
+ methods: [apigwv2.HttpMethod.POST],
31
+ integration: new HttpSqsIntegration('receiveMessageIntegration', {
32
+ queue,
33
+ subtype: apigwv2.HttpIntegrationSubtype.SQS_RECEIVE_MESSAGE,
34
+ }),
37
35
  });
38
-
39
- webSocketApiRole.addToPolicy(
40
- new iam.PolicyStatement({
41
- actions: ['sqs:SendMessage'],
42
- effect: iam.Effect.ALLOW,
43
- resources: [sqsMessageQueue.queueArn],
36
+ httpApi.addRoutes({
37
+ path: '/delete-message',
38
+ methods: [apigwv2.HttpMethod.POST],
39
+ integration: new HttpSqsIntegration('deleteMessageIntegration', {
40
+ queue,
41
+ subtype: apigwv2.HttpIntegrationSubtype.SQS_DELETE_MESSAGE,
44
42
  }),
45
- );
46
-
47
- webSocketApi.addRoute('$default', {
48
- integration: new WebSocketAwsIntegration('SQSSendMessage', {
49
- integrationUri: `arn:aws:apigateway:${Aws.REGION}:sqs:path/${Aws.ACCOUNT_ID}/${sqsMessageQueue.queueName}`,
50
- integrationMethod: HttpMethod.POST,
51
- credentialsRole: webSocketApiRole,
52
- passthroughBehavior: PassthroughBehavior.NEVER,
53
- templateSelectionExpression: '\\$default',
54
- requestTemplates: {
55
- $default: 'Action=SendMessage&MessageGroupId=$input.path(\'$.MessageGroupId\')&MessageDeduplicationId=$context.requestId&MessageAttribute.1.Name=connectionId&MessageAttribute.1.Value.StringValue=$context.connectionId&MessageAttribute.1.Value.DataType=String&MessageAttribute.2.Name=requestId&MessageAttribute.2.Value.StringValue=$context.requestId&MessageAttribute.2.Value.DataType=String&MessageBody=$input.json(\'$\')',
56
- },
57
- requestParameters: {
58
- 'integration.request.header.Content-Type': '\'application/x-www-form-urlencoded\'',
59
- },
43
+ });
44
+ httpApi.addRoutes({
45
+ path: '/purge-queue',
46
+ methods: [apigwv2.HttpMethod.POST],
47
+ integration: new HttpSqsIntegration('purgeQueueIntegration', {
48
+ queue,
49
+ subtype: apigwv2.HttpIntegrationSubtype.SQS_PURGE_QUEUE,
60
50
  }),
61
51
  });
62
52
 
63
- new IntegTest(app, 'apigatewayv2-aws-integration-sqs-integ-test', {
53
+ const integTest = new integ.IntegTest(app, 'SqsIntegrationIntegTest', {
64
54
  testCases: [stack],
65
- cdkCommandOptions: {
66
- deploy: {
67
- args: {
68
- rollback: true,
69
- },
70
- },
71
- },
72
55
  });
56
+
57
+ const defaultAssertion = integTest.assertions.httpApiCall(
58
+ `${httpApi.apiEndpoint}/default`, {
59
+ body: JSON.stringify({ MessageBody: 'Hello World!' }),
60
+ method: 'POST',
61
+ },
62
+ );
63
+ defaultAssertion.expect(integ.ExpectedResult.objectLike({ status: 200, statusText: 'OK' }));
64
+
65
+ const sendMessageAssertion = integTest.assertions.httpApiCall(
66
+ `${httpApi.apiEndpoint}/send-message`, {
67
+ body: JSON.stringify({ MessageBody: 'Hello World!' }),
68
+ method: 'POST',
69
+ },
70
+ );
71
+ sendMessageAssertion.expect(integ.ExpectedResult.objectLike({ status: 200, statusText: 'OK' }));
72
+
73
+ const receiveMessageAssertion = integTest.assertions.httpApiCall(
74
+ `${httpApi.apiEndpoint}/receive-message`, {
75
+ method: 'POST',
76
+ },
77
+ );
78
+ receiveMessageAssertion.expect(integ.ExpectedResult.objectLike({ status: 200, statusText: 'OK' }));
79
+
80
+ const purgeQueueAssertion = integTest.assertions.httpApiCall(
81
+ `${httpApi.apiEndpoint}/purge-queue`, {
82
+ method: 'POST',
83
+ },
84
+ );
85
+ purgeQueueAssertion.expect(integ.ExpectedResult.objectLike({ status: 200, statusText: 'OK' }));
@@ -84,6 +84,7 @@ plan.addSelection('Selection', {
84
84
  To add rules to a plan, use `addRule()`:
85
85
 
86
86
  ```ts
87
+ import { TimeZone } from 'aws-cdk-lib';
87
88
  declare const plan: backup.BackupPlan;
88
89
  plan.addRule(new backup.BackupPlanRule({
89
90
  completionWindow: Duration.hours(2),
@@ -93,6 +94,7 @@ plan.addRule(new backup.BackupPlanRule({
93
94
  hour: '3',
94
95
  minute: '30',
95
96
  }),
97
+ scheduleExpressionTimezone: TimeZone.ETC_UTC,
96
98
  moveToColdStorageAfter: Duration.days(30),
97
99
  }));
98
100
  ```
@@ -1,6 +1,7 @@
1
1
  import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
2
2
  import * as efs from 'aws-cdk-lib/aws-efs';
3
- import { App, Duration, RemovalPolicy, Stack, StackProps, CfnParameter } from 'aws-cdk-lib';
3
+ import * as events from 'aws-cdk-lib/aws-events';
4
+ import { App, Duration, RemovalPolicy, Stack, StackProps, CfnParameter, TimeZone } from 'aws-cdk-lib';
4
5
  import { Construct } from 'constructs';
5
6
  import * as backup from 'aws-cdk-lib/aws-backup';
6
7
 
@@ -61,6 +62,16 @@ class TestStack extends Stack {
61
62
  stage: 'prod',
62
63
  },
63
64
  }));
65
+
66
+ plan.addRule(new backup.BackupPlanRule({
67
+ backupVault: vault,
68
+ scheduleExpression: events.Schedule.cron({
69
+ day: '15',
70
+ hour: '3',
71
+ minute: '30',
72
+ }),
73
+ scheduleExpressionTimezone: TimeZone.ETC_UTC,
74
+ }));
64
75
  }
65
76
  }
66
77
 
@@ -1252,7 +1252,24 @@ When using a CloudFront PublicKey, only the `comment` field can be updated after
1252
1252
  Resource handler returned message: "Invalid request provided: AWS::CloudFront::PublicKey"
1253
1253
  ```
1254
1254
 
1255
- To update the `encodedKey`, you must change the logical ID of the public key resource in your template. This causes CloudFormation to create a new `cloudfront.PublicKey` resource and delete the old one during the next deployment.
1255
+ To update the `encodedKey`, you must change the ID of the public key resource in your template. This causes CloudFormation to create a new `cloudfront.PublicKey` resource and delete the old one during the next deployment.
1256
+
1257
+ Example:
1258
+
1259
+ ```ts
1260
+ // Step 1: Original deployment
1261
+ const originalKey = new cloudfront.PublicKey(this, 'MyPublicKeyV1', {
1262
+ encodedKey: '...', // contents of original public_key.pem file
1263
+ });
1264
+ ```
1265
+
1266
+ Regenerate a new key and change the construct id in the code:
1267
+ ```ts
1268
+ // Step 2: In a subsequent deployment, create a new key with a different ID
1269
+ const updatedKey = new cloudfront.PublicKey(this, 'MyPublicKeyV2', {
1270
+ encodedKey: '...', // contents of new public_key.pem file
1271
+ });
1272
+ ```
1256
1273
 
1257
1274
 
1258
1275
  See:
@@ -959,3 +959,35 @@ const dashboard = new cw.Dashboard(this, 'Dash', {
959
959
  ```
960
960
 
961
961
  You can add a variable after object instantiation with the method `dashboard.addVariable()`.
962
+
963
+ ### Cross-Account Visibility
964
+
965
+ Both Log and Metric Widget objects support cross-account visibility by allowing you to specify the AWS Account ID that the data (logs or metrics) originates from.
966
+
967
+ **Prerequisites:**
968
+ 1. The monitoring account must be set up as a monitoring account
969
+ 2. The source account must grant permissions to the monitoring account
970
+ 3. Appropriate IAM roles and policies must be configured
971
+
972
+ For detailed setup instructions, see [Cross-Account Cross-Region CloudWatch Console](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html).
973
+
974
+
975
+ To use this feature, you can set the `accountId` property on `LogQueryWidget`, `GraphWidget`, `AlarmWidget`, `SingleValueWidget`, and `GaugeWidget` constructs:
976
+
977
+ ```ts
978
+ declare const dashboard: cloudwatch.Dashboard;
979
+
980
+ dashboard.addWidgets(new cloudwatch.GraphWidget({
981
+ // ...
982
+ accountId: '123456789012',
983
+ }));
984
+
985
+ dashboard.addWidgets(new cloudwatch.LogQueryWidget({
986
+ logGroupNames: ['my-log-group'],
987
+ // ...
988
+ accountId: '123456789012',
989
+ queryLines: [
990
+ 'fields @message',
991
+ ],
992
+ }));
993
+ ```
@@ -92,6 +92,7 @@ dashboard.addWidgets(new cloudwatch.LogQueryWidget({
92
92
  logGroupNames: ['my-log-group'],
93
93
  queryString: `fields @message
94
94
  | filter @message like /Error/`,
95
+ accountId: '123456789012',
95
96
  }));
96
97
  dashboard.addWidgets(new cloudwatch.SingleValueWidget({
97
98
  title: 'Sent message size',
@@ -51,6 +51,7 @@ const dashboard = new cloudwatch.Dashboard(stack, 'Dash', {
51
51
  dashboard.addWidgets(new cloudwatch.AlarmWidget({
52
52
  title: 'Total messages in queue',
53
53
  alarm,
54
+ accountId: '123456789012',
54
55
  }));
55
56
 
56
57
  dashboard.addWidgets(new cloudwatch.GraphWidget({
@@ -58,18 +59,21 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({
58
59
  left: [sumExpression],
59
60
  right: [metricA, metricB],
60
61
  leftAnnotations: [alarm.toAnnotation()],
62
+ accountId: '123456789012',
61
63
  }));
62
64
 
63
65
  dashboard.addWidgets(new cloudwatch.GraphWidget({
64
66
  title: 'Percentage of messages in each queue as pie chart',
65
67
  left: [metricA, metricB],
66
68
  view: cloudwatch.GraphWidgetView.PIE,
69
+ accountId: '123456789012',
67
70
  setPeriodToTimeRange: true,
68
71
  }));
69
72
 
70
73
  dashboard.addWidgets(new cloudwatch.SingleValueWidget({
71
74
  title: 'Current total messages in queue',
72
75
  metrics: [sumExpression],
76
+ accountId: '123456789012',
73
77
  }));
74
78
 
75
79
  new IntegTest(app, 'cdk-integ-math-alarm-and-dashboard', {
@@ -2,28 +2,17 @@ import * as cdk from 'aws-cdk-lib';
2
2
  import * as integ from '@aws-cdk/integ-tests-alpha';
3
3
  import * as codedeploy from 'aws-cdk-lib/aws-codedeploy';
4
4
 
5
- const app = new cdk.App({
6
- postCliContext: {
7
- '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
8
- },
9
- });
10
- const stack = new cdk.Stack(app, 'aws-cdk-codedeploy-lambda-config');
5
+ const app = new cdk.App();
6
+ const stack = new cdk.Stack(app, 'aws-cdk-codedeploy-ecs-config');
11
7
 
12
- new codedeploy.LambdaDeploymentConfig(stack, 'LinearConfig', {
8
+ new codedeploy.EcsDeploymentConfig(stack, 'LinearConfig', {
13
9
  trafficRouting: codedeploy.TrafficRouting.timeBasedLinear({
14
10
  interval: cdk.Duration.minutes(1),
15
11
  percentage: 5,
16
12
  }),
17
13
  });
18
14
 
19
- new codedeploy.CustomLambdaDeploymentConfig(stack, 'CustomConfig', {
20
- interval: cdk.Duration.minutes(1),
21
- percentage: 5,
22
- type: cdk.aws_codedeploy.CustomLambdaDeploymentConfigType.LINEAR,
23
- deploymentConfigName: 'hello',
24
- });
25
-
26
- new integ.IntegTest(app, 'LambdaDeploymentConfigTest', {
15
+ new integ.IntegTest(app, 'EcsDeploymentConfigTest', {
27
16
  testCases: [stack],
28
17
  });
29
18