konokenj.cdk-api-mcp-server 0.44.0__py3-none-any.whl → 0.46.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 (30) hide show
  1. cdk_api_mcp_server/__about__.py +1 -1
  2. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/custom-resource-handlers/README.md +15 -78
  3. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/README.md +36 -0
  4. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/integ.origin-response-completion-timeout.ts +50 -0
  5. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-config.ts +4 -15
  6. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codedeploy/integ.deployment-group.ts +218 -40
  7. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.availability-zone-rebalancing.ts +14 -4
  8. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.enable-execute-command.ts +35 -29
  9. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.exec-command.ts +16 -22
  10. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.lb-awsvpc-nw.ts +26 -16
  11. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.pseudo-terminal.ts +18 -8
  12. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +21 -0
  13. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.alb-target-group-attributes.ts +45 -0
  14. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.nlb-target-group-attributes.ts +45 -0
  15. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events/README.md +18 -1
  16. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events/integ.eventbus.ts +13 -3
  17. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/README.md +24 -0
  18. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/integ.route53.ts +51 -1
  19. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53-targets/integ.cloudfront-alias-target.ts +16 -1
  20. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/README.md +53 -0
  21. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.emr-create-cluster-with-ebs.ts +126 -0
  22. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke-jsonata.ts +80 -87
  23. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke.ts +69 -87
  24. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.start-job-run.ts +43 -96
  25. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cloudformation-include/integ.novalue-nonstring.ts +25 -0
  26. {konokenj_cdk_api_mcp_server-0.44.0.dist-info → konokenj_cdk_api_mcp_server-0.46.0.dist-info}/METADATA +2 -2
  27. {konokenj_cdk_api_mcp_server-0.44.0.dist-info → konokenj_cdk_api_mcp_server-0.46.0.dist-info}/RECORD +30 -25
  28. {konokenj_cdk_api_mcp_server-0.44.0.dist-info → konokenj_cdk_api_mcp_server-0.46.0.dist-info}/WHEEL +0 -0
  29. {konokenj_cdk_api_mcp_server-0.44.0.dist-info → konokenj_cdk_api_mcp_server-0.46.0.dist-info}/entry_points.txt +0 -0
  30. {konokenj_cdk_api_mcp_server-0.44.0.dist-info → konokenj_cdk_api_mcp_server-0.46.0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -3,11 +3,16 @@ import * as kms from 'aws-cdk-lib/aws-kms';
3
3
  import * as logs from 'aws-cdk-lib/aws-logs';
4
4
  import * as s3 from 'aws-cdk-lib/aws-s3';
5
5
  import * as cdk from 'aws-cdk-lib';
6
- import { Duration } from 'aws-cdk-lib';
7
- import * as integ from '@aws-cdk/integ-tests-alpha';
8
6
  import * as ecs from 'aws-cdk-lib/aws-ecs';
9
7
 
10
- const app = new cdk.App();
8
+ const app = new cdk.App({
9
+ postCliContext: {
10
+ '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
11
+ '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
12
+ '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
13
+ '@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': false,
14
+ },
15
+ });
11
16
  const stack = new cdk.Stack(app, 'aws-ecs-integ-exec-command');
12
17
 
13
18
  const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
@@ -22,7 +27,7 @@ const execBucket = new s3.Bucket(stack, 'EcsExecBucket', {
22
27
  encryptionKey: kmsKey,
23
28
  });
24
29
 
25
- const cluster = new ecs.Cluster(stack, 'FargateCluster', {
30
+ const cluster = new ecs.Cluster(stack, 'Ec2Cluster', {
26
31
  vpc,
27
32
  executeCommandConfiguration: {
28
33
  kmsKey,
@@ -36,32 +41,21 @@ const cluster = new ecs.Cluster(stack, 'FargateCluster', {
36
41
  logging: ecs.ExecuteCommandLogging.OVERRIDE,
37
42
  },
38
43
  });
44
+ cluster.addCapacity('DefaultAutoScalingGroup', {
45
+ instanceType: new ec2.InstanceType('t2.micro'),
46
+ });
39
47
 
40
- const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef');
48
+ const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef');
41
49
 
42
50
  taskDefinition.addContainer('web', {
43
51
  image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
44
- healthCheck: {
45
- command: ['CMD-SHELL', 'curl localhost:8000'],
46
- interval: Duration.seconds(60),
47
- timeout: Duration.seconds(40),
48
- },
52
+ memoryLimitMiB: 256,
49
53
  });
50
54
 
51
- new ecs.FargateService(stack, 'FargateService', {
55
+ new ecs.Ec2Service(stack, 'Ec2Service', {
52
56
  cluster,
53
57
  taskDefinition,
54
58
  enableExecuteCommand: true,
55
59
  });
56
60
 
57
- new integ.IntegTest(app, 'exec-command-integ-test', {
58
- testCases: [stack],
59
- diffAssets: true,
60
- cdkCommandOptions: {
61
- deploy: {
62
- args: {
63
- rollback: true,
64
- },
65
- },
66
- },
67
- });
61
+ app.synth();
@@ -3,38 +3,48 @@ import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
3
3
  import * as cdk from 'aws-cdk-lib';
4
4
  import * as ecs from 'aws-cdk-lib/aws-ecs';
5
5
 
6
- const app = new cdk.App();
6
+ const app = new cdk.App({
7
+ postCliContext: {
8
+ '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
9
+ '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
10
+ '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
11
+ '@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': false,
12
+ },
13
+ });
7
14
  const stack = new cdk.Stack(app, 'aws-ecs-integ');
8
15
 
9
16
  const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
10
17
 
11
- const cluster = new ecs.Cluster(stack, 'FargateCluster', { vpc });
18
+ const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
19
+ cluster.addCapacity('DefaultAutoScalingGroup', {
20
+ instanceType: new ec2.InstanceType('t2.micro'),
21
+ });
12
22
 
13
- const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef', {
14
- memoryLimitMiB: 1024,
15
- cpu: 512,
23
+ const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', {
24
+ networkMode: ecs.NetworkMode.AWS_VPC,
16
25
  });
17
26
 
18
- taskDefinition.addContainer('web', {
27
+ const container = taskDefinition.addContainer('web', {
19
28
  image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
20
- portMappings: [{
21
- containerPort: 80,
22
- protocol: ecs.Protocol.TCP,
23
- }],
29
+ memoryLimitMiB: 256,
30
+ environment: {
31
+ SOME_VARIABLE: 'value',
32
+ },
24
33
  });
25
34
 
26
- const service = new ecs.FargateService(stack, 'Service', {
35
+ container.addPortMappings({
36
+ containerPort: 80,
37
+ protocol: ecs.Protocol.TCP,
38
+ });
39
+
40
+ const service = new ecs.Ec2Service(stack, 'Service', {
27
41
  cluster,
28
42
  taskDefinition,
29
43
  });
30
44
 
31
- const scaling = service.autoScaleTaskCount({ maxCapacity: 10 });
32
- // Quite low to try and force it to scale
33
- scaling.scaleOnCpuUtilization('ReasonableCpu', { targetUtilizationPercent: 10 });
34
-
35
45
  const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc, internetFacing: true });
36
46
  const listener = lb.addListener('PublicListener', { port: 80, open: true });
37
- listener.addTargets('Fargate', {
47
+ listener.addTargets('ECS', {
38
48
  port: 80,
39
49
  targets: [service],
40
50
  });
@@ -3,25 +3,35 @@ import * as cdk from 'aws-cdk-lib';
3
3
  import * as integ from '@aws-cdk/integ-tests-alpha';
4
4
  import * as ecs from 'aws-cdk-lib/aws-ecs';
5
5
 
6
- const app = new cdk.App();
7
- const stack = new cdk.Stack(app, 'integ-pseudo-terminal');
6
+ const app = new cdk.App({
7
+ postCliContext: {
8
+ '@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
9
+ '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
10
+ '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
11
+ '@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy': false,
12
+ },
13
+ });
14
+ const stack = new cdk.Stack(app, 'aws-ecs-integ-pseudo-terminal');
8
15
 
9
16
  // Create a cluster
10
17
  const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
11
18
 
12
19
  const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
13
- const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef', {
14
- cpu: 256,
15
- memoryLimitMiB: 512,
20
+ cluster.addCapacity('DefaultAutoScalingGroup', {
21
+ instanceType: new ec2.InstanceType('t2.micro'),
22
+ });
23
+
24
+ const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', {
25
+ networkMode: ecs.NetworkMode.AWS_VPC,
16
26
  });
27
+
17
28
  taskDefinition.addContainer('web', {
18
29
  image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
19
- memoryLimitMiB: 512,
20
- cpu: 256,
30
+ memoryLimitMiB: 256,
21
31
  pseudoTerminal: true,
22
32
  });
23
33
 
24
- new ecs.FargateService(stack, 'Service', {
34
+ new ecs.Ec2Service(stack, 'Service', {
25
35
  cluster,
26
36
  taskDefinition,
27
37
  });
@@ -746,6 +746,27 @@ const ipv6NetworkTargetGroup = new elbv2.NetworkTargetGroup(this, 'Ipv6NetworkTa
746
746
  });
747
747
  ```
748
748
 
749
+ ### Target Group level health setting for Application Load Balancers and Network Load Balancers
750
+
751
+ You can set target group health setting at target group level by setting `targetGroupHealth` property.
752
+
753
+ For more information, see [How Elastic Load Balancing works](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-attributes).
754
+
755
+ ```ts
756
+ declare const vpc: ec2.Vpc;
757
+
758
+ const targetGroup = new elbv2.ApplicationTargetGroup(this, 'TargetGroup', {
759
+ vpc,
760
+ port: 80,
761
+ targetGroupHealth: {
762
+ dnsMinimumHealthyTargetCount: 3,
763
+ dnsMinimumHealthyTargetPercentage: 70,
764
+ routingMinimumHealthyTargetCount: 2,
765
+ routingMinimumHealthyTargetPercentage: 50,
766
+ },
767
+ });
768
+ ```
769
+
749
770
  ## Using Lambda Targets
750
771
 
751
772
  To use a Lambda Function as a target, use the integration class in the
@@ -0,0 +1,45 @@
1
+ import { ExpectedResult, IntegTest, Match } from '@aws-cdk/integ-tests-alpha';
2
+ import { Stack, aws_ec2 as ec2, aws_elasticloadbalancingv2 as elbv2, App } from 'aws-cdk-lib';
3
+
4
+ const app = new App();
5
+ const stack = new Stack(app, 'alb-target-group-attributes');
6
+
7
+ const vpc = new ec2.Vpc(stack, 'Stack');
8
+
9
+ const targetGroup = new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', {
10
+ vpc,
11
+ port: 80,
12
+ targetGroupHealth: {
13
+ dnsMinimumHealthyTargetCount: 3,
14
+ dnsMinimumHealthyTargetPercentage: 70,
15
+ routingMinimumHealthyTargetCount: 2,
16
+ routingMinimumHealthyTargetPercentage: 50,
17
+ },
18
+ });
19
+
20
+ const integTest = new IntegTest(app, 'alb-target-group-attributes-test', {
21
+ testCases: [stack],
22
+ });
23
+
24
+ integTest.assertions.awsApiCall('elbv2', 'describeTargetGroupAttributes', {
25
+ TargetGroupArn: targetGroup.targetGroupArn,
26
+ }).expect(ExpectedResult.objectLike({
27
+ Attributes: Match.arrayWith([
28
+ {
29
+ Key: 'target_group_health.unhealthy_state_routing.minimum_healthy_targets.percentage',
30
+ Value: '50',
31
+ },
32
+ {
33
+ Key: 'target_group_health.dns_failover.minimum_healthy_targets.percentage',
34
+ Value: '70',
35
+ },
36
+ {
37
+ Key: 'target_group_health.unhealthy_state_routing.minimum_healthy_targets.count',
38
+ Value: '2',
39
+ },
40
+ {
41
+ Key: 'target_group_health.dns_failover.minimum_healthy_targets.count',
42
+ Value: '3',
43
+ },
44
+ ]),
45
+ }));
@@ -0,0 +1,45 @@
1
+ import { ExpectedResult, IntegTest, Match } from '@aws-cdk/integ-tests-alpha';
2
+ import { Stack, aws_ec2 as ec2, aws_elasticloadbalancingv2 as elbv2, App } from 'aws-cdk-lib';
3
+
4
+ const app = new App();
5
+ const stack = new Stack(app, 'nlb-target-group-attributes');
6
+
7
+ const vpc = new ec2.Vpc(stack, 'Stack');
8
+
9
+ const targetGroup = new elbv2.NetworkTargetGroup(stack, 'TargetGroup', {
10
+ vpc,
11
+ port: 80,
12
+ targetGroupHealth: {
13
+ dnsMinimumHealthyTargetCount: 3,
14
+ dnsMinimumHealthyTargetPercentage: 70,
15
+ routingMinimumHealthyTargetCount: 2,
16
+ routingMinimumHealthyTargetPercentage: 50,
17
+ },
18
+ });
19
+
20
+ const integTest = new IntegTest(app, 'nlb-target-group-attributes-test', {
21
+ testCases: [stack],
22
+ });
23
+
24
+ integTest.assertions.awsApiCall('elbv2', 'describeTargetGroupAttributes', {
25
+ TargetGroupArn: targetGroup.targetGroupArn,
26
+ }).expect(ExpectedResult.objectLike({
27
+ Attributes: Match.arrayWith([
28
+ {
29
+ Key: 'target_group_health.unhealthy_state_routing.minimum_healthy_targets.count',
30
+ Value: '2',
31
+ },
32
+ {
33
+ Key: 'target_group_health.unhealthy_state_routing.minimum_healthy_targets.percentage',
34
+ Value: '50',
35
+ },
36
+ {
37
+ Key: 'target_group_health.dns_failover.minimum_healthy_targets.count',
38
+ Value: '3',
39
+ },
40
+ {
41
+ Key: 'target_group_health.dns_failover.minimum_healthy_targets.percentage',
42
+ Value: '70',
43
+ },
44
+ ]),
45
+ }));
@@ -356,4 +356,21 @@ const archive = new Archive(stack, 'Archive', {
356
356
  ```
357
357
 
358
358
  To enable archives or schema discovery on an event bus, customers has the choice of using either an AWS owned key or a customer managed key.
359
- For more information, see [KMS key options for event bus encryption](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption-at-rest-key-options.html).
359
+ For more information, see [KMS key options for event bus encryption](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption-at-rest-key-options.html).
360
+
361
+ ## Configuring logging
362
+
363
+ To configure logging for an Event Bus, leverage the LogConfig property. It allows different level of logging (NONE, INFO, TRACE, ERROR) and wether to include details or not.
364
+
365
+ ```ts
366
+ import { EventBus, IncludeDetail, Level } from 'aws-cdk-lib/aws-events';
367
+
368
+ const bus = new EventBus(this, 'Bus', {
369
+ logConfig: {
370
+ includeDetail: IncludeDetail.FULL,
371
+ level: Level.TRACE,
372
+ },
373
+ });
374
+ ```
375
+
376
+ See more [Specifying event bus log level](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus-logs.html#eb-event-bus-logs-level)
@@ -2,21 +2,31 @@ import * as iam from 'aws-cdk-lib/aws-iam';
2
2
  import * as sqs from 'aws-cdk-lib/aws-sqs';
3
3
  import { App, Stack } from 'aws-cdk-lib';
4
4
  import { IntegTest } from '@aws-cdk/integ-tests-alpha';
5
- import { EventBus } from 'aws-cdk-lib/aws-events';
5
+ import { EventBus, IncludeDetail, Level } from 'aws-cdk-lib/aws-events';
6
6
 
7
7
  const app = new App();
8
8
  const stack = new Stack(app, 'Stack');
9
9
 
10
10
  const dlq = new sqs.Queue(stack, 'DLQ');
11
11
 
12
+ const eventBusRole = new iam.Role(stack, 'EventBusRole', {
13
+ assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
14
+ description: 'Role for accessing EventBus',
15
+ roleName: 'EventBusAccessRole',
16
+ });
17
+
12
18
  const bus = new EventBus(stack, 'Bus', {
13
19
  deadLetterQueue: dlq,
14
20
  description: 'myEventBus',
21
+ logConfig: {
22
+ includeDetail: IncludeDetail.FULL,
23
+ level: Level.ERROR,
24
+ },
15
25
  });
16
26
 
17
27
  bus.addToResourcePolicy(new iam.PolicyStatement({
18
28
  effect: iam.Effect.ALLOW,
19
- principals: [new iam.AccountPrincipal(stack.account)],
29
+ principals: [eventBusRole],
20
30
  actions: ['events:PutEvents'],
21
31
  sid: 'Statement1',
22
32
  resources: [bus.eventBusArn],
@@ -24,7 +34,7 @@ bus.addToResourcePolicy(new iam.PolicyStatement({
24
34
 
25
35
  bus.addToResourcePolicy(new iam.PolicyStatement({
26
36
  effect: iam.Effect.ALLOW,
27
- principals: [new iam.AccountPrincipal(stack.account)],
37
+ principals: [eventBusRole],
28
38
  actions: ['events:PutRule'],
29
39
  sid: 'Statement2',
30
40
  resources: [bus.eventBusArn],
@@ -134,6 +134,30 @@ new route53.AaaaRecord(this, 'Alias', {
134
134
  });
135
135
  ```
136
136
 
137
+ To add an HTTPS record:
138
+
139
+ ``` ts
140
+ import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
141
+
142
+ declare const myZone: route53.HostedZone;
143
+ declare const distribution: cloudfront.CloudFrontWebDistribution;
144
+ // Alias to CloudFront target
145
+ new route53.HttpsRecord(this, 'HttpsRecord-CloudFrontAlias', {
146
+ zone: myZone,
147
+ target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
148
+ });
149
+ // ServiceMode (priority >= 1)
150
+ new route53.HttpsRecord(this, 'HttpsRecord-ServiceMode', {
151
+ zone: myZone,
152
+ values: [route53.HttpsRecordValue.service({ alpn: [route53.Alpn.H3, route53.Alpn.H2] })],
153
+ });
154
+ // AliasMode (priority = 0)
155
+ new route53.HttpsRecord(this, 'HttpsRecord-AliasMode', {
156
+ zone: myZone,
157
+ values: [route53.HttpsRecordValue.alias('service.example.com')],
158
+ });
159
+ ```
160
+
137
161
  [Geolocation routing](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-geo.html) can be enabled for continent, country or subdivision:
138
162
 
139
163
  ```ts
@@ -1,6 +1,6 @@
1
1
  import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
2
  import * as cdk from 'aws-cdk-lib';
3
- import { ARecord, CaaAmazonRecord, CnameRecord, Continent, GeoLocation, PrivateHostedZone, PublicHostedZone, RecordTarget, TxtRecord } from 'aws-cdk-lib/aws-route53';
3
+ import { Alpn, ARecord, CaaAmazonRecord, CnameRecord, Continent, GeoLocation, HttpsRecord, HttpsRecordValue, PrivateHostedZone, PublicHostedZone, RecordTarget, SvcbRecord, SvcbRecordValue, TxtRecord } from 'aws-cdk-lib/aws-route53';
4
4
 
5
5
  const app = new cdk.App();
6
6
 
@@ -92,6 +92,56 @@ new TxtRecord(stack, 'TXT', {
92
92
  ],
93
93
  });
94
94
 
95
+ new SvcbRecord(stack, 'SVCB-AliasMode', {
96
+ zone: publicZone,
97
+ recordName: '_8080._svcb-alias',
98
+ values: [SvcbRecordValue.alias('service.example.com')],
99
+ });
100
+ new SvcbRecord(stack, 'SVCB-ServiceMode', {
101
+ zone: publicZone,
102
+ recordName: '_8080._svcb-service',
103
+ values: [SvcbRecordValue.service({ alpn: [Alpn.H3, Alpn.H2] })],
104
+ });
105
+ new SvcbRecord(stack, 'SVCB-ServiceMode-FullParams', {
106
+ zone: publicZone,
107
+ recordName: '_8080._svcb-service-fullparams',
108
+ values: [SvcbRecordValue.service({
109
+ priority: 2,
110
+ targetName: 'service.example.com',
111
+ mandatory: ['alpn'],
112
+ alpn: [Alpn.H3, Alpn.H2, Alpn.HTTP1_1, Alpn.of('h3-29')],
113
+ noDefaultAlpn: true,
114
+ port: 8443,
115
+ ipv4hint: ['127.0.0.1'],
116
+ ipv6hint: ['::1'],
117
+ })],
118
+ });
119
+
120
+ new HttpsRecord(stack, 'HTTPS-AliasMode', {
121
+ zone: publicZone,
122
+ recordName: 'https-alias',
123
+ values: [HttpsRecordValue.alias('service.example.com')],
124
+ });
125
+ new HttpsRecord(stack, 'HTTPS-ServiceMode', {
126
+ zone: publicZone,
127
+ recordName: 'https-service',
128
+ values: [HttpsRecordValue.service({ alpn: [Alpn.H3, Alpn.H2] })],
129
+ });
130
+ new HttpsRecord(stack, 'HTTPS-ServiceMode-FullParams', {
131
+ zone: publicZone,
132
+ recordName: 'https-service-fullparams',
133
+ values: [HttpsRecordValue.service({
134
+ priority: 2,
135
+ targetName: 'service.example.com',
136
+ mandatory: ['alpn'],
137
+ alpn: [Alpn.H3, Alpn.H2, Alpn.HTTP1_1, Alpn.of('h3-29')],
138
+ noDefaultAlpn: true,
139
+ port: 8443,
140
+ ipv4hint: ['127.0.0.1'],
141
+ ipv6hint: ['::1'],
142
+ })],
143
+ });
144
+
95
145
  new cdk.CfnOutput(stack, 'PrivateZoneId', { value: privateZone.hostedZoneId });
96
146
  new cdk.CfnOutput(stack, 'PublicZoneId', { value: publicZone.hostedZoneId });
97
147
 
@@ -3,6 +3,7 @@ import * as route53 from 'aws-cdk-lib/aws-route53';
3
3
  import * as s3 from 'aws-cdk-lib/aws-s3';
4
4
  import * as cdk from 'aws-cdk-lib';
5
5
  import * as targets from 'aws-cdk-lib/aws-route53-targets';
6
+ import { IntegTest } from '@aws-cdk/integ-tests-alpha';
6
7
 
7
8
  const app = new cdk.App();
8
9
 
@@ -31,4 +32,18 @@ new route53.ARecord(zone, 'Alias', {
31
32
  target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
32
33
  });
33
34
 
34
- app.synth();
35
+ new route53.AaaaRecord(zone, 'AaaaAlias', {
36
+ zone,
37
+ recordName: '_foo',
38
+ target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
39
+ });
40
+
41
+ new route53.HttpsRecord(zone, 'HttpsAlias', {
42
+ zone,
43
+ recordName: '_foo',
44
+ target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
45
+ });
46
+
47
+ new IntegTest(app, 'aws-cdk-route53-cloudfront-alias-integ-test', {
48
+ testCases: [stack],
49
+ });
@@ -962,6 +962,18 @@ new tasks.EmrCreateCluster(this, 'SpotSpecification', {
962
962
  });
963
963
  ```
964
964
 
965
+ You can [customize EBS root device volume](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami-root-volume-size.html).
966
+
967
+ ```ts
968
+ new tasks.EmrCreateCluster(this, 'Create Cluster', {
969
+ instances: {},
970
+ name: 'ClusterName',
971
+ ebsRootVolumeIops: 4000,
972
+ ebsRootVolumeSize: Size.gibibytes(20),
973
+ ebsRootVolumeThroughput: 200,
974
+ });
975
+ ```
976
+
965
977
  If you want to run multiple steps in [parallel](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-concurrent-steps.html),
966
978
  you can specify the `stepConcurrencyLevel` property. The concurrency range is between 1
967
979
  and 256 inclusive, where the default concurrency of 1 means no step concurrency is allowed.
@@ -987,6 +999,47 @@ new tasks.EmrCreateCluster(this, 'Create Cluster', {
987
999
  });
988
1000
  ```
989
1001
 
1002
+ If you want to use [managed scaling](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-scaling.html),
1003
+ you can specify the `managedScalingPolicy` property.
1004
+
1005
+ ```ts
1006
+ new tasks.EmrCreateCluster(this, 'CreateCluster', {
1007
+ instances: {
1008
+ instanceFleets: [
1009
+ {
1010
+ instanceFleetType: tasks.EmrCreateCluster.InstanceRoleType.CORE,
1011
+ instanceTypeConfigs: [
1012
+ {
1013
+ instanceType: 'm5.xlarge',
1014
+ },
1015
+ ],
1016
+ targetOnDemandCapacity: 1,
1017
+ },
1018
+ {
1019
+ instanceFleetType: tasks.EmrCreateCluster.InstanceRoleType.MASTER,
1020
+ instanceTypeConfigs: [
1021
+ {
1022
+ instanceType: 'm5.xlarge',
1023
+ },
1024
+ ],
1025
+ targetOnDemandCapacity: 1,
1026
+ },
1027
+ ],
1028
+ },
1029
+ name: 'ClusterName',
1030
+ releaseLabel: 'emr-7.9.0',
1031
+ managedScalingPolicy: {
1032
+ computeLimits: {
1033
+ unitType: tasks.EmrCreateCluster.ComputeLimitsUnitType.INSTANCE_FLEET_UNITS,
1034
+ maximumCapacityUnits: 4,
1035
+ minimumCapacityUnits: 1,
1036
+ maximumOnDemandCapacityUnits: 4,
1037
+ maximumCoreCapacityUnits: 2,
1038
+ },
1039
+ },
1040
+ });
1041
+ ```
1042
+
990
1043
  ### Termination Protection
991
1044
 
992
1045
  Locks a cluster (job flow) so the EC2 instances in the cluster cannot be
@@ -0,0 +1,126 @@
1
+ import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
2
+ import { App, Duration, Size, Stack, Tags } from 'aws-cdk-lib';
3
+ import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';
4
+ import { EmrCreateCluster } from 'aws-cdk-lib/aws-stepfunctions-tasks';
5
+ import { Vpc } from 'aws-cdk-lib/aws-ec2';
6
+
7
+ const app = new App();
8
+
9
+ const stack = new Stack(app, 'emr-create-cluster-ebs');
10
+ const vpc = new Vpc(stack, 'Vpc', { restrictDefaultSecurityGroup: false });
11
+
12
+ const releaseLabel = 'emr-7.10.0';
13
+ const ebsRootVolumeIops = 4000;
14
+ const ebsRootVolumeSize = 20;
15
+ const ebsRootVolumeThroughput = 200;
16
+ const unitType = EmrCreateCluster.ComputeLimitsUnitType.INSTANCE_FLEET_UNITS;
17
+ const maximumCapacityUnits = 4;
18
+ const minimumCapacityUnits = 1;
19
+ const maximumOnDemandCapacityUnits = 4;
20
+ const maximumCoreCapacityUnits = 2;
21
+
22
+ // https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-iam-policies.html#manually-tagged-resources
23
+ Tags.of(vpc).add('for-use-with-amazon-emr-managed-policies', 'true');
24
+
25
+ const step = new EmrCreateCluster(stack, 'EmrCreateCluster', {
26
+ instances: {
27
+ instanceFleets: [
28
+ {
29
+ instanceFleetType: EmrCreateCluster.InstanceRoleType.CORE,
30
+ instanceTypeConfigs: [
31
+ {
32
+ instanceType: 'm5.xlarge',
33
+ },
34
+ ],
35
+ targetOnDemandCapacity: 1,
36
+ },
37
+ {
38
+ instanceFleetType: EmrCreateCluster.InstanceRoleType.MASTER,
39
+ instanceTypeConfigs: [
40
+ {
41
+ instanceType: 'm5.xlarge',
42
+ },
43
+ ],
44
+ targetOnDemandCapacity: 1,
45
+ },
46
+ ],
47
+ ec2SubnetId: vpc.publicSubnets[0].subnetId,
48
+ },
49
+ name: 'Cluster',
50
+ releaseLabel,
51
+ integrationPattern: sfn.IntegrationPattern.RUN_JOB,
52
+ ebsRootVolumeIops,
53
+ ebsRootVolumeSize: Size.gibibytes(ebsRootVolumeSize),
54
+ ebsRootVolumeThroughput,
55
+ managedScalingPolicy: {
56
+ computeLimits: {
57
+ unitType,
58
+ maximumCapacityUnits,
59
+ minimumCapacityUnits,
60
+ maximumOnDemandCapacityUnits,
61
+ maximumCoreCapacityUnits,
62
+ },
63
+ },
64
+ });
65
+
66
+ const sm = new sfn.StateMachine(stack, 'SM', {
67
+ definition: step,
68
+ });
69
+
70
+ const integTest = new IntegTest(app, 'emr-create-cluster-ebs-integ', {
71
+ testCases: [stack],
72
+ });
73
+
74
+ const start = integTest.assertions.awsApiCall('StepFunctions', 'startExecution', {
75
+ stateMachineArn: sm.stateMachineArn,
76
+ });
77
+
78
+ const describeExecution = integTest.assertions.awsApiCall('StepFunctions', 'describeExecution', {
79
+ executionArn: start.getAttString('executionArn'),
80
+ });
81
+ start.next(describeExecution);
82
+
83
+ const waitForExecution = describeExecution.expect(ExpectedResult.objectLike({
84
+ status: 'SUCCEEDED',
85
+ })).waitForAssertions({
86
+ interval: Duration.seconds(30),
87
+ totalTimeout: Duration.minutes(5),
88
+ });
89
+
90
+ const getClusterId = integTest.assertions.awsApiCall('StepFunctions', 'describeExecution', {
91
+ executionArn: start.getAttString('executionArn'),
92
+ });
93
+ waitForExecution.next(getClusterId);
94
+
95
+ const clusterId = getClusterId.getAttString('output.ClusterId');
96
+
97
+ const describeCluster = integTest.assertions.awsApiCall('Emr', 'describeCluster', {
98
+ ClusterId: clusterId,
99
+ });
100
+ getClusterId.next(describeCluster);
101
+
102
+ describeCluster.expect(ExpectedResult.objectLike({
103
+ Cluster: {
104
+ ReleaseLabel: releaseLabel,
105
+ EbsRootVolumeIops: ebsRootVolumeIops,
106
+ EbsRootVolumeSize: ebsRootVolumeSize,
107
+ EbsRootVolumeThroughput: ebsRootVolumeThroughput,
108
+ },
109
+ }));
110
+
111
+ const getManagedScalingPolicy = integTest.assertions.awsApiCall('Emr', 'getManagedScalingPolicy', {
112
+ ClusterId: clusterId,
113
+ });
114
+ describeCluster.next(getManagedScalingPolicy);
115
+
116
+ getManagedScalingPolicy.expect(ExpectedResult.objectLike({
117
+ ManagedScalingPolicy: {
118
+ ComputeLimits: {
119
+ UnitType: unitType,
120
+ MaximumCapacityUnits: maximumCapacityUnits,
121
+ MinimumCapacityUnits: minimumCapacityUnits,
122
+ MaximumOnDemandCapacityUnits: maximumOnDemandCapacityUnits,
123
+ MaximumCoreCapacityUnits: maximumCoreCapacityUnits,
124
+ },
125
+ },
126
+ }));