konokenj.cdk-api-mcp-server 0.41.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/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-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-s3-deployment/README.md +18 -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/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/cx-api/FEATURE_FLAGS.md +28 -1
- {konokenj_cdk_api_mcp_server-0.41.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/METADATA +2 -2
- {konokenj_cdk_api_mcp_server-0.41.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/RECORD +37 -31
- {konokenj_cdk_api_mcp_server-0.41.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/WHEEL +0 -0
- {konokenj_cdk_api_mcp_server-0.41.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/entry_points.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.41.0.dist-info → konokenj_cdk_api_mcp_server-0.42.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -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
|
});
|
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.table-v2-global.ts
CHANGED
|
@@ -19,7 +19,9 @@ class TestStack extends Stack {
|
|
|
19
19
|
writeCapacity: Capacity.autoscaled({ maxCapacity: 20, targetUtilizationPercent: 60, seedCapacity: 10 }),
|
|
20
20
|
}),
|
|
21
21
|
encryption: TableEncryptionV2.awsManagedKey(),
|
|
22
|
-
|
|
22
|
+
contributorInsightsSpecification: {
|
|
23
|
+
enabled: true,
|
|
24
|
+
},
|
|
23
25
|
pointInTimeRecovery: true,
|
|
24
26
|
tableClass: TableClass.STANDARD_INFREQUENT_ACCESS,
|
|
25
27
|
timeToLiveAttribute: 'attr',
|
|
@@ -49,7 +51,9 @@ class TestStack extends Stack {
|
|
|
49
51
|
readCapacity: Capacity.autoscaled({ minCapacity: 5, maxCapacity: 25 }),
|
|
50
52
|
globalSecondaryIndexOptions: {
|
|
51
53
|
gsi2: {
|
|
52
|
-
|
|
54
|
+
contributorInsightsSpecification: {
|
|
55
|
+
enabled: false,
|
|
56
|
+
},
|
|
53
57
|
},
|
|
54
58
|
},
|
|
55
59
|
tags: [{ key: 'USE2ReplicaTagKey', value: 'USE2ReplicaTagValue' }],
|
|
@@ -57,7 +61,9 @@ class TestStack extends Stack {
|
|
|
57
61
|
{
|
|
58
62
|
region: 'us-west-2',
|
|
59
63
|
tableClass: TableClass.STANDARD,
|
|
60
|
-
|
|
64
|
+
contributorInsightsSpecification: {
|
|
65
|
+
enabled: false,
|
|
66
|
+
},
|
|
61
67
|
globalSecondaryIndexOptions: {
|
|
62
68
|
gsi1: {
|
|
63
69
|
readCapacity: Capacity.fixed(15),
|
|
@@ -1970,6 +1970,9 @@ const volumeFromSnapshot = new ecs.ServiceManagedVolume(this, 'EBSVolume', {
|
|
|
1970
1970
|
snapShotId: 'snap-066877671789bd71b',
|
|
1971
1971
|
volumeType: ec2.EbsDeviceVolumeType.GP3,
|
|
1972
1972
|
fileSystemType: ecs.FileSystemType.XFS,
|
|
1973
|
+
// Specifies the Amazon EBS Provisioned Rate for Volume Initialization.
|
|
1974
|
+
// Valid range is between 100 and 300 MiB/s.
|
|
1975
|
+
volumeInitializationRate: Size.mebibytes(200),
|
|
1973
1976
|
},
|
|
1974
1977
|
});
|
|
1975
1978
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
2
|
+
import * as cdk from 'aws-cdk-lib';
|
|
3
|
+
import * as ecs from 'aws-cdk-lib/aws-ecs';
|
|
4
|
+
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
5
|
+
import { Construct } from 'constructs';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* This integration test demonstrates how to use EBS volume initialization rate
|
|
9
|
+
* with Service Managed Volumes.
|
|
10
|
+
*
|
|
11
|
+
* To run this test with a real EBS snapshot:
|
|
12
|
+
* 1. Create an EBS volume:
|
|
13
|
+
* aws ec2 create-volume --size 1 --volume-type gp3 --availability-zone us-east-1a
|
|
14
|
+
* 2. Create a snapshot from the volume:
|
|
15
|
+
* aws ec2 create-snapshot --volume-id vol-xxxxxxxxx --description "Test snapshot"
|
|
16
|
+
* 3. Wait for snapshot completion:
|
|
17
|
+
* aws ec2 wait snapshot-completed --snapshot-ids snap-xxxxxxxxx
|
|
18
|
+
* 4. Set the environment variable SNAPSHOT_ID to the snapshot ID:
|
|
19
|
+
* export SNAPSHOT_ID=snap-xxxxxxxxx
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const snapShotId = process.env.SNAPSHOT_ID ?? 'snap-123456789abcdef0';
|
|
23
|
+
|
|
24
|
+
class TestStack extends cdk.Stack {
|
|
25
|
+
constructor(scope: Construct, id: string) {
|
|
26
|
+
super(scope, id);
|
|
27
|
+
|
|
28
|
+
const vpc = new ec2.Vpc(this, 'Vpc', {
|
|
29
|
+
maxAzs: 1,
|
|
30
|
+
restrictDefaultSecurityGroup: false,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const cluster = new ecs.Cluster(this, 'FargateCluster', {
|
|
34
|
+
vpc,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef');
|
|
38
|
+
|
|
39
|
+
const container = taskDefinition.addContainer('web', {
|
|
40
|
+
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
|
|
41
|
+
portMappings: [{
|
|
42
|
+
containerPort: 80,
|
|
43
|
+
protocol: ecs.Protocol.TCP,
|
|
44
|
+
}],
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const volume = new ecs.ServiceManagedVolume(this, 'EBSVolume', {
|
|
48
|
+
name: 'ebs1',
|
|
49
|
+
managedEBSVolume: {
|
|
50
|
+
volumeType: ec2.EbsDeviceVolumeType.GP3,
|
|
51
|
+
size: cdk.Size.gibibytes(1),
|
|
52
|
+
fileSystemType: ecs.FileSystemType.EXT4,
|
|
53
|
+
volumeInitializationRate: cdk.Size.mebibytes(200),
|
|
54
|
+
snapShotId: snapShotId,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
volume.mountIn(container, {
|
|
59
|
+
containerPath: '/var/lib',
|
|
60
|
+
readOnly: false,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
taskDefinition.addVolume(volume);
|
|
64
|
+
|
|
65
|
+
const service = new ecs.FargateService(this, 'FargateService', {
|
|
66
|
+
cluster,
|
|
67
|
+
taskDefinition,
|
|
68
|
+
desiredCount: 1,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
service.addVolume(volume);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const app = new cdk.App();
|
|
76
|
+
const stack = new TestStack(app, 'integ-aws-ecs-ebs-volume-initialization-rate');
|
|
77
|
+
|
|
78
|
+
new integ.IntegTest(app, 'EBSVolumeInitializationRate', {
|
|
79
|
+
testCases: [stack],
|
|
80
|
+
});
|
|
@@ -70,6 +70,8 @@ Fargate services will use the `LATEST` platform version by default, but you can
|
|
|
70
70
|
|
|
71
71
|
Fargate services use the default VPC Security Group unless one or more are provided using the `securityGroups` property in the constructor.
|
|
72
72
|
|
|
73
|
+
**Security Considerations**: When using custom security groups on your load balancer, the `openListener` property controls whether the load balancer listener allows traffic from anywhere on the internet (0.0.0.0/0). By default, `openListener` is `true`, but it will automatically default to `false` when custom security groups are detected, preventing unintended internet exposure. You can always explicitly set `openListener: true` to override this behavior if needed.
|
|
74
|
+
|
|
73
75
|
By setting `redirectHTTP` to true, CDK will automatically create a listener on port 80 that redirects HTTP traffic to the HTTPS port.
|
|
74
76
|
|
|
75
77
|
If you specify the option `recordType` you can decide if you want the construct to use CNAME or Route53-Aliases as record sets.
|