konokenj.cdk-api-mcp-server 0.49.0__py3-none-any.whl → 0.51.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-agentcore-alpha/README.md +796 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-eks-v2-alpha/README.md +116 -29
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-msk-alpha/README.md +38 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/mixins-preview/README.md +16 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.api-with-authorizer-and-proxy.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.lambda-api.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.iam.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.lambda.ts +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.user-pool.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.add-subroute-integration.ts +7 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.http-proxy.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda-proxy.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda.ts +4 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-appsync/integ.graphql-lambda-permission.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-appsync/integ.js-resolver.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudformation/integ.core-custom-resources-node-18.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudformation/integ.core-custom-resources-service-timeout.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/integ.origin-response-completion-timeout.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudtrail/integ.cloudtrail-data-events-only.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-elastic-beanstalk-deploy.ts +4 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/README.md +53 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.add-to-resource-policy.ts +80 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.policy.ts +21 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.vpc-flow-logs.ts +4 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr/README.md +40 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr/integ.tag-mutability-exclusion.ts +30 -0
- 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.managedinstances-capacity-provider.ts +5 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.managedinstances-no-default-capacity-provider.ts +107 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs-patterns/integ.alb-fargate-service-public-private-switch.ts +45 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +34 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.alb-lambda-multi-value-headers.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.alb.oidc.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.nlb.security-group.ts +70 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2-actions/integ.cognito.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/README.md +22 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/integ.firehose-delivery-stream.ts +51 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/README.md +96 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/integ.record-format-conversion-schema.ts +154 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/integ.record-format-conversion.ts +178 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.binary-payload.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.logging-config.ts +8 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.params-and-secrets.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime-management.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime.inlinecode.ts +0 -7
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.dependencies-pnpm.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.function-exclude-smithy-models.ts +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.nodejs.build.images.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/integ.subscriptionfilter.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-data-api-to-imported-cluster.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-data-api.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-data.ts +4 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/README.md +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.call-aws-service-cross-region-lambda.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke-json-path.ts +102 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary.ts +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.aws-custom-resource.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.custom-resource-config-lambda-node-runtime.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.invoke-function-payload.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +62 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/README.md +32 -1
- {konokenj_cdk_api_mcp_server-0.49.0.dist-info → konokenj_cdk_api_mcp_server-0.51.0.dist-info}/METADATA +2 -2
- {konokenj_cdk_api_mcp_server-0.49.0.dist-info → konokenj_cdk_api_mcp_server-0.51.0.dist-info}/RECORD +67 -57
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/integ.kinesis-firehose-stream.ts +0 -33
- {konokenj_cdk_api_mcp_server-0.49.0.dist-info → konokenj_cdk_api_mcp_server-0.51.0.dist-info}/WHEEL +0 -0
- {konokenj_cdk_api_mcp_server-0.49.0.dist-info → konokenj_cdk_api_mcp_server-0.51.0.dist-info}/entry_points.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.49.0.dist-info → konokenj_cdk_api_mcp_server-0.51.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-

