konokenj.cdk-api-mcp-server 0.40.0__py3-none-any.whl → 0.42.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of konokenj.cdk-api-mcp-server might be problematic. Click here for more details.
- cdk_api_mcp_server/__about__.py +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-bedrock-alpha/README.md +540 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-eks-v2-alpha/README.md +44 -46
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-lambda-python-alpha/README.md +6 -6
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-s3tables-alpha/README.md +28 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/README.md/README.md +364 -16
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/README.md +144 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api-dualstack.ts +3 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.api.ts +2 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.stage.ts +7 -20
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.usage-plan.ts +80 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.iam.ts +34 -38
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.sqs.ts +58 -71
- 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-cognito/README.md +11 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cognito/integ.user-pool-client-explicit-props.ts +1 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/README.md +38 -13
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb-v2.cci.ts +49 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.cci.ts +27 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.contirubtor-insights-for-gsi.ts +6 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.table-v2-global.ts +9 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +3 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.ebs-volume-initialization-rate.ts +80 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs-patterns/README.md +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs-patterns/integ.alb-fargate-service-smart-defaults.ts +143 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events/README.md +25 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events/integ.archive-customer-managed-key.ts +23 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/README.md +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/integ.delete-existing-record-set.ts +0 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/README.md +18 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cross-stack-ssm-source.ts +91 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-signer/integ.signing-profile.ts +5 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-sns/README.md +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-sns-subscriptions/integ.sns-sqs-subscription-filter.ts +75 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-sns-subscriptions/integ.sns-sqs.ts +21 -40
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/README.md +9 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke-jsonata.ts +87 -80
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke.ts +87 -69
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.start-job-run.ts +102 -104
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/core/README.md +2 -1893
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +52 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/README.md +24 -1
- {konokenj_cdk_api_mcp_server-0.40.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/METADATA +2 -2
- {konokenj_cdk_api_mcp_server-0.40.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/RECORD +47 -39
- {konokenj_cdk_api_mcp_server-0.40.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/WHEEL +0 -0
- {konokenj_cdk_api_mcp_server-0.40.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/entry_points.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.40.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -6,11 +6,9 @@ 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.
|
|
10
|
-
routeSelectionExpression: true,
|
|
11
|
-
});
|
|
9
|
+
new apigw.WebSocketApi(stack, 'WebSocketApi');
|
|
12
10
|
|
|
13
|
-
new IntegTest(app, '
|
|
11
|
+
new IntegTest(app, 'web-socket-api', {
|
|
14
12
|
testCases: [stack],
|
|
15
13
|
});
|
|
16
14
|
|
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
|
|
3
2
|
import * as cdk from 'aws-cdk-lib';
|
|
4
|
-
import * as
|
|
5
|
-
import * as apigw from 'aws-cdk-lib/aws-apigateway';
|
|
6
|
-
import * as logs from 'aws-cdk-lib/aws-logs';
|
|
3
|
+
import * as apigw from 'aws-cdk-lib/aws-apigatewayv2';
|
|
7
4
|
|
|
8
5
|
const app = new cdk.App();
|
|
9
|
-
const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-
|
|
6
|
+
const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-websocket-stage');
|
|
10
7
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
httpApi,
|
|
8
|
+
const webSocketApi = new apigw.WebSocketApi(stack, 'WebSocketApi');
|
|
9
|
+
new apigw.WebSocketStage(stack, 'WebSocketStage', {
|
|
10
|
+
webSocketApi,
|
|
11
|
+
stageName: 'dev',
|
|
16
12
|
throttle: {
|
|
17
13
|
rateLimit: 1000,
|
|
18
14
|
burstLimit: 1000,
|
|
19
15
|
},
|
|
20
16
|
detailedMetricsEnabled: true,
|
|
21
17
|
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
|
-
},
|
|
29
18
|
});
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
testCases: [stack],
|
|
33
|
-
});
|
|
20
|
+
app.synth();
|
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.usage-plan.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
2
|
+
import * as cdk from 'aws-cdk-lib';
|
|
3
|
+
import { WebSocketApi, WebSocketStage, UsagePlan, ApiKey, RateLimitedApiKey, Period } from 'aws-cdk-lib/aws-apigatewayv2';
|
|
4
|
+
|
|
5
|
+
const app = new cdk.App();
|
|
6
|
+
|
|
7
|
+
const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-websocket-usage-plan');
|
|
8
|
+
|
|
9
|
+
const webSocketApi = new WebSocketApi(stack, 'WebSocketApi');
|
|
10
|
+
|
|
11
|
+
const webSocketStage = new WebSocketStage(stack, 'WebSocketStage', {
|
|
12
|
+
webSocketApi,
|
|
13
|
+
stageName: 'dev',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const apiKey = new ApiKey(stack, 'ApiKey', {
|
|
17
|
+
apiKeyName: 'my-api-key',
|
|
18
|
+
value: 'MyApiKeyThatIsAtLeast20Characters',
|
|
19
|
+
description: 'Basic api-key',
|
|
20
|
+
customerId: 'my-customer',
|
|
21
|
+
enabled: true,
|
|
22
|
+
generateDistinctId: true,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const usagePlan = new UsagePlan(stack, 'UsagePlan', {
|
|
26
|
+
apiStages: [{
|
|
27
|
+
api: webSocketApi,
|
|
28
|
+
stage: webSocketStage,
|
|
29
|
+
}],
|
|
30
|
+
description: 'Basic usage plan',
|
|
31
|
+
quota: {
|
|
32
|
+
limit: 10000,
|
|
33
|
+
offset: 1,
|
|
34
|
+
period: Period.MONTH,
|
|
35
|
+
},
|
|
36
|
+
throttle: {
|
|
37
|
+
rateLimit: 100,
|
|
38
|
+
burstLimit: 200,
|
|
39
|
+
},
|
|
40
|
+
usagePlanName: 'WebSocketUsagePlan',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const webSocketStage2 = new WebSocketStage(stack, 'WebSocketStage2', {
|
|
44
|
+
webSocketApi,
|
|
45
|
+
stageName: 'dev2',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
usagePlan.addApiKey(apiKey);
|
|
49
|
+
usagePlan.addApiStage({ api: webSocketApi, stage: webSocketStage2 });
|
|
50
|
+
|
|
51
|
+
const webSocketStage3 = new WebSocketStage(stack, 'WebSocketStage3', {
|
|
52
|
+
webSocketApi,
|
|
53
|
+
stageName: 'dev3',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
new RateLimitedApiKey(stack, 'RateLimitedApiKey', {
|
|
57
|
+
apiKeyName: 'my-rate-limited-api-key',
|
|
58
|
+
value: 'MyRateLimitedApiKeyThatIsAtLeast20Characters',
|
|
59
|
+
description: 'Basic rate-limited-api-key',
|
|
60
|
+
customerId: 'my-customer',
|
|
61
|
+
enabled: true,
|
|
62
|
+
generateDistinctId: true,
|
|
63
|
+
apiStages: [{
|
|
64
|
+
api: webSocketApi,
|
|
65
|
+
stage: webSocketStage3,
|
|
66
|
+
}],
|
|
67
|
+
quota: {
|
|
68
|
+
limit: 10000,
|
|
69
|
+
offset: 1,
|
|
70
|
+
period: Period.MONTH,
|
|
71
|
+
},
|
|
72
|
+
throttle: {
|
|
73
|
+
rateLimit: 100,
|
|
74
|
+
burstLimit: 200,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
new integ.IntegTest(app, 'WebSocketUsagePlanInteg', {
|
|
79
|
+
testCases: [stack],
|
|
80
|
+
});
|
|
@@ -1,46 +1,53 @@
|
|
|
1
1
|
import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
|
|
2
|
+
import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
|
2
3
|
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
4
|
+
import { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda';
|
|
3
5
|
import * as cdk from 'aws-cdk-lib';
|
|
4
|
-
import {
|
|
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';
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
method: apigatewayv2.HttpMethod.GET,
|
|
12
|
-
uri: 'https://www.example.com/',
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const app = new cdk.App();
|
|
10
|
+
const app = new cdk.App({
|
|
11
|
+
postCliContext: {
|
|
12
|
+
'@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
18
15
|
const stack = new cdk.Stack(app, 'IntegApiGatewayV2Iam');
|
|
19
16
|
const user = new iam.User(stack, 'User');
|
|
20
17
|
const userAccessKey = new iam.AccessKey(stack, 'UserAccess', {
|
|
21
18
|
user,
|
|
22
19
|
});
|
|
23
20
|
|
|
24
|
-
const
|
|
25
|
-
|
|
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',
|
|
26
25
|
});
|
|
27
26
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const webSocketApi = new apigatewayv2.WebSocketApi(stack, 'WebSocketApi', {
|
|
28
|
+
connectRouteOptions: {
|
|
29
|
+
integration: new WebSocketLambdaIntegration('WebSocketLambdaIntegration', handler),
|
|
30
|
+
authorizer: new WebSocketIamAuthorizer(),
|
|
31
|
+
},
|
|
31
32
|
});
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
integration: new ExampleComIntegration('examplecom'),
|
|
37
|
-
path: '/books/{book}',
|
|
34
|
+
const arn = Stack.of(stack).formatArn({
|
|
35
|
+
service: 'execute-api',
|
|
36
|
+
resource: webSocketApi.apiId,
|
|
38
37
|
});
|
|
39
38
|
|
|
40
|
-
|
|
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
|
+
}));
|
|
41
48
|
|
|
42
|
-
new
|
|
43
|
-
|
|
49
|
+
new integ.IntegTest(app, 'ApiGatewayV2WebSocketIamTest', {
|
|
50
|
+
testCases: [stack],
|
|
44
51
|
});
|
|
45
52
|
|
|
46
53
|
new cdk.CfnOutput(stack, 'TESTACCESSKEYID', {
|
|
@@ -55,15 +62,4 @@ new cdk.CfnOutput(stack, 'TESTREGION', {
|
|
|
55
62
|
value: stack.region,
|
|
56
63
|
});
|
|
57
64
|
|
|
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
|
-
*/
|
|
65
|
+
app.synth();
|
|
@@ -1,85 +1,72 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HttpMethod, PassthroughBehavior, WebSocketApi, WebSocketStage } from 'aws-cdk-lib/aws-apigatewayv2';
|
|
2
2
|
import * as sqs from 'aws-cdk-lib/aws-sqs';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
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';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/*
|
|
9
|
+
* Stack verification steps:
|
|
10
|
+
* 1. Verify manually that the integration has type "AWS"
|
|
11
|
+
*/
|
|
9
12
|
|
|
10
|
-
const
|
|
13
|
+
const app = new App();
|
|
14
|
+
const stack = new Stack(app, 'integ-aws-websocket-sqs-integration');
|
|
11
15
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
methods: [apigwv2.HttpMethod.POST],
|
|
16
|
-
integration: new HttpSqsIntegration('defaultIntegration', {
|
|
17
|
-
queue,
|
|
18
|
-
}),
|
|
19
|
-
});
|
|
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
|
-
}),
|
|
27
|
-
});
|
|
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
|
-
}),
|
|
35
|
-
});
|
|
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,
|
|
42
|
-
}),
|
|
16
|
+
const sqsMessageQueue = new sqs.Queue(stack, 'MessageSQSQueue', {
|
|
17
|
+
fifo: true,
|
|
18
|
+
queueName: 'MessageSQSQueue.fifo',
|
|
43
19
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
subtype: apigwv2.HttpIntegrationSubtype.SQS_PURGE_QUEUE,
|
|
50
|
-
}),
|
|
20
|
+
|
|
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',
|
|
51
25
|
});
|
|
52
26
|
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
// Optionally, create a WebSocket stage
|
|
28
|
+
new WebSocketStage(stack, 'DevStage', {
|
|
29
|
+
webSocketApi: webSocketApi,
|
|
30
|
+
stageName: 'dev',
|
|
31
|
+
autoDeploy: true,
|
|
55
32
|
});
|
|
56
33
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
);
|
|
63
|
-
defaultAssertion.expect(integ.ExpectedResult.objectLike({ status: 200, statusText: 'OK' }));
|
|
34
|
+
// IAM Role for API Gateway
|
|
35
|
+
const webSocketApiRole = new iam.Role(stack, 'webSocketApiRole', {
|
|
36
|
+
assumedBy: new iam.ServicePrincipal('apigateway.amazonaws.com'),
|
|
37
|
+
});
|
|
64
38
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
39
|
+
webSocketApiRole.addToPolicy(
|
|
40
|
+
new iam.PolicyStatement({
|
|
41
|
+
actions: ['sqs:SendMessage'],
|
|
42
|
+
effect: iam.Effect.ALLOW,
|
|
43
|
+
resources: [sqsMessageQueue.queueArn],
|
|
44
|
+
}),
|
|
70
45
|
);
|
|
71
|
-
sendMessageAssertion.expect(integ.ExpectedResult.objectLike({ status: 200, statusText: 'OK' }));
|
|
72
46
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
});
|
|
79
62
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
63
|
+
new IntegTest(app, 'apigatewayv2-aws-integration-sqs-integ-test', {
|
|
64
|
+
testCases: [stack],
|
|
65
|
+
cdkCommandOptions: {
|
|
66
|
+
deploy: {
|
|
67
|
+
args: {
|
|
68
|
+
rollback: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
83
71
|
},
|
|
84
|
-
);
|
|
85
|
-
purgeQueueAssertion.expect(integ.ExpectedResult.objectLike({ status: 200, statusText: 'OK' }));
|
|
72
|
+
});
|
|
@@ -85,7 +85,7 @@ const beanstalkEnv = new elasticbeanstalk.CfnEnvironment(stack, 'beanstlk-env',
|
|
|
85
85
|
applicationName: beanstalkApp.applicationName!,
|
|
86
86
|
environmentName: 'codepipeline-test-env',
|
|
87
87
|
// see https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html#platforms-supported.nodejs
|
|
88
|
-
solutionStackName: '64bit Amazon Linux 2023 v6.
|
|
88
|
+
solutionStackName: '64bit Amazon Linux 2023 v6.6.2 running Node.js 20',
|
|
89
89
|
optionSettings: [
|
|
90
90
|
{
|
|
91
91
|
namespace: 'aws:autoscaling:launchconfiguration',
|
|
@@ -1004,6 +1004,17 @@ const userPoolClient = new cognito.UserPoolClient(this, 'UserPoolClient', {
|
|
|
1004
1004
|
});
|
|
1005
1005
|
```
|
|
1006
1006
|
|
|
1007
|
+
[Refresh token rotation](https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-refresh-token.html#using-the-refresh-token-rotation)
|
|
1008
|
+
can be configured to enable automatic rotation of refresh tokens. By default, refresh token rotation is disabled. When the refreshTokenRotationGracePeriod is 0, the grace period is disabled and a successful request immediately invalidates the submitted refresh token.
|
|
1009
|
+
|
|
1010
|
+
```ts
|
|
1011
|
+
const pool = new cognito.UserPool(this, 'Pool');
|
|
1012
|
+
pool.addClient('app-client', {
|
|
1013
|
+
// ...
|
|
1014
|
+
refreshTokenRotationGracePeriod: Duration.seconds(40)
|
|
1015
|
+
});
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1007
1018
|
See [Adding user device and session data to API requests](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-adaptive-authentication.html#user-pool-settings-adaptive-authentication-device-fingerprint) for more information.
|
|
1008
1019
|
|
|
1009
1020
|
### Resource Servers
|
|
@@ -43,6 +43,7 @@ const client = userpool.addClient('myuserpoolclient', {
|
|
|
43
43
|
},
|
|
44
44
|
preventUserExistenceErrors: true,
|
|
45
45
|
authSessionValidity: Duration.minutes(3),
|
|
46
|
+
refreshTokenRotationGracePeriod: Duration.seconds(45),
|
|
46
47
|
writeAttributes: (new ClientAttributes()).withStandardAttributes(
|
|
47
48
|
{
|
|
48
49
|
address: true,
|
|
@@ -17,7 +17,9 @@ By default, `TableV2` will create a single table in the main deployment region r
|
|
|
17
17
|
```ts
|
|
18
18
|
const table = new dynamodb.TableV2(this, 'Table', {
|
|
19
19
|
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
20
|
-
|
|
20
|
+
contributorInsightsSpecification: {
|
|
21
|
+
enabled: true,
|
|
22
|
+
},
|
|
21
23
|
tableClass: dynamodb.TableClass.STANDARD_INFREQUENT_ACCESS,
|
|
22
24
|
pointInTimeRecoverySpecification: {
|
|
23
25
|
pointInTimeRecoveryEnabled: true,
|
|
@@ -66,12 +68,12 @@ globalTable.addReplica({ region: 'us-east-2', deletionProtection: true });
|
|
|
66
68
|
```
|
|
67
69
|
|
|
68
70
|
The following properties are configurable on a per-replica basis, but will be inherited from the `TableV2` properties if not specified:
|
|
69
|
-
*
|
|
71
|
+
* contributorInsightsSpecification
|
|
70
72
|
* deletionProtection
|
|
71
73
|
* pointInTimeRecoverySpecification
|
|
72
74
|
* tableClass
|
|
73
75
|
* readCapacity (only configurable if the `TableV2` billing mode is `PROVISIONED`)
|
|
74
|
-
* globalSecondaryIndexes (only `
|
|
76
|
+
* globalSecondaryIndexes (only `contributorInsightsSpecification` and `readCapacity`)
|
|
75
77
|
|
|
76
78
|
The following example shows how to define properties on a per-replica basis:
|
|
77
79
|
|
|
@@ -83,7 +85,9 @@ const stack = new cdk.Stack(app, 'Stack', { env: { region: 'us-west-2' } });
|
|
|
83
85
|
|
|
84
86
|
const globalTable = new dynamodb.TableV2(stack, 'GlobalTable', {
|
|
85
87
|
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
86
|
-
|
|
88
|
+
contributorInsightsSpecification: {
|
|
89
|
+
enabled: true,
|
|
90
|
+
},
|
|
87
91
|
pointInTimeRecoverySpecification: {
|
|
88
92
|
pointInTimeRecoveryEnabled: true,
|
|
89
93
|
},
|
|
@@ -97,7 +101,9 @@ const globalTable = new dynamodb.TableV2(stack, 'GlobalTable', {
|
|
|
97
101
|
},
|
|
98
102
|
{
|
|
99
103
|
region: 'us-east-2',
|
|
100
|
-
|
|
104
|
+
contributorInsightsSpecification: {
|
|
105
|
+
enabled: false,
|
|
106
|
+
},
|
|
101
107
|
},
|
|
102
108
|
],
|
|
103
109
|
});
|
|
@@ -443,7 +449,7 @@ const table = new dynamodb.TableV2(this, 'Table', {
|
|
|
443
449
|
});
|
|
444
450
|
```
|
|
445
451
|
|
|
446
|
-
All `globalSecondaryIndexes` for replica tables are inherited from the primary table. You can configure `
|
|
452
|
+
All `globalSecondaryIndexes` for replica tables are inherited from the primary table. You can configure `contributorInsightsSpecification` and `readCapacity` for each `globalSecondaryIndex` on a per-replica basis:
|
|
447
453
|
|
|
448
454
|
```ts
|
|
449
455
|
import * as cdk from 'aws-cdk-lib';
|
|
@@ -453,7 +459,9 @@ const stack = new cdk.Stack(app, 'Stack', { env: { region: 'us-west-2' } });
|
|
|
453
459
|
|
|
454
460
|
const globalTable = new dynamodb.TableV2(stack, 'GlobalTable', {
|
|
455
461
|
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
456
|
-
|
|
462
|
+
contributorInsightsSpecification: {
|
|
463
|
+
enabled: true,
|
|
464
|
+
},
|
|
457
465
|
billing: dynamodb.Billing.provisioned({
|
|
458
466
|
readCapacity: dynamodb.Capacity.fixed(10),
|
|
459
467
|
writeCapacity: dynamodb.Capacity.autoscaled({ maxCapacity: 10 }),
|
|
@@ -484,7 +492,9 @@ const globalTable = new dynamodb.TableV2(stack, 'GlobalTable', {
|
|
|
484
492
|
region: 'us-east-2',
|
|
485
493
|
globalSecondaryIndexOptions: {
|
|
486
494
|
gsi2: {
|
|
487
|
-
|
|
495
|
+
contributorInsightsSpecification: {
|
|
496
|
+
enabled: false,
|
|
497
|
+
},
|
|
488
498
|
},
|
|
489
499
|
},
|
|
490
500
|
},
|
|
@@ -605,25 +615,40 @@ const table = new dynamodb.TableV2(this, 'Table', {
|
|
|
605
615
|
|
|
606
616
|
## Contributor Insights
|
|
607
617
|
|
|
608
|
-
Enabling `
|
|
618
|
+
Enabling `contributorInsightSpecification` for `TableV2` will provide information about the most accessed and throttled or throttled only items in a table or `globalSecondaryIndex`. DynamoDB delivers this information to you via CloudWatch Contributor Insights rules, reports, and graphs of report data.
|
|
619
|
+
|
|
620
|
+
By default, Contributor Insights for DynamoDB monitors all requests, including both the most accessed and most throttled items.
|
|
621
|
+
To limit the scope to only the most accessed or only the most throttled items, use the optional `mode` parameter.
|
|
622
|
+
|
|
623
|
+
- To monitor all traffic on a table or index, set `mode` to `ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS`.
|
|
624
|
+
- To monitor only throttled traffic on a table or index, set `mode` to `ContributorInsightsMode.THROTTLED_KEYS`.
|
|
625
|
+
|
|
609
626
|
|
|
610
627
|
```ts
|
|
611
628
|
const table = new dynamodb.TableV2(this, 'Table', {
|
|
612
629
|
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
613
|
-
|
|
630
|
+
contributorInsightsSpecification: {
|
|
631
|
+
enabled: true,
|
|
632
|
+
mode: dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS,
|
|
633
|
+
},
|
|
614
634
|
});
|
|
615
635
|
```
|
|
616
636
|
|
|
617
|
-
When you use `Table`, you can enable contributor insights for a table or specific global secondary index by setting `
|
|
637
|
+
When you use `Table`, you can enable contributor insights for a table or specific global secondary index by setting `contributorInsightsSpecification` parameter `enabled` to `true`.
|
|
618
638
|
|
|
619
639
|
```ts
|
|
620
640
|
const table = new dynamodb.Table(this, 'Table', {
|
|
621
641
|
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
622
|
-
|
|
642
|
+
contributorInsightsSpecification: { // for a table
|
|
643
|
+
enabled: true,
|
|
644
|
+
mode: dynamodb.ContributorInsightsMode.THROTTLED_KEYS, // only emit throttling events
|
|
645
|
+
},
|
|
623
646
|
});
|
|
624
647
|
|
|
625
648
|
table.addGlobalSecondaryIndex({
|
|
626
|
-
|
|
649
|
+
contributorInsightsSpecification: { // for a specific global secondary index
|
|
650
|
+
enabled: true,
|
|
651
|
+
},
|
|
627
652
|
indexName: 'gsi',
|
|
628
653
|
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
629
654
|
});
|
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb-v2.cci.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { App, Stack, StackProps } from 'aws-cdk-lib';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
|
|
4
|
+
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
|
|
5
|
+
|
|
6
|
+
const app = new App();
|
|
7
|
+
|
|
8
|
+
class TestStack extends Stack {
|
|
9
|
+
constructor(scope: Construct, id: string, props?: StackProps) {
|
|
10
|
+
super(scope, id, props);
|
|
11
|
+
|
|
12
|
+
new dynamodb.TableV2(this, 'TableV2', {
|
|
13
|
+
partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.STRING },
|
|
14
|
+
sortKey: { name: 'sortKey', type: dynamodb.AttributeType.NUMBER },
|
|
15
|
+
globalSecondaryIndexes: [
|
|
16
|
+
{
|
|
17
|
+
indexName: 'gsi',
|
|
18
|
+
partitionKey: { name: 'gsiHashKey', type: dynamodb.AttributeType.STRING },
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
contributorInsightsSpecification: {
|
|
22
|
+
enabled: true,
|
|
23
|
+
mode: dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS,
|
|
24
|
+
},
|
|
25
|
+
replicas: [
|
|
26
|
+
{
|
|
27
|
+
region: 'eu-west-2',
|
|
28
|
+
contributorInsightsSpecification: {
|
|
29
|
+
enabled: false,
|
|
30
|
+
},
|
|
31
|
+
globalSecondaryIndexOptions: {
|
|
32
|
+
gsi: {
|
|
33
|
+
contributorInsightsSpecification: {
|
|
34
|
+
enabled: true,
|
|
35
|
+
mode: dynamodb.ContributorInsightsMode.THROTTLED_KEYS,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const stack = new TestStack(app, 'CCI-Integ-Test', { env: { region: 'eu-west-1' } });
|
|
46
|
+
|
|
47
|
+
new IntegTest(app, 'table-v2-CCI-test', {
|
|
48
|
+
testCases: [stack],
|
|
49
|
+
});
|
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.cci.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { App, Stack, StackProps } from 'aws-cdk-lib';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
|
|
4
|
+
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
|
|
5
|
+
|
|
6
|
+
const app = new App();
|
|
7
|
+
|
|
8
|
+
class TestStack extends Stack {
|
|
9
|
+
constructor(scope: Construct, id: string, props?: StackProps) {
|
|
10
|
+
super(scope, id, props);
|
|
11
|
+
|
|
12
|
+
new dynamodb.Table(this, 'TableV2', {
|
|
13
|
+
partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.STRING },
|
|
14
|
+
sortKey: { name: 'sortKey', type: dynamodb.AttributeType.NUMBER },
|
|
15
|
+
contributorInsightsSpecification: {
|
|
16
|
+
enabled: true,
|
|
17
|
+
mode: dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const stack = new TestStack(app, 'CCI-Integ-Test-TableV1', { env: { region: 'eu-west-1' } });
|
|
24
|
+
|
|
25
|
+
new IntegTest(app, 'table-v1-CCI-test', {
|
|
26
|
+
testCases: [stack],
|
|
27
|
+
});
|
|
@@ -24,12 +24,16 @@ const table = new Table(stack, TABLE, {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
table.addGlobalSecondaryIndex({
|
|
27
|
-
|
|
27
|
+
contributorInsightsSpecification: {
|
|
28
|
+
enabled: true,
|
|
29
|
+
},
|
|
28
30
|
indexName: GSI_TEST_CASE_1,
|
|
29
31
|
partitionKey: GSI_PARTITION_KEY,
|
|
30
32
|
});
|
|
31
33
|
table.addGlobalSecondaryIndex({
|
|
32
|
-
|
|
34
|
+
contributorInsightsSpecification: {
|
|
35
|
+
enabled: false,
|
|
36
|
+
},
|
|
33
37
|
indexName: GSI_TEST_CASE_2,
|
|
34
38
|
partitionKey: GSI_PARTITION_KEY,
|
|
35
39
|
});
|