konokenj.cdk-api-mcp-server 0.48.0__py3-none-any.whl → 0.50.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 (79) hide show
  1. cdk_api_mcp_server/__about__.py +1 -1
  2. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-amplify-alpha/README.md +12 -0
  3. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-bedrock-agentcore-alpha/README.md +796 -0
  4. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-eks-v2-alpha/README.md +116 -29
  5. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-msk-alpha/README.md +8 -8
  6. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/mixins-preview/README.md +16 -0
  7. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.api-with-authorizer-and-proxy.ts +1 -1
  8. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.lambda-api.ts +1 -1
  9. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.iam.ts +1 -1
  10. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.lambda.ts +2 -2
  11. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.user-pool.ts +1 -1
  12. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.add-subroute-integration.ts +7 -4
  13. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.http-proxy.ts +1 -1
  14. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda-proxy.ts +1 -1
  15. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda.ts +4 -4
  16. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-appsync/integ.graphql-lambda-permission.ts +1 -1
  17. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-appsync/integ.js-resolver.ts +1 -1
  18. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/README.md +15 -1
  19. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/integ.managed-compute-environment-default-instance-class.ts +20 -0
  20. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudformation/integ.core-custom-resources-node-18.ts +1 -1
  21. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudformation/integ.core-custom-resources-service-timeout.ts +1 -1
  22. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/README.md +33 -0
  23. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/integ.function-url-origin-ip-address-type.ts +84 -0
  24. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/integ.origin-response-completion-timeout.ts +1 -1
  25. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudtrail/integ.cloudtrail-data-events-only.ts +1 -1
  26. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/README.md +1 -1
  27. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.anomaly-detection-alarm.ts +44 -2
  28. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/README.md +15 -0
  29. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.client-vpn-endpoint-disconnect-on-session-timeout.ts +65 -0
  30. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr/README.md +40 -1
  31. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr/integ.tag-mutability-exclusion.ts +30 -0
  32. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +3 -0
  33. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.managedinstances-capacity-provider.ts +5 -3
  34. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.managedinstances-no-default-capacity-provider.ts +107 -0
  35. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs-patterns/integ.alb-fargate-service-public-private-switch.ts +45 -0
  36. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/README.md +20 -0
  37. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-cluster-removal-policy.ts +31 -0
  38. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.alb-lambda-multi-value-headers.ts +1 -1
  39. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.alb.oidc.ts +1 -1
  40. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2-actions/integ.cognito.ts +1 -1
  41. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesis/README.md +42 -0
  42. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesis/integ.stream-shard-level-monitoring.ts +47 -0
  43. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/README.md +96 -0
  44. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/integ.record-format-conversion-schema.ts +154 -0
  45. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/integ.record-format-conversion.ts +178 -0
  46. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/README.md +9 -0
  47. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.binary-payload.ts +1 -1
  48. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.logging-config.ts +8 -8
  49. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.params-and-secrets.ts +1 -1
  50. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime-management.ts +1 -1
  51. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime.inlinecode.ts +0 -7
  52. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.dependencies-pnpm.ts +1 -1
  53. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.function-exclude-smithy-models.ts +2 -2
  54. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.nodejs.build.images.ts +1 -1
  55. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/README.md +4 -0
  56. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/integ.metricfilter-apply-on-transformed-logs.ts +29 -0
  57. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/integ.subscriptionfilter.ts +1 -1
  58. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-opensearchservice/integ.opensearch.min.ts +1 -0
  59. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-data-api-to-imported-cluster.ts +1 -1
  60. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-data-api.ts +1 -1
  61. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/README.md +12 -0
  62. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/integ.private-hosted-zone-from-attributes.ts +41 -0
  63. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-data.ts +4 -0
  64. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/README.md +1 -1
  65. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.call-aws-service-cross-region-lambda.ts +1 -1
  66. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke-json-path.ts +102 -0
  67. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/README.md +17 -1
  68. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary-runtime-validation.ts +43 -0
  69. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary.ts +2 -0
  70. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.aws-custom-resource.ts +1 -1
  71. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.custom-resource-config-lambda-node-runtime.ts +1 -1
  72. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.invoke-function-payload.ts +1 -1
  73. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +43 -1
  74. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/README.md +32 -1
  75. {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.50.0.dist-info}/METADATA +2 -2
  76. {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.50.0.dist-info}/RECORD +79 -63
  77. {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.50.0.dist-info}/WHEEL +0 -0
  78. {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.50.0.dist-info}/entry_points.txt +0 -0
  79. {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.50.0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -3,13 +3,13 @@
3
3
 
4
4
  ---
5
5
 
6
- ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
6
+ ![cdk-constructs: Developer Preview](https://img.shields.io/badge/cdk--constructs-developer--preview-informational.svg?style=for-the-badge)
7
7
 
8
- > The APIs of higher level constructs in this module are experimental and under active development.
9
- > They are subject to non-backward compatible changes or removal in any future version. These are
10
- > not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
11
- > announced in the release notes. This means that while you may use them, you may need to update
12
- > your source code when upgrading to a newer version of this package.
8
+ > The APIs of higher level constructs in this module are in **developer preview** before they
9
+ > become stable. We will only make breaking changes to address unforeseen API issues. Therefore,
10
+ > these APIs are not subject to [Semantic Versioning](https://semver.org/), and breaking changes
11
+ > will be announced in release notes. This means that while you may use them, you may need to
12
+ > update your source code when upgrading to a newer version of this package.
13
13
 
14
14
  ---
15
15
 
@@ -39,33 +39,88 @@ const cluster = new eks.Cluster(this, 'hello-eks', {
39
39
 
40
40
  ## Architecture
41
41
 
42
- ```text
43
- +-----------------------------------------------+
44
- | EKS Cluster | kubectl | |
45
- | -----------------|<--------+| Kubectl Handler |
46
- | AWS::EKS::Cluster (Optional) |
47
- | +--------------------+ +-----------------+ |
48
- | | | | | |
49
- | | Managed Node Group | | Fargate Profile | |
50
- | | | | | |
51
- | +--------------------+ +-----------------+ |
52
- +-----------------------------------------------+
53
- ^
54
- | connect self managed capacity
55
- +
56
- +--------------------+
57
- | Auto Scaling Group |
58
- +--------------------+
42
+ ```text +-----------------+
43
+ kubectl | |
44
+ +------------>| Kubectl Handler |
45
+ | | (Optional) |
46
+ | +-----------------+
47
+ +-------------------------------------+-------------------------------------+
48
+ | EKS Cluster (Auto Mode) |
49
+ | AWS::EKS::Cluster |
50
+ | |
51
+ | +---------------------------------------------------------------------+ |
52
+ | | Auto Mode Compute (Managed by EKS) (Default) | |
53
+ | | | |
54
+ | | - Automatically provisions EC2 instances | |
55
+ | | - Auto scaling based on pod requirements | |
56
+ | | - No manual node group configuration needed | |
57
+ | | | |
58
+ | +---------------------------------------------------------------------+ |
59
+ | |
60
+ +---------------------------------------------------------------------------+
59
61
  ```
60
62
 
61
63
  In a nutshell:
62
64
 
63
- - EKS Cluster - The cluster endpoint created by EKS.
64
- - Managed Node Group - EC2 worker nodes managed by EKS.
65
- - Fargate Profile - Fargate worker nodes managed by EKS.
66
- - Auto Scaling Group - EC2 worker nodes managed by the user.
67
- - Kubectl Handler (Optional) - Custom resource (i.e Lambda Function) for invoking kubectl commands on the
68
- cluster - created by CDK
65
+ - **[Auto Mode](#eks-auto-mode)** (Default) – The fully managed capacity mode in EKS.
66
+ EKS automatically provisions and scales EC2 capacity based on pod requirements.
67
+ It manages internal *system* and *general-purpose* NodePools, handles networking and storage setup, and removes the need for user-managed node groups or Auto Scaling Groups.
68
+
69
+ ```ts
70
+ const cluster = new eks.Cluster(this, 'AutoModeCluster', {
71
+ version: eks.KubernetesVersion.V1_33,
72
+ // Auto Mode is enabled by default
73
+ });
74
+ ```
75
+
76
+ - **[Managed Node Groups](#managed-node-groups)** – The semi-managed capacity mode.
77
+ EKS provisions and manages EC2 nodes on your behalf but you configure the instance types, scaling ranges, and update strategy.
78
+ AWS handles node health, draining, and rolling updates while you retain control over scaling and cost optimization.
79
+
80
+ You can also define *Fargate Profiles* that determine which pods or namespaces run on Fargate infrastructure.
81
+
82
+ ```ts
83
+ const cluster = new eks.Cluster(this, 'ManagedNodeCluster', {
84
+ version: eks.KubernetesVersion.V1_33,
85
+ defaultCapacityType: eks.DefaultCapacityType.NODEGROUP,
86
+ });
87
+
88
+ // Add a Fargate Profile for specific workloads (e.g., default namespace)
89
+ cluster.addFargateProfile('FargateProfile', {
90
+ selectors: [
91
+ { namespace: 'default' }, // Run pods in 'default' on Fargate
92
+ ],
93
+ });
94
+ ```
95
+
96
+ - **[Fargate Mode](#fargate-profiles)** – The Fargate capacity mode.
97
+ EKS runs your pods directly on AWS Fargate without provisioning EC2 nodes.
98
+
99
+ ```ts
100
+ const cluster = new eks.FargateCluster(this, 'FargateCluster', {
101
+ version: eks.KubernetesVersion.V1_33,
102
+ });
103
+ ```
104
+
105
+ - **[Self-Managed Nodes](#self-managed-capacity)** – The fully manual capacity mode.
106
+ You create and manage EC2 instances (via an Auto Scaling Group) and connect them to the cluster manually.
107
+ This provides maximum flexibility for custom AMIs or configurations but also the highest operational overhead.
108
+
109
+ ```ts
110
+ const cluster = new eks.Cluster(this, 'SelfManagedCluster', {
111
+ version: eks.KubernetesVersion.V1_33,
112
+ });
113
+
114
+ // Add self-managed Auto Scaling Group
115
+ cluster.addAutoScalingGroupCapacity('self-managed-asg', {
116
+ instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
117
+ minCapacity: 1,
118
+ maxCapacity: 5,
119
+ });
120
+ ```
121
+
122
+ - **[Kubectl Handler](#kubectl-support) (Optional)** – A Lambda-backed custom resource created by the AWS CDK to execute `kubectl` commands (like `apply` or `patch`) during deployment.
123
+ Regardless of the capacity mode, this handler may still be created to apply Kubernetes manifests as part of CDK provisioning.
69
124
 
70
125
  ## Provisioning cluster
71
126
 
@@ -327,6 +382,38 @@ pods running on Fargate. For ingress, we recommend that you use the [ALB Ingress
327
382
  Controller](https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html)
328
383
  on Amazon EKS (minimum version v1.1.4).
329
384
 
385
+ ### Self-managed capacity
386
+
387
+ Self-managed capacity gives you the most control over your worker nodes by allowing you to create and manage your own EC2 Auto Scaling Groups. This approach provides maximum flexibility for custom AMIs, instance configurations, and scaling policies, but requires more operational overhead.
388
+
389
+ You can add self-managed capacity to any cluster using the `addAutoScalingGroupCapacity` method:
390
+
391
+ ```ts
392
+ const cluster = new eks.Cluster(this, 'Cluster', {
393
+ version: eks.KubernetesVersion.V1_33,
394
+ });
395
+
396
+ cluster.addAutoScalingGroupCapacity('self-managed-nodes', {
397
+ instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
398
+ minCapacity: 1,
399
+ maxCapacity: 10,
400
+ desiredCapacity: 3,
401
+ });
402
+ ```
403
+
404
+ You can specify custom subnets for the Auto Scaling Group:
405
+
406
+ ```ts
407
+ declare const vpc: ec2.Vpc;
408
+ declare const cluster: eks.Cluster;
409
+
410
+ cluster.addAutoScalingGroupCapacity('custom-subnet-nodes', {
411
+ vpcSubnets: { subnets: vpc.privateSubnets },
412
+ instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
413
+ minCapacity: 2,
414
+ });
415
+ ```
416
+
330
417
  ### Endpoint Access
331
418
 
332
419
  When you create a new cluster, Amazon EKS creates an endpoint for the managed Kubernetes API server that you use to communicate with your cluster (using Kubernetes management tools such as `kubectl`)
@@ -23,7 +23,7 @@ The following example creates an MSK Cluster.
23
23
  declare const vpc: ec2.Vpc;
24
24
  const cluster = new msk.Cluster(this, 'Cluster', {
25
25
  clusterName: 'myCluster',
26
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
26
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
27
27
  vpc,
28
28
  });
29
29
  ```
@@ -36,7 +36,7 @@ To control who can access the Cluster, use the `.connections` attribute. For a l
36
36
  declare const vpc: ec2.Vpc;
37
37
  const cluster = new msk.Cluster(this, 'Cluster', {
38
38
  clusterName: 'myCluster',
39
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
39
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
40
40
  vpc,
41
41
  });
42
42
 
@@ -88,7 +88,7 @@ import * as acmpca from 'aws-cdk-lib/aws-acmpca';
88
88
  declare const vpc: ec2.Vpc;
89
89
  const cluster = new msk.Cluster(this, 'Cluster', {
90
90
  clusterName: 'myCluster',
91
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
91
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
92
92
  vpc,
93
93
  encryptionInTransit: {
94
94
  clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -113,7 +113,7 @@ Enable client authentication with [SASL/SCRAM](https://docs.aws.amazon.com/msk/l
113
113
  declare const vpc: ec2.Vpc;
114
114
  const cluster = new msk.Cluster(this, 'cluster', {
115
115
  clusterName: 'myCluster',
116
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
116
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
117
117
  vpc,
118
118
  encryptionInTransit: {
119
119
  clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -132,7 +132,7 @@ Enable client authentication with [IAM](https://docs.aws.amazon.com/msk/latest/d
132
132
  declare const vpc: ec2.Vpc;
133
133
  const cluster = new msk.Cluster(this, 'cluster', {
134
134
  clusterName: 'myCluster',
135
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
135
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
136
136
  vpc,
137
137
  encryptionInTransit: {
138
138
  clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -155,7 +155,7 @@ import * as acmpca from 'aws-cdk-lib/aws-acmpca';
155
155
  declare const vpc: ec2.Vpc;
156
156
  const cluster = new msk.Cluster(this, 'Cluster', {
157
157
  clusterName: 'myCluster',
158
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
158
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
159
159
  vpc,
160
160
  encryptionInTransit: {
161
161
  clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -186,7 +186,7 @@ declare const vpc: ec2.Vpc;
186
186
  declare const bucket: s3.IBucket;
187
187
  const cluster = new msk.Cluster(this, 'cluster', {
188
188
  clusterName: 'myCluster',
189
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
189
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
190
190
  vpc,
191
191
  logging: {
192
192
  s3: {
@@ -226,7 +226,7 @@ declare const bucket: s3.IBucket;
226
226
 
227
227
  const cluster = new msk.Cluster(this, 'cluster', {
228
228
  clusterName: 'myCluster',
229
- kafkaVersion: msk.KafkaVersion.V4_0_X_KRAFT,
229
+ kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
230
230
  vpc,
231
231
  storageMode: msk.StorageMode.TIERED,
232
232
  });
@@ -0,0 +1,16 @@
1
+ # CDK Mixins: Composable Abstractions for AWS Resources
2
+
3
+ <!--BEGIN STABILITY BANNER-->
4
+
5
+ ---
6
+
7
+ ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
8
+
9
+ > The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
10
+
11
+ ---
12
+
13
+ <!--END STABILITY BANNER-->
14
+
15
+ Implementation of the CDK Mixins proposal.
16
+ See <https://github.com/aws/aws-cdk-rfcs/pull/824> for details.
@@ -42,7 +42,7 @@ const sendResource = root.addResource('InitiateAction');
42
42
  const myfunc = new lambda.Function(stack, 'lambda-s3', {
43
43
  code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')),
44
44
  handler: 'index.handler',
45
- runtime: lambda.Runtime.NODEJS_18_X,
45
+ runtime: lambda.Runtime.NODEJS_20_X,
46
46
  });
47
47
 
48
48
  const sendLambdaIntegration = new agw.LambdaIntegration(myfunc);
@@ -19,7 +19,7 @@ class LambdaApiIntegrationOptionsStack extends Stack {
19
19
  headers: { 'Content-Type': '*/*' }
20
20
  };
21
21
  }`),
22
- runtime: Runtime.NODEJS_18_X,
22
+ runtime: Runtime.NODEJS_20_X,
23
23
  handler: 'index.handler',
24
24
  });
25
25
 
@@ -19,7 +19,7 @@ const userAccessKey = new iam.AccessKey(stack, 'UserAccess', {
19
19
  });
20
20
 
21
21
  const handler = new Function(stack, 'auth-function', {
22
- runtime: Runtime.NODEJS_18_X,
22
+ runtime: Runtime.NODEJS_20_X,
23
23
  code: Code.fromInline('exports.handler = () => {return true}'),
24
24
  handler: 'index.handler',
25
25
  });
@@ -20,7 +20,7 @@ const app = new App({
20
20
  const stack = new Stack(app, 'AuthorizerInteg');
21
21
 
22
22
  const authHandler = new lambda.Function(stack, 'auth-function', {
23
- runtime: lambda.Runtime.NODEJS_18_X,
23
+ runtime: lambda.Runtime.NODEJS_20_X,
24
24
  handler: 'index.handler',
25
25
  code: lambda.Code.fromAsset(path.join(__dirname, '..', 'auth-handler'), { exclude: ['*.ts'] }),
26
26
  });
@@ -43,7 +43,7 @@ const httpApiWithDefaultAuthorizer = new HttpApi(stack, 'MyHttpApiWithDefaultAut
43
43
  });
44
44
 
45
45
  const handler = new lambda.Function(stack, 'lambda', {
46
- runtime: lambda.Runtime.NODEJS_18_X,
46
+ runtime: lambda.Runtime.NODEJS_20_X,
47
47
  handler: 'index.handler',
48
48
  code: lambda.AssetCode.fromAsset(path.join(__dirname, '..', 'integ.lambda.handler'), { exclude: ['*.ts'] }),
49
49
  });
@@ -33,7 +33,7 @@ const httpApiWithDefaultAuthorizer = new HttpApi(stack, 'MyHttpApiWithDefaultAut
33
33
  });
34
34
 
35
35
  const handler = new lambda.Function(stack, 'lambda', {
36
- runtime: lambda.Runtime.NODEJS_18_X,
36
+ runtime: lambda.Runtime.NODEJS_20_X,
37
37
  handler: 'index.handler',
38
38
  code: lambda.AssetCode.fromAsset(path.join(__dirname, '..', 'integ.user-pool.handler'), { exclude: ['*.ts'] }),
39
39
  });
@@ -15,7 +15,7 @@ const httpApi = new HttpApi(stack, 'test-apigwv2-add-subroute-integration');
15
15
 
16
16
  // Regular Lambda Function
17
17
  const lambdaHandler = new lambda.Function(stack, 'first-lambda-function', {
18
- runtime: lambda.Runtime.NODEJS_18_X,
18
+ runtime: lambda.Runtime.NODEJS_20_X,
19
19
  handler: 'index.handler',
20
20
  code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: \'success-hit-first-lambda\' }; };'),
21
21
  });
@@ -23,7 +23,7 @@ const lambdaHandlerIntegration = new HttpLambdaIntegration('my-lambda-integratio
23
23
 
24
24
  // Lambda created with Function.fromFunctionAttributes()
25
25
  const secondLambdaHandler = new lambda.Function(stack, 'second-lambda-function', {
26
- runtime: lambda.Runtime.NODEJS_18_X,
26
+ runtime: lambda.Runtime.NODEJS_20_X,
27
27
  handler: 'index.handler',
28
28
  code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: \'success-hit-second-lambda\' }; };'),
29
29
  });
@@ -35,8 +35,8 @@ const lambdaFromFunctionAttributesIntegration = new HttpLambdaIntegration('my-re
35
35
 
36
36
  // Lambda created with Function.fromFunctionName()
37
37
  const thirdLambdaName = 'third-lambda-function';
38
- new lambda.Function(stack, thirdLambdaName, {
39
- runtime: lambda.Runtime.NODEJS_18_X,
38
+ const thirdLambdaFunction = new lambda.Function(stack, thirdLambdaName, {
39
+ runtime: lambda.Runtime.NODEJS_20_X,
40
40
  handler: 'index.handler',
41
41
  code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: \'success-hit-third-lambda\' }; };'),
42
42
  functionName: thirdLambdaName,
@@ -83,6 +83,9 @@ httpApi.addRoutes({
83
83
  integration: lambdaFromFunctionNameIntegration,
84
84
  });
85
85
 
86
+ httpApi.node.addDependency(secondLambdaHandler);
87
+ httpApi.node.addDependency(thirdLambdaFunction);
88
+
86
89
  // Integ Test Assertions
87
90
  const integ = new IntegTest(app, 'Integ', { testCases: [stack] });
88
91
 
@@ -29,7 +29,7 @@ new CfnOutput(stack, 'Endpoint', {
29
29
 
30
30
  function lambdaProxyEndpoint(s: Stack): HttpApi {
31
31
  const handler = new lambda.Function(s, 'AlwaysSuccess', {
32
- runtime: lambda.Runtime.NODEJS_18_X,
32
+ runtime: lambda.Runtime.NODEJS_20_X,
33
33
  handler: 'index.handler',
34
34
  code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: "success" }; };'),
35
35
  });
@@ -17,7 +17,7 @@ const app = new App({
17
17
  const stack = new Stack(app, 'integ-lambda-proxy');
18
18
 
19
19
  const handler = new lambda.Function(stack, 'AlwaysSuccess', {
20
- runtime: lambda.Runtime.NODEJS_18_X,
20
+ runtime: lambda.Runtime.NODEJS_20_X,
21
21
  handler: 'index.handler',
22
22
  code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: "success" }; };'),
23
23
  });
@@ -19,25 +19,25 @@ const app = new App({
19
19
  const stack = new Stack(app, 'WebSocketApiInteg');
20
20
 
21
21
  const connectHandler = new lambda.Function(stack, 'ConnectHandler', {
22
- runtime: lambda.Runtime.NODEJS_18_X,
22
+ runtime: lambda.Runtime.NODEJS_20_X,
23
23
  handler: 'index.handler',
24
24
  code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "connected" }; };'),
25
25
  });
26
26
 
27
27
  const disconnetHandler = new lambda.Function(stack, 'DisconnectHandler', {
28
- runtime: lambda.Runtime.NODEJS_18_X,
28
+ runtime: lambda.Runtime.NODEJS_20_X,
29
29
  handler: 'index.handler',
30
30
  code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "disconnected" }; };'),
31
31
  });
32
32
 
33
33
  const defaultHandler = new lambda.Function(stack, 'DefaultHandler', {
34
- runtime: lambda.Runtime.NODEJS_18_X,
34
+ runtime: lambda.Runtime.NODEJS_20_X,
35
35
  handler: 'index.handler',
36
36
  code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "default" }; };'),
37
37
  });
38
38
 
39
39
  const messageHandler = new lambda.Function(stack, 'MessageHandler', {
40
- runtime: lambda.Runtime.NODEJS_18_X,
40
+ runtime: lambda.Runtime.NODEJS_20_X,
41
41
  handler: 'index.handler',
42
42
  code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "received" }; };'),
43
43
  });
@@ -16,7 +16,7 @@ const app = new cdk.App({
16
16
  const stack = new cdk.Stack(app, 'aws-graphql-lambda-permissions');
17
17
 
18
18
  const authorizer = new lambda.Function(stack, 'AuthorizerFunction', {
19
- runtime: lambda.Runtime.NODEJS_18_X,
19
+ runtime: lambda.Runtime.NODEJS_20_X,
20
20
  code: lambda.Code.fromInline(`
21
21
  exports.handler = async (event) => {
22
22
  console.log("Authorization event:", JSON.stringify(event));
@@ -64,7 +64,7 @@ const integ = new IntegTest(app, 'JsResolverIntegTest', { testCases: [stack] });
64
64
  const invoke = new lambda.Function(stack, 'InvokeApi', {
65
65
  code: lambda.Code.fromAsset(path.join(__dirname, 'integ-assets', 'js-resolver-assertion')),
66
66
  handler: 'index.handler',
67
- runtime: lambda.Runtime.NODEJS_18_X,
67
+ runtime: lambda.Runtime.NODEJS_20_X,
68
68
  });
69
69
 
70
70
  const addTestInvoke = integ.assertions.invokeFunction({
@@ -65,7 +65,18 @@ For stateful or otherwise non-interruption-tolerant workflows, omit `spot` or se
65
65
 
66
66
  #### Choosing Your Instance Types
67
67
 
68
- Batch allows you to choose the instance types or classes that will run your workload.
68
+ Batch allows you to choose most up-to-date instance classes based on your region.
69
+ This example configures your `ComputeEnvironment` to use only ARM64 instance:
70
+
71
+ ```ts
72
+ const vpc = new ec2.Vpc(this, 'VPC');
73
+
74
+ new batch.ManagedEc2EcsComputeEnvironment(this, 'myEc2ComputeEnv', {
75
+ vpc,
76
+ defaultInstanceClasses: [batch.DefaultInstanceClass.ARM64],
77
+ });
78
+ ```
79
+
69
80
  This example configures your `ComputeEnvironment` to use only the `M5AD.large` instance:
70
81
 
71
82
  ```ts
@@ -91,6 +102,9 @@ new batch.ManagedEc2EcsComputeEnvironment(this, 'myEc2ComputeEnv', {
91
102
  });
92
103
  ```
93
104
 
105
+ > [!WARNING]
106
+ > `useOptimalInstanceClasses` is deprecated! Use `defaultInstanceClasses` instead.
107
+
94
108
  Unless you explicitly specify `useOptimalInstanceClasses: false`, this compute environment will use `'optimal'` instances,
95
109
  which tells Batch to pick an instance from the C4, M4, and R4 instance families.
96
110
  *Note*: Batch does not allow specifying instance types or classes with different architectures.
@@ -0,0 +1,20 @@
1
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
+ import { App, Stack } from 'aws-cdk-lib';
3
+ import * as integ from '@aws-cdk/integ-tests-alpha';
4
+ import { ManagedEc2EcsComputeEnvironment, EcsMachineImageType, DefaultInstanceClass } from 'aws-cdk-lib/aws-batch';
5
+
6
+ const app = new App();
7
+ const stack = new Stack(app, 'managed-compute-environment-default-instance-class');
8
+ const vpc = new ec2.Vpc(stack, 'vpc', { restrictDefaultSecurityGroup: false });
9
+
10
+ new ManagedEc2EcsComputeEnvironment(stack, 'ECS', {
11
+ vpc,
12
+ images: [{
13
+ imageType: EcsMachineImageType.ECS_AL2023,
14
+ }],
15
+ defaultInstanceClasses: [DefaultInstanceClass.ARM64],
16
+ });
17
+
18
+ new integ.IntegTest(app, 'integ-managed-compute-environment-default-instance-class', {
19
+ testCases: [stack],
20
+ });
@@ -21,7 +21,7 @@ class TestStack extends Stack {
21
21
 
22
22
  const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, {
23
23
  codeDirectory: `${__dirname}/core-custom-resource-provider-fixture`,
24
- runtime: CustomResourceProviderRuntime.NODEJS_18_X,
24
+ runtime: CustomResourceProviderRuntime.NODEJS_20_X,
25
25
  description: 'veni vidi vici',
26
26
  });
27
27
 
@@ -16,7 +16,7 @@ class TestStack extends Stack {
16
16
 
17
17
  const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, {
18
18
  codeDirectory: `${__dirname}/core-custom-resource-provider-fixture`,
19
- runtime: CustomResourceProviderRuntime.NODEJS_18_X,
19
+ runtime: CustomResourceProviderRuntime.NODEJS_20_X,
20
20
  description: 'veni vidi vici',
21
21
  });
22
22
 
@@ -851,6 +851,39 @@ new cloudfront.Distribution(this, 'Distribution', {
851
851
  });
852
852
  ```
853
853
 
854
+ ### Configuring IP Address Type
855
+
856
+ You can specify which IP protocol CloudFront uses when connecting to your Lambda Function URL origin. By default, CloudFront uses IPv4 only.
857
+
858
+ ```ts
859
+ import * as lambda from 'aws-cdk-lib/aws-lambda';
860
+ import { OriginIpAddressType } from 'aws-cdk-lib/aws-cloudfront';
861
+
862
+ declare const fn: lambda.Function;
863
+ const fnUrl = fn.addFunctionUrl({ authType: lambda.FunctionUrlAuthType.NONE });
864
+
865
+ // Uses default IPv4 only
866
+ new cloudfront.Distribution(this, 'Distribution', {
867
+ defaultBehavior: {
868
+ origin: new origins.FunctionUrlOrigin(fnUrl)
869
+ },
870
+ });
871
+
872
+ // Explicitly specify IP address type
873
+ new cloudfront.Distribution(this, 'Distribution', {
874
+ defaultBehavior: {
875
+ origin: new origins.FunctionUrlOrigin(fnUrl, {
876
+ ipAddressType: OriginIpAddressType.DUALSTACK, // Use both IPv4 and IPv6
877
+ })
878
+ },
879
+ });
880
+ ```
881
+
882
+ Supported values for `ipAddressType`:
883
+ - `OriginIpAddressType.IPV4` - CloudFront uses IPv4 only to connect to the origin (default)
884
+ - `OriginIpAddressType.IPV6` - CloudFront uses IPv6 only to connect to the origin
885
+ - `OriginIpAddressType.DUALSTACK` - CloudFront uses both IPv4 and IPv6 to connect to the origin
886
+
854
887
  ### Lambda Function URL with Origin Access Control (OAC)
855
888
  You can configure the Lambda Function URL with Origin Access Control (OAC) for enhanced security. When using OAC with Signing SIGV4_ALWAYS, it is recommended to set the Lambda Function URL authType to AWS_IAM to ensure proper authorization.
856
889
 
@@ -0,0 +1,84 @@
1
+ import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
2
+ import * as lambda from 'aws-cdk-lib/aws-lambda';
3
+ import { FunctionUrlOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
4
+ import { App, Stack } from 'aws-cdk-lib';
5
+ import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';
6
+ import { OriginIpAddressType } from 'aws-cdk-lib/aws-cloudfront';
7
+
8
+ const app = new App();
9
+ const stack = new Stack(app, 'FunctionUrlOriginIpAddressTypeStack');
10
+
11
+ // Lambda function
12
+ const fn = new lambda.Function(stack, 'TestFunction', {
13
+ code: lambda.Code.fromInline('exports.handler = async () => ({ statusCode: 200, body: "Hello" });'),
14
+ handler: 'index.handler',
15
+ runtime: lambda.Runtime.NODEJS_20_X,
16
+ });
17
+
18
+ // Function URL with IAM auth
19
+ const fnUrl = fn.addFunctionUrl({
20
+ authType: lambda.FunctionUrlAuthType.AWS_IAM,
21
+ });
22
+
23
+ // CloudFront distribution with IPv4 IP address type
24
+ new cloudfront.Distribution(stack, 'DistributionWithoutIpAddressTypeProp(IPv4)', {
25
+ defaultBehavior: {
26
+ origin: FunctionUrlOrigin.withOriginAccessControl(fnUrl, {}),
27
+ },
28
+ });
29
+
30
+ // CloudFront distribution with IPv4 IP address type
31
+ const distributionIPv4 = new cloudfront.Distribution(stack, 'DistributionWithIPv4', {
32
+ defaultBehavior: {
33
+ origin: FunctionUrlOrigin.withOriginAccessControl(fnUrl, {
34
+ ipAddressType: OriginIpAddressType.IPV4,
35
+ }),
36
+ },
37
+ });
38
+
39
+ // CloudFront distribution with IPv6 IP address type
40
+ const distributionIPv6 = new cloudfront.Distribution(stack, 'DistributionWithIPv6', {
41
+ defaultBehavior: {
42
+ origin: FunctionUrlOrigin.withOriginAccessControl(fnUrl, {
43
+ ipAddressType: OriginIpAddressType.IPV6,
44
+ }),
45
+ },
46
+ });
47
+
48
+ // CloudFront distribution with dualstack IP address type
49
+ const distributionDualstack = new cloudfront.Distribution(stack, 'DistributionWithDualstack', {
50
+ defaultBehavior: {
51
+ origin: FunctionUrlOrigin.withOriginAccessControl(fnUrl, {
52
+ ipAddressType: OriginIpAddressType.DUALSTACK,
53
+ }),
54
+ },
55
+ });
56
+
57
+ const integ = new IntegTest(app, 'FunctionUrlOriginIpAddressTypeTest', {
58
+ testCases: [stack],
59
+ });
60
+
61
+ // Assert that distributions are created with expected IP address type settings
62
+ integ.assertions.awsApiCall('CloudFront', 'getDistribution', {
63
+ Id: distributionIPv4.distributionId,
64
+ }).assertAtPath('Distribution.DistributionConfig.IsIPV4Enabled', ExpectedResult.exact(true));
65
+
66
+ integ.assertions.awsApiCall('CloudFront', 'getDistribution', {
67
+ Id: distributionIPv4.distributionId,
68
+ }).assertAtPath('Distribution.DistributionConfig.IsIPV6Enabled', ExpectedResult.exact(false));
69
+
70
+ integ.assertions.awsApiCall('CloudFront', 'getDistribution', {
71
+ Id: distributionIPv6.distributionId,
72
+ }).assertAtPath('Distribution.DistributionConfig.IsIPV4Enabled', ExpectedResult.exact(false));
73
+
74
+ integ.assertions.awsApiCall('CloudFront', 'getDistribution', {
75
+ Id: distributionIPv6.distributionId,
76
+ }).assertAtPath('Distribution.DistributionConfig.IsIPV6Enabled', ExpectedResult.exact(true));
77
+
78
+ integ.assertions.awsApiCall('CloudFront', 'getDistribution', {
79
+ Id: distributionDualstack.distributionId,
80
+ }).assertAtPath('Distribution.DistributionConfig.IsIPV4Enabled', ExpectedResult.exact(true));
81
+
82
+ integ.assertions.awsApiCall('CloudFront', 'getDistribution', {
83
+ Id: distributionDualstack.distributionId,
84
+ }).assertAtPath('Distribution.DistributionConfig.IsIPV6Enabled', ExpectedResult.exact(true));
@@ -13,7 +13,7 @@ const httpOrigin = new origins.HttpOrigin('example.com', {
13
13
  });
14
14
 
15
15
  const fn = new lambda.Function(stack, 'Function', {
16
- runtime: lambda.Runtime.NODEJS_18_X,
16
+ runtime: lambda.Runtime.NODEJS_20_X,
17
17
  handler: 'index.handler',
18
18
  code: lambda.Code.fromInline('exports.handler = async () => ({ statusCode: 200, body: "Hello from Lambda!" });'),
19
19
  });
@@ -13,7 +13,7 @@ const stack = new cdk.Stack(app, 'integ-cloudtrail-data-events');
13
13
 
14
14
  const bucket = new s3.Bucket(stack, 'Bucket', { removalPolicy: cdk.RemovalPolicy.DESTROY });
15
15
  const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', {
16
- runtime: lambda.Runtime.NODEJS_18_X,
16
+ runtime: lambda.Runtime.NODEJS_20_X,
17
17
  handler: 'hello.handler',
18
18
  code: lambda.Code.fromInline('exports.handler = {}'),
19
19
  });