konokenj.cdk-api-mcp-server 0.29.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.
- cdk_api_mcp_server/__about__.py +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api-dualstack.ts +4 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api.ts +4 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.stage.ts +20 -7
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.iam.ts +38 -34
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.sqs.ts +71 -58
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-backup/README.md +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-backup/integ.backup.ts +12 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/README.md +32 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.alarm-and-dashboard.ts +1 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.math-alarm-and-dashboard.ts +4 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-config.ts +4 -15
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-group.ts +218 -40
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-elastic-beanstalk-deploy.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/README.md +13 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.client-vpn-endpoint-client-route-enforcement.ts +68 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.helm-chart-logging.ts +55 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/README.md +15 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.log-retention.ts +8 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/README.md +23 -13
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-snapshot.ts +3 -71
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.instance-engine-lifecycle-support.ts +53 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-notifications/integ.bucket-notifications.ts +42 -80
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.call-aws-service-cross-region-lambda.ts +97 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.start-job-run.ts +51 -106
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +2 -2
- {konokenj_cdk_api_mcp_server-0.29.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/METADATA +2 -2
- {konokenj_cdk_api_mcp_server-0.29.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/RECORD +31 -27
- {konokenj_cdk_api_mcp_server-0.29.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/WHEEL +0 -0
- {konokenj_cdk_api_mcp_server-0.29.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/entry_points.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.29.0.dist-info → konokenj_cdk_api_mcp_server-0.30.0.dist-info}/licenses/LICENSE.txt +0 -0
cdk_api_mcp_server/__about__.py
CHANGED
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api-dualstack.ts
CHANGED
|
@@ -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, '
|
|
7
|
+
const stack = new cdk.Stack(app, 'DualStackHttpApiStack');
|
|
8
8
|
|
|
9
|
-
new apigw.
|
|
9
|
+
new apigw.HttpApi(stack, 'HttpApi', {
|
|
10
|
+
routeSelectionExpression: true,
|
|
10
11
|
ipAddressType: apigw.IpAddressType.DUAL_STACK,
|
|
11
12
|
});
|
|
12
13
|
|
|
13
|
-
new IntegTest(app, '
|
|
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.
|
|
9
|
+
new apigw.HttpApi(stack, 'HttpApi', {
|
|
10
|
+
routeSelectionExpression: true,
|
|
11
|
+
});
|
|
10
12
|
|
|
11
|
-
new IntegTest(app, '
|
|
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
|
|
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-
|
|
9
|
+
const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-http-stage');
|
|
7
10
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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 {
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
22
|
-
|
|
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
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
authorizer: new WebSocketIamAuthorizer(),
|
|
31
|
-
},
|
|
28
|
+
const [fooRoute] = httpApi.addRoutes({
|
|
29
|
+
integration: new ExampleComIntegration('examplecom'),
|
|
30
|
+
path: '/foo',
|
|
32
31
|
});
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
fooRoute.grantInvoke(user);
|
|
34
|
+
|
|
35
|
+
const [booksRoute] = httpApi.addRoutes({
|
|
36
|
+
integration: new ExampleComIntegration('examplecom'),
|
|
37
|
+
path: '/books/{book}',
|
|
37
38
|
});
|
|
38
39
|
|
|
39
|
-
|
|
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
|
|
50
|
-
|
|
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
|
-
|
|
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
|
|
1
|
+
import * as apigwv2 from 'aws-cdk-lib/aws-apigatewayv2';
|
|
2
2
|
import * as sqs from 'aws-cdk-lib/aws-sqs';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
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, '
|
|
8
|
+
const stack = new Stack(app, 'sqs-integration');
|
|
15
9
|
|
|
16
|
-
const
|
|
17
|
-
fifo: true,
|
|
18
|
-
queueName: 'MessageSQSQueue.fifo',
|
|
19
|
-
});
|
|
10
|
+
const queue = new sqs.Queue(stack, 'Queue');
|
|
20
11
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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, '
|
|
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
|
|
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
|
|
|
@@ -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
|
-
|
|
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.
|
|
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
|
|
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
|
|