konokenj.cdk-api-mcp-server 0.70.0__py3-none-any.whl → 0.72.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.
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/aws-bedrock-agentcore-alpha/README.md +275 -14
  3. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-eks-v2-alpha/README.md +195 -0
  4. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-elasticache-alpha/README.md +1 -1
  5. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-sagemaker-alpha/README.md +25 -0
  6. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/mixins-preview/README.md +23 -4
  7. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/README.md/README.md +2 -0
  8. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/README.md +54 -34
  9. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-bedrock/README.md +2 -3
  10. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-bedrockagentcore/README.md +24 -0
  11. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/README.md +1 -1
  12. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +3 -0
  13. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.managedinstances-capacity-provider.ts +1 -0
  14. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/README.md +108 -2
  15. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-cluster-native-oidc.ts +49 -0
  16. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-cluster.ts +1 -0
  17. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-oidc-provider.ts +19 -0
  18. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-iam/README.md +14 -11
  19. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-event-sources/README.md +76 -3
  20. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-event-sources/integ.kafka-observability.ts +90 -0
  21. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/README.md +2 -2
  22. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-sns/README.md +2 -2
  23. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/core/integ.nested-stack-suppress-template-indentation.ts +29 -0
  24. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +25 -0
  25. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/pipelines/ORIGINAL_API.md +1 -1
  26. {konokenj_cdk_api_mcp_server-0.70.0.dist-info → konokenj_cdk_api_mcp_server-0.72.0.dist-info}/METADATA +2 -2
  27. {konokenj_cdk_api_mcp_server-0.70.0.dist-info → konokenj_cdk_api_mcp_server-0.72.0.dist-info}/RECORD +30 -26
  28. {konokenj_cdk_api_mcp_server-0.70.0.dist-info → konokenj_cdk_api_mcp_server-0.72.0.dist-info}/WHEEL +0 -0
  29. {konokenj_cdk_api_mcp_server-0.70.0.dist-info → konokenj_cdk_api_mcp_server-0.72.0.dist-info}/entry_points.txt +0 -0
  30. {konokenj_cdk_api_mcp_server-0.70.0.dist-info → konokenj_cdk_api_mcp_server-0.72.0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -451,6 +451,34 @@ new eks.Cluster(this, 'HelloEKS', {
451
451
  });
452
452
  ```
453
453
 
454
+ To provide additional Helm chart values supported by `albController` in CDK, use the `additionalHelmChartValues` property. For example, the following code snippet shows how to set the `enableWafV2` flag:
455
+
456
+ ```ts
457
+ import { KubectlV34Layer } from '@aws-cdk/lambda-layer-kubectl-v34';
458
+
459
+ new eks.Cluster(this, 'HelloEKS', {
460
+ version: eks.KubernetesVersion.V1_34,
461
+ albController: {
462
+ version: eks.AlbControllerVersion.V2_8_2,
463
+ additionalHelmChartValues: {
464
+ enableWafv2: false
465
+ }
466
+ },
467
+ });
468
+ ```
469
+
470
+ To overwrite an existing ALB controller service account, use the `overwriteServiceAccount` property:
471
+
472
+ ```ts
473
+ new eks.Cluster(this, 'HelloEKS', {
474
+ version: eks.KubernetesVersion.V1_34,
475
+ albController: {
476
+ version: eks.AlbControllerVersion.V2_8_2,
477
+ overwriteServiceAccount: true,
478
+ },
479
+ });
480
+ ```
481
+
454
482
  The `albController` requires `defaultCapacity` or at least one nodegroup. If there's no `defaultCapacity` or available
455
483
  nodegroup for the cluster, the `albController` deployment would fail.
456
484
 
@@ -755,6 +783,173 @@ By default, the cluster creator role will be granted the cluster admin permissio
755
783
 
756
784
  > **Note** - Switching `bootstrapClusterCreatorAdminPermissions` on an existing cluster would cause cluster replacement and should be avoided in production.
757
785
 
786
+
787
+ ### Service Accounts
788
+
789
+ With services account you can provide Kubernetes Pods access to AWS resources.
790
+
791
+ ```ts
792
+ import * as s3 from 'aws-cdk-lib/aws-s3';
793
+ declare const cluster: eks.Cluster;
794
+ // add service account
795
+ const serviceAccount = cluster.addServiceAccount('MyServiceAccount');
796
+
797
+ const bucket = new s3.Bucket(this, 'Bucket');
798
+ bucket.grantReadWrite(serviceAccount);
799
+
800
+ const mypod = cluster.addManifest('mypod', {
801
+ apiVersion: 'v1',
802
+ kind: 'Pod',
803
+ metadata: { name: 'mypod' },
804
+ spec: {
805
+ serviceAccountName: serviceAccount.serviceAccountName,
806
+ containers: [
807
+ {
808
+ name: 'hello',
809
+ image: 'paulbouwer/hello-kubernetes:1.5',
810
+ ports: [ { containerPort: 8080 } ],
811
+ },
812
+ ],
813
+ },
814
+ });
815
+
816
+ // create the resource after the service account.
817
+ mypod.node.addDependency(serviceAccount);
818
+
819
+ // print the IAM role arn for this service account
820
+ new CfnOutput(this, 'ServiceAccountIamRole', { value: serviceAccount.role.roleArn });
821
+ ```
822
+
823
+ Note that using `serviceAccount.serviceAccountName` above **does not** translate into a resource dependency.
824
+ This is why an explicit dependency is needed. See <https://github.com/aws/aws-cdk/issues/9910> for more details.
825
+
826
+ It is possible to pass annotations and labels to the service account.
827
+
828
+ ```ts
829
+ declare const cluster: eks.Cluster;
830
+ // add service account with annotations and labels
831
+ const serviceAccount = cluster.addServiceAccount('MyServiceAccount', {
832
+ annotations: {
833
+ 'eks.amazonaws.com/sts-regional-endpoints': 'false',
834
+ },
835
+ labels: {
836
+ 'some-label': 'with-some-value',
837
+ },
838
+ });
839
+ ```
840
+
841
+ You can also add service accounts to existing clusters.
842
+ To do so, pass the `openIdConnectProvider` property when you import the cluster into the application.
843
+
844
+ ```ts
845
+ import * as s3 from 'aws-cdk-lib/aws-s3';
846
+ // you can import an existing provider
847
+ const provider = eks.OidcProviderNative.fromOidcProviderArn(this, 'Provider', 'arn:aws:iam::123456:oidc-provider/oidc.eks.eu-west-1.amazonaws.com/id/AB123456ABC');
848
+
849
+ // or create a new one using an existing issuer url
850
+ declare const issuerUrl: string;
851
+ const provider2 = new eks.OidcProviderNative(this, 'Provider', {
852
+ url: issuerUrl,
853
+ });
854
+
855
+ import { KubectlV34Layer } from '@aws-cdk/lambda-layer-kubectl-v34';
856
+
857
+ const cluster = eks.Cluster.fromClusterAttributes(this, 'MyCluster', {
858
+ clusterName: 'Cluster',
859
+ openIdConnectProvider: provider,
860
+ kubectlProviderOptions: {
861
+ kubectlLayer: new KubectlV34Layer(this, 'kubectl'),
862
+ }});
863
+
864
+ const serviceAccount = cluster.addServiceAccount('MyServiceAccount');
865
+
866
+ const bucket = new s3.Bucket(this, 'Bucket');
867
+ bucket.grantReadWrite(serviceAccount);
868
+ ```
869
+
870
+ Note that adding service accounts requires running `kubectl` commands against the cluster which requires you to provide `kubectlProviderOptions` in the cluster props to create the `kubectl` provider. See [Kubectl Support](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-eks-v2-alpha-readme.html#kubectl-support)
871
+
872
+
873
+ #### Migrating from the deprecated eks.OpenIdConnectProvider to eks.OidcProviderNative
874
+
875
+ `eks.OpenIdConnectProvider` creates an IAM OIDC (OpenId Connect) provider using a custom resource while `eks.OidcProviderNative` uses the CFN L1 (AWS::IAM::OidcProvider) to create the provider. It is recommended for new and existing projects to use `eks.OidcProviderNative`.
876
+
877
+ To migrate without temporarily removing the OIDCProvider, follow these steps:
878
+
879
+ 1. Set the `removalPolicy` of `cluster.openIdConnectProvider` to `RETAIN`.
880
+
881
+ ```ts
882
+ import * as cdk from 'aws-cdk-lib';
883
+ declare const cluster: eks.Cluster;
884
+
885
+ cdk.RemovalPolicies.of(cluster.openIdConnectProvider).apply(cdk.RemovalPolicy.RETAIN);
886
+ ```
887
+
888
+ 2. Run `cdk diff` to verify the changes are expected then `cdk deploy`.
889
+
890
+ 3. Add the following to the `context` field of your `cdk.json` to enable the feature flag that creates the native oidc provider.
891
+
892
+ ```json
893
+ "@aws-cdk/aws-eks:useNativeOidcProvider": true,
894
+ ```
895
+
896
+ 4. Run `cdk diff` and ensure the changes are expected. Example of an expected diff:
897
+
898
+ ```bash
899
+ Resources
900
+ [-] Custom::AWSCDKOpenIdConnectProvider TestCluster/OpenIdConnectProvider/Resource TestClusterOpenIdConnectProviderE18F0FD0 orphan
901
+ [-] AWS::IAM::Role Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role CustomAWSCDKOpenIdConnectProviderCustomResourceProviderRole517FED65 destroy
902
+ [-] AWS::Lambda::Function Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler CustomAWSCDKOpenIdConnectProviderCustomResourceProviderHandlerF2C543E0 destroy
903
+ [+] AWS::IAM::OIDCProvider TestCluster/OidcProviderNative TestClusterOidcProviderNative0BE3F155
904
+ ```
905
+
906
+ 5. Run `cdk import --force` and provide the ARN of the existing OpenIdConnectProvider when prompted. You will get a warning about pending changes to existing resources which is expected.
907
+
908
+ 6. Run `cdk deploy` to apply any pending changes. This will apply the destroy/orphan changes in the above example.
909
+
910
+ If you are creating the OpenIdConnectProvider manually via `new eks.OpenIdConnectProvider`, follow these steps:
911
+
912
+ 1. Set the `removalPolicy` of the existing `OpenIdConnectProvider` to `RemovalPolicy.RETAIN`.
913
+
914
+ ```ts
915
+ import * as cdk from 'aws-cdk-lib';
916
+ // Step 1: Add retain policy to existing provider
917
+ const existingProvider = new eks.OpenIdConnectProvider(this, 'Provider', {
918
+ url: 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLE',
919
+ removalPolicy: cdk.RemovalPolicy.RETAIN, // Add this line
920
+ });
921
+ ```
922
+
923
+ 2. Deploy with the retain policy to avoid deletion of the underlying resource.
924
+
925
+ ```bash
926
+ cdk deploy
927
+ ```
928
+
929
+ 3. Replace `OpenIdConnectProvider` with `OidcProviderNative` in your code.
930
+
931
+ ```ts
932
+ // Step 3: Replace with native provider
933
+ const nativeProvider = new eks.OidcProviderNative(this, 'Provider', {
934
+ url: 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLE',
935
+ });
936
+ ```
937
+
938
+ 4. Run `cdk diff` and verify the changes are expected. Example of an expected diff:
939
+
940
+ ```bash
941
+ Resources
942
+ [-] Custom::AWSCDKOpenIdConnectProvider TestCluster/OpenIdConnectProvider/Resource TestClusterOpenIdConnectProviderE18F0FD0 orphan
943
+ [-] AWS::IAM::Role Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role CustomAWSCDKOpenIdConnectProviderCustomResourceProviderRole517FED65 destroy
944
+ [-] AWS::Lambda::Function Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler CustomAWSCDKOpenIdConnectProviderCustomResourceProviderHandlerF2C543E0 destroy
945
+ [+] AWS::IAM::OIDCProvider TestCluster/OidcProviderNative TestClusterOidcProviderNative0BE3F155
946
+ ```
947
+
948
+ 5. Run `cdk import --force` to import the existing OIDC provider resource by providing the existing ARN.
949
+
950
+ 6. Run `cdk deploy` to apply any pending changes. This will apply the destroy/orphan operations in the example diff above.
951
+
952
+
758
953
  ### Cluster Security Group
759
954
 
760
955
  When you create an Amazon EKS cluster, a [cluster security group](https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html)
@@ -397,7 +397,7 @@ declare const role: iam.Role;
397
397
 
398
398
  // grant "elasticache:Connect" action permissions to role
399
399
  user.grantConnect(role);
400
- serverlessCache.grantConnect(role);
400
+ serverlessCache.grants.connect(role);
401
401
  ```
402
402
 
403
403
  ### Import an existing user and user group
@@ -214,6 +214,31 @@ const endpointConfig = new sagemaker.EndpointConfig(this, 'EndpointConfig', {
214
214
  });
215
215
  ```
216
216
 
217
+ #### Container Startup Health Check Timeout
218
+
219
+ You can specify a timeout value for your inference container to pass health check by configuring
220
+ the `containerStartupHealthCheckTimeout` property. This is useful when your model takes longer
221
+ to initialize and you want to avoid premature health check failures:
222
+
223
+ ```typescript
224
+ import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';
225
+
226
+ declare const model: sagemaker.Model;
227
+
228
+ const endpointConfig = new sagemaker.EndpointConfig(this, 'EndpointConfig', {
229
+ instanceProductionVariants: [
230
+ {
231
+ model: model,
232
+ variantName: 'my-variant',
233
+ containerStartupHealthCheckTimeout: cdk.Duration.minutes(5), // 5 minutes timeout
234
+ },
235
+ ]
236
+ });
237
+ ```
238
+
239
+ The timeout value must be between 60 seconds and 1 hour (3600 seconds). If not specified,
240
+ Amazon SageMaker uses the default timeout behavior.
241
+
217
242
  ### Serverless Inference
218
243
 
219
244
  Amazon SageMaker Serverless Inference is a purpose-built inference option that makes it easy for you to deploy and scale ML models. Serverless endpoints automatically launch compute resources and scale them in and out depending on traffic, eliminating the need to choose instance types or manage scaling policies. For more information, see [SageMaker Serverless Inference](https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints.html).
@@ -54,7 +54,7 @@ For convenience, you can use the `.with()` method for a more fluent syntax:
54
54
  import '@aws-cdk/mixins-preview/with';
55
55
 
56
56
  const bucket = new s3.CfnBucket(scope, "MyBucket")
57
- .with(new EnableVersioning())
57
+ .with(new BucketVersioning())
58
58
  .with(new AutoDeleteObjects());
59
59
  ```
60
60
 
@@ -127,11 +127,29 @@ const bucket = new s3.CfnBucket(scope, "Bucket");
127
127
  Mixins.of(bucket).apply(new AutoDeleteObjects());
128
128
  ```
129
129
 
130
- **EnableVersioning**: Enables versioning on S3 buckets
130
+ **BucketVersioning**: Enables versioning on S3 buckets
131
131
 
132
132
  ```typescript
133
133
  const bucket = new s3.CfnBucket(scope, "Bucket");
134
- Mixins.of(bucket).apply(new EnableVersioning());
134
+ Mixins.of(bucket).apply(new BucketVersioning());
135
+ ```
136
+
137
+ **BucketPolicyStatementsMixin**: Adds IAM policy statements to a bucket policy
138
+
139
+ ```typescript
140
+ declare const bucket: s3.IBucketRef;
141
+
142
+ const bucketPolicy = new s3.CfnBucketPolicy(scope, "BucketPolicy", {
143
+ bucket: bucket,
144
+ policyDocument: new iam.PolicyDocument(),
145
+ });
146
+ Mixins.of(bucketPolicy).apply(new BucketPolicyStatementsMixin([
147
+ new iam.PolicyStatement({
148
+ actions: ["s3:GetObject"],
149
+ resources: ["*"],
150
+ principals: [new iam.AnyPrincipal()],
151
+ }),
152
+ ]));
135
153
  ```
136
154
 
137
155
  ### Logs Delivery
@@ -213,7 +231,8 @@ Mixins.of(scope)
213
231
 
214
232
  // Strict application that requires all constructs to match
215
233
  Mixins.of(scope)
216
- .mustApply(new EncryptionAtRest()); // Throws if no constructs support the mixin
234
+ .requireAll() // Throws if no constructs support the mixin
235
+ .apply(new EncryptionAtRest());
217
236
  ```
218
237
 
219
238
  ---
@@ -1486,6 +1486,8 @@ To do this for a specific stack, add a `suppressTemplateIndentation: true` prope
1486
1486
  stack's `StackProps` parameter. You can also set this property to `false` to override
1487
1487
  the context key setting.
1488
1488
 
1489
+ Similarly, to do this for a specific nested stack, add a `suppressTemplateIndentation: true` property to its `NestedStackProps` parameter. You can also set this property to `false` to override the context key setting.
1490
+
1489
1491
  ## App Context
1490
1492
 
1491
1493
  [Context values](https://docs.aws.amazon.com/cdk/v2/guide/context.html) are key-value pairs that can be associated with an app, stack, or construct.
@@ -65,68 +65,88 @@ 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 most up-to-date instance classes based on your region.
69
- This example configures your `ComputeEnvironment` to use only ARM64 instance:
68
+ There are several ways to configure instance types for your compute environment:
69
+
70
+ ##### Using Default Instance Classes (Recommended)
71
+
72
+ AWS Batch provides default instance classes that automatically select cost-effective, up-to-date instances based on your region.
73
+ This is the recommended approach for new projects:
70
74
 
71
75
  ```ts
72
- const vpc = new ec2.Vpc(this, 'VPC');
76
+ const vpc = new ec2.Vpc(this, 'Vpc');
73
77
 
74
- new batch.ManagedEc2EcsComputeEnvironment(this, 'myEc2ComputeEnv', {
78
+ // Use ARM64 instances (e.g., m6g, c6g, r6g, c7g families)
79
+ new batch.ManagedEc2EcsComputeEnvironment(this, 'Arm64Ec2ComputeEnv', {
75
80
  vpc,
76
81
  defaultInstanceClasses: [batch.DefaultInstanceClass.ARM64],
77
82
  });
78
- ```
79
-
80
- This example configures your `ComputeEnvironment` to use only the `M5AD.large` instance:
81
-
82
- ```ts
83
- const vpc = new ec2.Vpc(this, 'VPC');
84
83
 
85
- new batch.ManagedEc2EcsComputeEnvironment(this, 'myEc2ComputeEnv', {
84
+ // Use x86_64 instances (e.g., m6i, c6i, r6i, c7i families)
85
+ new batch.ManagedEc2EcsComputeEnvironment(this, 'X86_64Ec2ComputeEnv', {
86
86
  vpc,
87
- instanceTypes: [ec2.InstanceType.of(ec2.InstanceClass.M5AD, ec2.InstanceSize.LARGE)],
87
+ defaultInstanceClasses: [batch.DefaultInstanceClass.X86_64],
88
88
  });
89
89
  ```
90
90
 
91
- Batch allows you to specify only the instance class and to let it choose the size, which you can do like this:
91
+ The `default_x86_64` and `default_arm64` categories are dynamically updated by AWS as new instance families become available in your region.
92
+
93
+ ##### Using Specific Instance Types Only
94
+
95
+ To use only specific instance types without any automatic defaults, set `useOptimalInstanceClasses: false`:
92
96
 
93
97
  ```ts
94
- const vpc = new ec2.Vpc(this, 'VPC');
98
+ const vpc = new ec2.Vpc(this, 'Vpc');
95
99
 
96
- declare const computeEnv: batch.IManagedEc2EcsComputeEnvironment
97
- computeEnv.addInstanceClass(ec2.InstanceClass.M5AD);
98
- // Or, specify it on the constructor:
99
- new batch.ManagedEc2EcsComputeEnvironment(this, 'myEc2ComputeEnv', {
100
+ // Use only R4 instance class (Batch chooses the size)
101
+ new batch.ManagedEc2EcsComputeEnvironment(this, 'R4Ec2ComputeEnv', {
100
102
  vpc,
103
+ useOptimalInstanceClasses: false,
101
104
  instanceClasses: [ec2.InstanceClass.R4],
102
105
  });
106
+
107
+ // Use only a specific instance type
108
+ new batch.ManagedEc2EcsComputeEnvironment(this, 'M5AdLargeEc2ComputeEnv', {
109
+ vpc,
110
+ useOptimalInstanceClasses: false,
111
+ instanceTypes: [ec2.InstanceType.of(ec2.InstanceClass.M5AD, ec2.InstanceSize.LARGE)],
112
+ });
103
113
  ```
104
114
 
105
- > [!WARNING]
106
- > `useOptimalInstanceClasses` is deprecated! Use `defaultInstanceClasses` instead.
115
+ ##### Using Optimal Instance Classes
116
+
117
+ By default, `useOptimalInstanceClasses` is `true`, which adds the `optimal` instance type.
118
+
119
+ **Note**: Since November 2025, `optimal` behaves the same as `default_x86_64` and is dynamically updated as AWS introduces new instance families. Both options automatically select cost-effective x86_64 instance types (from the m6i, c6i, r6i, and c7i families) based on your region.
107
120
 
108
- Unless you explicitly specify `useOptimalInstanceClasses: false`, this compute environment will use `'optimal'` instances,
109
- which tells Batch to pick an instance from the C4, M4, and R4 instance families.
110
- *Note*: Batch does not allow specifying instance types or classes with different architectures.
111
- For example, `InstanceClass.A1` cannot be specified alongside `'optimal'`,
112
- because `A1` uses ARM and `'optimal'` uses x86_64.
113
- You can specify both `'optimal'` alongside several different instance types in the same compute environment:
121
+ You can combine this with additional instance types:
114
122
 
115
123
  ```ts
116
124
  declare const vpc: ec2.IVpc;
117
125
 
118
- const computeEnv = new batch.ManagedEc2EcsComputeEnvironment(this, 'myEc2ComputeEnv', {
119
- instanceTypes: [ec2.InstanceType.of(ec2.InstanceClass.M5AD, ec2.InstanceSize.LARGE)],
120
- useOptimalInstanceClasses: true, // default
126
+ const computeEnv = new batch.ManagedEc2EcsComputeEnvironment(this, 'Ec2ComputeEnv', {
121
127
  vpc,
128
+ instanceTypes: [ec2.InstanceType.of(ec2.InstanceClass.M5AD, ec2.InstanceSize.LARGE)],
129
+ // useOptimalInstanceClasses: true (default)
122
130
  });
123
- // Note: this is equivalent to specifying
124
- computeEnv.addInstanceType(ec2.InstanceType.of(ec2.InstanceClass.M5AD, ec2.InstanceSize.LARGE));
125
- computeEnv.addInstanceClass(ec2.InstanceClass.C4);
126
- computeEnv.addInstanceClass(ec2.InstanceClass.M4);
127
- computeEnv.addInstanceClass(ec2.InstanceClass.R4);
131
+ // Result: ['m5ad.large', 'optimal']
128
132
  ```
129
133
 
134
+ ##### Instance Type Configuration Reference
135
+
136
+ | Goal | Configuration |
137
+ |------|---------------|
138
+ | Use latest x86_64 instances | `defaultInstanceClasses: [DefaultInstanceClass.X86_64]` or no configuration (default) |
139
+ | Use latest ARM64 instances | `defaultInstanceClasses: [DefaultInstanceClass.ARM64]` |
140
+ | Use only specific instance classes | `useOptimalInstanceClasses: false` + `instanceClasses: [...]` |
141
+ | Use only specific instance types | `useOptimalInstanceClasses: false` + `instanceTypes: [...]` |
142
+ | Use optimal + additional instances | `instanceClasses: [...]` or `instanceTypes: [...]` |
143
+
144
+ **Note**: Batch does not allow specifying instance types or classes with different architectures.
145
+ For example, `InstanceClass.A1` (ARM) cannot be specified alongside `optimal` (x86_64).
146
+ When using ARM-based instances (e.g., Graviton), use `defaultInstanceClasses: [DefaultInstanceClass.ARM64]`, or set `useOptimalInstanceClasses: false` and explicitly specify ARM instance classes/types.
147
+
148
+ **Note**: `useOptimalInstanceClasses` and `defaultInstanceClasses` cannot be used together.
149
+
130
150
  #### Configure AMIs
131
151
 
132
152
  You can configure Amazon Machine Images (AMIs). This example configures your `ComputeEnvironment` to use Amazon Linux 2023.
@@ -30,7 +30,6 @@ bedrock.ProvisionedModel.fromProvisionedModelArn(
30
30
  );
31
31
  ```
32
32
 
33
- There are no official hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for provisioning Bedrock resources yet. Here are some suggestions on how to proceed:
33
+ L2 constructs for this service are available in the [`@aws-cdk/aws-bedrock-alpha`](https://www.npmjs.com/package/@aws-cdk/aws-bedrock-alpha) package.
34
34
 
35
- - Search [Construct Hub for Bedrock construct libraries](https://constructs.dev/search?q=bedrock)
36
- - Use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, in the same way you would use [the CloudFormation AWS::Bedrock resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Bedrock.html) directly.
35
+ You can also use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, in the same way you would use [the CloudFormation AWS::Bedrock resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Bedrock.html) directly.
@@ -0,0 +1,24 @@
1
+ # AWS::BedrockAgentCore Construct Library
2
+ <!--BEGIN STABILITY BANNER-->
3
+
4
+ ---
5
+
6
+ ![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
7
+
8
+ > All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use.
9
+ >
10
+ > [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib
11
+
12
+ ---
13
+
14
+ <!--END STABILITY BANNER-->
15
+
16
+ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
17
+
18
+ ```ts nofixture
19
+ import * as bedrockagentcore from 'aws-cdk-lib/aws-bedrockagentcore';
20
+ ```
21
+
22
+ L2 constructs for this service are available in the [`@aws-cdk/aws-bedrock-agentcore-alpha`](https://www.npmjs.com/package/@aws-cdk/aws-bedrock-agentcore-alpha) package.
23
+
24
+ You can also use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, in the same way you would use [the CloudFormation AWS::BedrockAgentCore resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_BedrockAgentCore.html) directly.
@@ -245,7 +245,7 @@ const vpc = new ec2.Vpc(this, 'TheVPC', {
245
245
  const securityGroup = new ec2.SecurityGroup(this, 'SecurityGroup', { vpc });
246
246
  securityGroup.addEgressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(443));
247
247
  for (const gateway of provider.gatewayInstances) {
248
- bucket.grantWrite(gateway);
248
+ bucket.grants.write(gateway);
249
249
  gateway.addSecurityGroup(securityGroup);
250
250
  }
251
251
  ```
@@ -1678,6 +1678,8 @@ new ecs.Ec2Service(this, 'EC2Service', {
1678
1678
 
1679
1679
  Managed Instances Capacity Providers allow you to use AWS-managed EC2 instances for your ECS tasks while providing more control over instance selection than standard Fargate. AWS handles the instance lifecycle, patching, and maintenance while you can specify detailed instance requirements. You can define detailed instance requirements to control which types of instances are used for your workloads.
1680
1680
 
1681
+ Capacity Option Type provides the purchasing option for the EC2 instances used in the capacity provider. Determines whether to use On-Demand or Spot instances. Valid values are `ON_DEMAND` and `SPOT`. Defaults to `ON_DEMAND` when not specified. Changing this value will trigger replacement of the capacity provider. For more information, see [Amazon EC2 billing and purchasing options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html) in the Amazon EC2 User Guide.
1682
+
1681
1683
  See [ECS documentation for Managed Instances Capacity Provider](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/managed-instances-capacity-providers-concept.html) for more documentation.
1682
1684
 
1683
1685
  #### IAM Roles Setup
@@ -1695,6 +1697,7 @@ const securityGroup = new ec2.SecurityGroup(this, 'SecurityGroup', {
1695
1697
  });
1696
1698
 
1697
1699
  const miCapacityProvider = new ecs.ManagedInstancesCapacityProvider(this, 'MICapacityProvider', {
1700
+ capacityOptionType: ecs.CapacityOptionType.SPOT,
1698
1701
  subnets: vpc.privateSubnets,
1699
1702
  securityGroups: [securityGroup],
1700
1703
  instanceRequirements: {
@@ -49,6 +49,7 @@ const fmiSecurityGroup = new ec2.SecurityGroup(stack, 'ManagedInstancesSecurityG
49
49
  // Create MI Capacity Provider
50
50
  const miCapacityProvider = new ecs.ManagedInstancesCapacityProvider(stack, 'ManagedInstancesCapacityProvider', {
51
51
  infrastructureRole: infrastructureRole,
52
+ capacityOptionType: ecs.CapacityOptionType.SPOT,
52
53
  ec2InstanceProfile: instanceProfile,
53
54
  subnets: vpc.privateSubnets,
54
55
  securityGroups: [fmiSecurityGroup],
@@ -731,6 +731,21 @@ new eks.Cluster(this, 'HelloEKS', {
731
731
  });
732
732
  ```
733
733
 
734
+ To overwrite an existing ALB controller service account, use the `overwriteServiceAccount` property:
735
+
736
+ ```ts
737
+ import { KubectlV34Layer } from '@aws-cdk/lambda-layer-kubectl-v34';
738
+
739
+ new eks.Cluster(this, 'HelloEKS', {
740
+ version: eks.KubernetesVersion.V1_34,
741
+ albController: {
742
+ version: eks.AlbControllerVersion.V2_8_2,
743
+ overwriteServiceAccount: true
744
+ },
745
+ kubectlLayer: new KubectlV34Layer(this, 'kubectl'),
746
+ });
747
+ ```
748
+
734
749
  The `albController` requires `defaultCapacity` or at least one nodegroup. If there's no `defaultCapacity` or available
735
750
  nodegroup for the cluster, the `albController` deployment would fail.
736
751
 
@@ -1430,16 +1445,26 @@ const serviceAccount = cluster.addServiceAccount('MyServiceAccount', {
1430
1445
  });
1431
1446
  ```
1432
1447
 
1448
+ To overwrite an existing service account, use the `overwriteServiceAccount` property:
1449
+
1450
+ ```ts
1451
+ declare const cluster: eks.Cluster;
1452
+ // overwrite existing service account
1453
+ const serviceAccount = cluster.addServiceAccount('MyServiceAccount', {
1454
+ overwriteServiceAccount: true,
1455
+ });
1456
+ ```
1457
+
1433
1458
  You can also add service accounts to existing clusters.
1434
1459
  To do so, pass the `openIdConnectProvider` property when you import the cluster into the application.
1435
1460
 
1436
1461
  ```ts
1437
1462
  // you can import an existing provider
1438
- const provider = eks.OpenIdConnectProvider.fromOpenIdConnectProviderArn(this, 'Provider', 'arn:aws:iam::123456:oidc-provider/oidc.eks.eu-west-1.amazonaws.com/id/AB123456ABC');
1463
+ const provider = eks.OidcProviderNative.fromOidcProviderArn(this, 'Provider', 'arn:aws:iam::123456:oidc-provider/oidc.eks.eu-west-1.amazonaws.com/id/AB123456ABC');
1439
1464
 
1440
1465
  // or create a new one using an existing issuer url
1441
1466
  declare const issuerUrl: string;
1442
- const provider2 = new eks.OpenIdConnectProvider(this, 'Provider', {
1467
+ const provider2 = new eks.OidcProviderNative(this, 'Provider', {
1443
1468
  url: issuerUrl,
1444
1469
  });
1445
1470
 
@@ -1459,6 +1484,87 @@ Note that adding service accounts requires running `kubectl` commands against th
1459
1484
  This means you must also pass the `kubectlRoleArn` when importing the cluster.
1460
1485
  See [Using existing Clusters](https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/aws-eks#using-existing-clusters).
1461
1486
 
1487
+
1488
+ ##### Migrating from eks.OpenIdConnectProvider to eks.OidcProviderNative
1489
+
1490
+ `eks.OpenIdConnectProvider` creates an IAM OIDC (OpenId Connect) provider using a custom resource while `eks.OidcProviderNative` uses the CFN L1 (AWS::IAM::OidcProvider) to create the provider. It is recommended for new and existing projects to use `eks.OidcProviderNative`. Migrating from the `eks.OpenIdConnectProvider` is not as trivial as switching out the property since the property controls the creation of a resource whose type is changing. Due to the potential complexlity of the migration and the requirement of a manual step (`cdk import`) we are not deprecating the `eks.OpenIdConnectProvider` construct but encourge you to migrate.
1491
+
1492
+ To migrate without temporarily removing the OIDCProvider, follow these steps:
1493
+
1494
+ 1. Set the `removalPolicy` of `cluster.openIdConnectProvider` to `RETAIN`.
1495
+
1496
+ ```ts
1497
+ import * as cdk from 'aws-cdk-lib';
1498
+ declare const cluster: eks.Cluster;
1499
+
1500
+ cdk.RemovalPolicies.of(cluster.openIdConnectProvider).apply(cdk.RemovalPolicy.RETAIN);
1501
+ ```
1502
+
1503
+ 2. Run `cdk diff` to verify the changes are expected then `cdk deploy`.
1504
+
1505
+ 3. Add the following to the `context` field of your `cdk.json` to enable the feature flag that creates the native oidc provider.
1506
+
1507
+ ```json
1508
+ "@aws-cdk/aws-eks:useNativeOidcProvider": true,
1509
+ ```
1510
+
1511
+ 4. Run `cdk diff` and ensure the changes are expected. Example of an expected diff:
1512
+
1513
+ ```bash
1514
+ Resources
1515
+ [-] Custom::AWSCDKOpenIdConnectProvider TestCluster/OpenIdConnectProvider/Resource TestClusterOpenIdConnectProviderE18F0FD0 orphan
1516
+ [-] AWS::IAM::Role Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role CustomAWSCDKOpenIdConnectProviderCustomResourceProviderRole517FED65 destroy
1517
+ [-] AWS::Lambda::Function Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler CustomAWSCDKOpenIdConnectProviderCustomResourceProviderHandlerF2C543E0 destroy
1518
+ [+] AWS::IAM::OIDCProvider TestCluster/OidcProviderNative TestClusterOidcProviderNative0BE3F155
1519
+ ```
1520
+
1521
+ 5. Run `cdk import --force` and provide the ARN of the existing OpenIdConnectProvider when prompted. You will get a warning about pending changes to existing resources which is expected.
1522
+
1523
+ 6. Run `cdk deploy` to apply any pending changes. This will apply the destroy/orphan changes in the above example.
1524
+
1525
+ If you are creating the OpenIdConnectProvider manually via `new eks.OpenIdConnectProvider`, follow these steps:
1526
+
1527
+ 1. Set the `removalPolicy` of the existing `OpenIdConnectProvider` to `RemovalPolicy.RETAIN`.
1528
+
1529
+ ```ts
1530
+ import * as cdk from 'aws-cdk-lib';
1531
+ // Step 1: Add retain policy to existing provider
1532
+ const existingProvider = new eks.OpenIdConnectProvider(this, 'Provider', {
1533
+ url: 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLE',
1534
+ removalPolicy: cdk.RemovalPolicy.RETAIN, // Add this line
1535
+ });
1536
+ ```
1537
+
1538
+ 2. Deploy with the retain policy to avoid deletion of the underlying resource.
1539
+
1540
+ ```bash
1541
+ cdk deploy
1542
+ ```
1543
+
1544
+ 3. Replace `OpenIdConnectProvider` with `OidcProviderNative` in your code.
1545
+
1546
+ ```ts
1547
+ // Step 3: Replace with native provider
1548
+ const nativeProvider = new eks.OidcProviderNative(this, 'Provider', {
1549
+ url: 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLE',
1550
+ });
1551
+ ```
1552
+
1553
+ 4. Run `cdk diff` and verify the changes are expected. Example of an expected diff:
1554
+
1555
+ ```bash
1556
+ Resources
1557
+ [-] Custom::AWSCDKOpenIdConnectProvider TestCluster/OpenIdConnectProvider/Resource TestClusterOpenIdConnectProviderE18F0FD0 orphan
1558
+ [-] AWS::IAM::Role Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Role CustomAWSCDKOpenIdConnectProviderCustomResourceProviderRole517FED65 destroy
1559
+ [-] AWS::Lambda::Function Custom::AWSCDKOpenIdConnectProviderCustomResourceProvider/Handler CustomAWSCDKOpenIdConnectProviderCustomResourceProviderHandlerF2C543E0 destroy
1560
+ [+] AWS::IAM::OIDCProvider TestCluster/OidcProviderNative TestClusterOidcProviderNative0BE3F155
1561
+ ```
1562
+
1563
+ 5. Run `cdk import --force` to import the existing OIDC provider resource by providing the existing ARN.
1564
+
1565
+ 6. Run `cdk deploy` to apply any pending changes. This will apply the destroy/orphan operations in the example diff above.
1566
+
1567
+
1462
1568
  ### Pod Identities
1463
1569
 
1464
1570
  [Amazon EKS Pod Identities](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html) is a feature that simplifies how