|
|
7
7
|
|
|
8
|
-
> The APIs of higher level constructs in this module are
|
|
9
|
-
>
|
|
10
|
-
> not subject to
|
|
11
|
-
> announced in
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
cluster
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
189
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
190
190
|
vpc,
|
|
191
191
|
logging: {
|
|
192
192
|
s3: {
|
|
@@ -226,12 +226,42 @@ declare const bucket: s3.IBucket;
|
|
|
226
226
|
|
|
227
227
|
const cluster = new msk.Cluster(this, 'cluster', {
|
|
228
228
|
clusterName: 'myCluster',
|
|
229
|
-
kafkaVersion: msk.KafkaVersion.
|
|
229
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
230
230
|
vpc,
|
|
231
231
|
storageMode: msk.StorageMode.TIERED,
|
|
232
232
|
});
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
+
## MSK Express Brokers
|
|
236
|
+
|
|
237
|
+
You can create an MSK cluster with Express Brokers by setting the `brokerType` property to `BrokerType.EXPRESS`. Express Brokers are a low-cost option for development, testing, and workloads that don't require the high availability guarantees of standard MSK cluster.
|
|
238
|
+
For more information, see [Amazon MSK Express Brokers](https://docs.aws.amazon.com/msk/latest/developerguide/msk-broker-types-express.html).
|
|
239
|
+
|
|
240
|
+
**Note:** When using Express Brokers, the following constraints apply:
|
|
241
|
+
|
|
242
|
+
- Apache Kafka version must be 3.6.x or 3.8.x
|
|
243
|
+
- You must specify the `instanceType`
|
|
244
|
+
- The VPC must have at least 3 subnets (across 3 AZs)
|
|
245
|
+
- `ebsStorageInfo` is not supported
|
|
246
|
+
- `storageMode` is not supported
|
|
247
|
+
- `logging` is not supported
|
|
248
|
+
- Supported broker sizes: `m7g.xlarge`, `m7g.2xlarge`, `m7g.4xlarge`, `m7g.8xlarge`, `m7g.12xlarge`, `m7g.16xlarge`
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
declare const vpc: ec2.Vpc;
|
|
252
|
+
|
|
253
|
+
const expressCluster = new msk.Cluster(this, 'ExpressCluster', {
|
|
254
|
+
clusterName: 'MyExpressCluster',
|
|
255
|
+
kafkaVersion: msk.KafkaVersion.V3_8_X,
|
|
256
|
+
vpc,
|
|
257
|
+
brokerType: msk.BrokerType.EXPRESS,
|
|
258
|
+
instanceType: ec2.InstanceType.of(
|
|
259
|
+
ec2.InstanceClass.M7G,
|
|
260
|
+
ec2.InstanceSize.XLARGE,
|
|
261
|
+
),
|
|
262
|
+
});
|
|
263
|
+
```
|
|
264
|
+
|
|
235
265
|
## MSK Serverless
|
|
236
266
|
|
|
237
267
|
You can also use MSK Serverless by using `ServerlessCluster` class.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# CDK Mixins: Composable Abstractions for AWS Resources
|
|
2
|
+
|
|
3
|
+
<!--BEGIN STABILITY BANNER-->
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+

|
|
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.
|
|
45
|
+
runtime: lambda.Runtime.NODEJS_20_X,
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const sendLambdaIntegration = new agw.LambdaIntegration(myfunc);
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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));
|
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-appsync/integ.js-resolver.ts
CHANGED
|
@@ -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.
|
|
67
|
+
runtime: lambda.Runtime.NODEJS_20_X,
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
const addTestInvoke = integ.assertions.invokeFunction({
|
|
@@ -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.
|
|
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.
|
|
19
|
+
runtime: CustomResourceProviderRuntime.NODEJS_20_X,
|
|
20
20
|
description: 'veni vidi vici',
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -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.
|
|
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.
|
|
16
|
+
runtime: lambda.Runtime.NODEJS_20_X,
|
|
17
17
|
handler: 'hello.handler',
|
|
18
18
|
code: lambda.Code.fromInline('exports.handler = {}'),
|
|
19
19
|
});
|
|
@@ -5,7 +5,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
|
|
|
5
5
|
import { IManagedPolicy, ManagedPolicyReference } from 'aws-cdk-lib/aws-iam';
|
|
6
6
|
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
7
7
|
import * as deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
8
|
-
import { App, Fn, RemovalPolicy, Stack, UnscopedValidationError } from 'aws-cdk-lib';
|
|
8
|
+
import { App, Fn, RemovalPolicy, ResourceEnvironment, Stack, UnscopedValidationError } from 'aws-cdk-lib';
|
|
9
9
|
import * as integ from '@aws-cdk/integ-tests-alpha';
|
|
10
10
|
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
|
|
11
11
|
import { Node } from 'constructs';
|
|
@@ -56,6 +56,9 @@ function makePolicy(arn: string): IManagedPolicy {
|
|
|
56
56
|
get node(): Node {
|
|
57
57
|
throw new UnscopedValidationError('The result of fromAwsManagedPolicyName can not be used in this API');
|
|
58
58
|
},
|
|
59
|
+
get env(): ResourceEnvironment {
|
|
60
|
+
throw new UnscopedValidationError('The result of fromAwsManagedPolicyName can not be used in this API');
|
|
61
|
+
},
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -816,6 +816,59 @@ Using `resourcePolicy` you can add a [resource policy](https://docs.aws.amazon.c
|
|
|
816
816
|
});
|
|
817
817
|
```
|
|
818
818
|
|
|
819
|
+
### Adding Resource Policy Statements Dynamically
|
|
820
|
+
|
|
821
|
+
You can also add resource policy statements to a table after it's created using the `addToResourcePolicy` method. Following the same pattern as KMS, resource policies use wildcard resources to avoid circular dependencies:
|
|
822
|
+
|
|
823
|
+
```ts
|
|
824
|
+
const table = new dynamodb.TableV2(this, 'Table', {
|
|
825
|
+
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
826
|
+
});
|
|
827
|
+
|
|
828
|
+
// Standard resource policy (recommended approach)
|
|
829
|
+
table.addToResourcePolicy(new iam.PolicyStatement({
|
|
830
|
+
actions: ['dynamodb:GetItem', 'dynamodb:PutItem', 'dynamodb:Query'],
|
|
831
|
+
principals: [new iam.AccountRootPrincipal()],
|
|
832
|
+
resources: ['*'], // Wildcard avoids circular dependency - same pattern as KMS
|
|
833
|
+
}));
|
|
834
|
+
|
|
835
|
+
// Allow specific service access
|
|
836
|
+
table.addToResourcePolicy(new iam.PolicyStatement({
|
|
837
|
+
actions: ['dynamodb:Query'],
|
|
838
|
+
principals: [new iam.ServicePrincipal('lambda.amazonaws.com')],
|
|
839
|
+
resources: ['*'],
|
|
840
|
+
}));
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
#### Scoped Resource Policies (Advanced)
|
|
844
|
+
|
|
845
|
+
For scoped resource policies that reference specific table ARNs, you must specify an explicit table name:
|
|
846
|
+
|
|
847
|
+
```ts
|
|
848
|
+
import { Fn } from 'aws-cdk-lib';
|
|
849
|
+
|
|
850
|
+
// Table with explicit name enables scoped resource policies
|
|
851
|
+
const table = new dynamodb.TableV2(this, 'Table', {
|
|
852
|
+
tableName: 'my-explicit-table-name', // Required for scoped resources
|
|
853
|
+
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
// Now you can use scoped resources
|
|
857
|
+
table.addToResourcePolicy(new iam.PolicyStatement({
|
|
858
|
+
actions: ['dynamodb:GetItem'],
|
|
859
|
+
principals: [new iam.AccountRootPrincipal()],
|
|
860
|
+
resources: [
|
|
861
|
+
Fn.sub('arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/my-explicit-table-name'),
|
|
862
|
+
Fn.sub('arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/my-explicit-table-name/index/*'),
|
|
863
|
+
],
|
|
864
|
+
}));
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
**Important Limitations:**
|
|
868
|
+
- **Auto-generated table names**: Must use `resources: ['*']` to avoid circular dependencies
|
|
869
|
+
- **Explicit table names**: Enable scoped resources but lose CDK's automatic naming benefits
|
|
870
|
+
- **CloudFormation constraint**: Resource policies cannot reference the resource they're attached to during creation
|
|
871
|
+
|
|
819
872
|
TableV2 doesn’t support creating a replica and adding a resource-based policy to that replica in the same stack update in Regions other than the Region where you deploy the stack update.
|
|
820
873
|
To incorporate a resource-based policy into a replica, you'll need to initially deploy the replica without the policy, followed by a subsequent update to include the desired policy.
|
|
821
874
|
|