Skip to content

Commit 41fd1ac

Browse files
authored
Merge branch 'main' into fix-agentcore-policy
2 parents ef4b0c0 + a7a6b40 commit 41fd1ac

File tree

22 files changed

+2357
-17
lines changed

22 files changed

+2357
-17
lines changed

.github/workflows/codecov-collect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: cd packages/aws-cdk-lib && yarn test core
2929

3030
- name: Upload Coverage and PR Info
31-
uses: actions/upload-artifact@v4
31+
uses: actions/upload-artifact@v5
3232
with:
3333
name: coverage-artifacts
3434
path: |

.github/workflows/pr-linter-review-trigger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
mkdir -p ./pr
2727
echo $PR_NUMBER > ./pr/pr_number
2828
echo $PR_SHA > ./pr/pr_sha
29-
- uses: actions/upload-artifact@v4
29+
- uses: actions/upload-artifact@v5
3030
with:
3131
name: pr_info
3232
path: pr/

.github/workflows/spec-update.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
# Upload the current db to be used later
3333
- name: Upload base database
34-
uses: actions/upload-artifact@v4
34+
uses: actions/upload-artifact@v5
3535
with:
3636
name: db.base.json.gz
3737
path: node_modules/@aws-cdk/aws-service-spec/db.json.gz
@@ -49,7 +49,7 @@ jobs:
4949

5050
# Now that we have updated the database, upload the new candidate db
5151
- name: Upload head database
52-
uses: actions/upload-artifact@v4
52+
uses: actions/upload-artifact@v5
5353
with:
5454
name: db.head.json.gz
5555
path: node_modules/@aws-cdk/aws-service-spec/db.json.gz
@@ -69,7 +69,7 @@ jobs:
6969
git add .
7070
git diff --patch --staged > ${{ runner.temp }}/update-spec.patch
7171
- name: Upload Patch
72-
uses: actions/upload-artifact@v4
72+
uses: actions/upload-artifact@v5
7373
with:
7474
name: update-spec.patch
7575
path: ${{ runner.temp }}/update-spec.patch
@@ -110,7 +110,7 @@ jobs:
110110
cat DIFF >> PR.md
111111
echo '```' >> PR.md
112112
- name: Upload PR body file
113-
uses: actions/upload-artifact@v4
113+
uses: actions/upload-artifact@v5
114114
with:
115115
name: PR.md
116116
path: PR.md

.github/workflows/update-metadata-regions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
git add .
3434
git diff --patch --staged > ${{ runner.temp }}/update-spec.patch
3535
- name: Upload Patch
36-
uses: actions/upload-artifact@v4
36+
uses: actions/upload-artifact@v5
3737
with:
3838
name: update-spec.patch
3939
path: ${{ runner.temp }}/update-spec.patch

.github/workflows/yarn-upgrade-need-manual-work.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
git diff --binary --patch --staged > ${{ runner.temp }}/upgrade.patch
6767
6868
- name: Upload Patch
69-
uses: actions/upload-artifact@v4
69+
uses: actions/upload-artifact@v5
7070
with:
7171
name: upgrade.patch
7272
path: ${{ runner.temp }}/upgrade.patch

.github/workflows/yarn-upgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
git add .
8181
git diff --patch --staged > ${{ runner.temp }}/upgrade.patch
8282
- name: Upload Patch
83-
uses: actions/upload-artifact@v4
83+
uses: actions/upload-artifact@v5
8484
with:
8585
name: upgrade.patch
8686
path: ${{ runner.temp }}/upgrade.patch

packages/@aws-cdk/aws-bedrock-agentcore-alpha/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ const runtime = new agentcore.Runtime(this, "MyAgentRuntime", {
115115

116116
To grant the runtime permission to invoke a Bedrock model or inference profile:
117117

118-
```text
118+
```typescript fixture=default
119119
// Note: This example uses @aws-cdk/aws-bedrock-alpha which must be installed separately
120-
import * as bedrock from '@aws-cdk/aws-bedrock-alpha';
120+
declare const runtime: agentcore.Runtime;
121121

122122
// Create a cross-region inference profile for Claude 3.7 Sonnet
123123
const inferenceProfile = bedrock.CrossRegionInferenceProfile.fromConfig({

packages/@aws-cdk/aws-bedrock-agentcore-alpha/rosetta/default.ts-fixture

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
99
import * as kms from 'aws-cdk-lib/aws-kms';
1010
import * as ecr from 'aws-cdk-lib/aws-ecr';
1111
import * as ec2 from 'aws-cdk-lib/aws-ec2';
12+
import * as bedrock from '@aws-cdk/aws-bedrock-alpha';
1213

1314
class Fixture extends Stack {
1415
constructor(scope: Construct, id: string) {

packages/@aws-cdk/aws-msk-alpha/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,36 @@ const cluster = new msk.Cluster(this, 'cluster', {
232232
});
233233
```
234234

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+
235265
## MSK Serverless
236266

237267
You can also use MSK Serverless by using `ServerlessCluster` class.

packages/@aws-cdk/aws-msk-alpha/lib/cluster.ts

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ export interface ClusterProps {
9898
*/
9999
readonly instanceType?: ec2.InstanceType;
100100

101+
/**
102+
* The broker type for the cluster.
103+
* When set to EXPRESS, the cluster will be created with Express Brokers.
104+
* When this is set to EXPRESS, instanceType must also be specified.
105+
*
106+
* @default BrokerType.STANDARD
107+
*/
108+
readonly brokerType?: BrokerType;
109+
101110
/**
102111
* The AWS security groups to associate with the elastic network interfaces in order to specify who can
103112
* connect to and communicate with the Amazon MSK cluster.
@@ -199,6 +208,21 @@ export enum StorageMode {
199208
TIERED = 'TIERED',
200209
}
201210

211+
/**
212+
* The broker type for the cluster.
213+
*/
214+
export enum BrokerType {
215+
/**
216+
* Standard brokers provide high-availability guarantees.
217+
*/
218+
STANDARD = 'STANDARD',
219+
220+
/**
221+
* Express brokers are a low-cost option for development, testing, and workloads that don't require the high availability guarantees of standard MSK cluster.
222+
*/
223+
EXPRESS = 'EXPRESS',
224+
}
225+
202226
/**
203227
* The Amazon MSK configuration to use for the cluster.
204228
* Note: There is currently no Cloudformation Resource to create a Configuration
@@ -502,8 +526,36 @@ export class Cluster extends ClusterBase {
502526
throw new core.ValidationError('EBS volume size should be in the range 1-16384', this);
503527
}
504528

529+
const isExpress = props.brokerType === BrokerType.EXPRESS;
530+
531+
if (isExpress) {
532+
// Validate Kafka version compatibility
533+
const supportedVersions = ['3.6', '3.8'];
534+
const kafkaVersionString = props.kafkaVersion.version;
535+
const isCompatibleVersion = supportedVersions.some(version => kafkaVersionString.includes(version));
536+
if (!isCompatibleVersion) {
537+
throw new core.ValidationError(`Express brokers are only supported with Apache Kafka 3.6.x and 3.8.x, got ${kafkaVersionString}`, this);
538+
}
539+
540+
if (!props.instanceType) {
541+
throw new core.ValidationError('`instanceType` must also be specified when `brokerType` is `BrokerType.EXPRESS`.', this);
542+
}
543+
if (props.ebsStorageInfo) {
544+
throw new core.ValidationError('`ebsStorageInfo` is not supported when `brokerType` is `BrokerType.EXPRESS`.', this);
545+
}
546+
if (props.storageMode) {
547+
throw new core.ValidationError('`storageMode` is not supported when `brokerType` is `BrokerType.EXPRESS`.', this);
548+
}
549+
if (props.logging) {
550+
throw new core.ValidationError('`logging` is not supported when `brokerType` is `BrokerType.EXPRESS`.', this);
551+
}
552+
if (subnetSelection.subnets.length < 3) {
553+
throw new core.ValidationError(`Express cluster requires at least 3 subnets, got ${subnetSelection.subnets.length}`, this);
554+
}
555+
}
556+
505557
const instanceType = props.instanceType
506-
? this.mskInstanceType(props.instanceType)
558+
? this.mskInstanceType(props.instanceType, isExpress)
507559
: this.mskInstanceType(
508560
ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.LARGE),
509561
);
@@ -598,7 +650,7 @@ export class Cluster extends ClusterBase {
598650
},
599651
}));
600652
}
601-
const loggingInfo = {
653+
const loggingInfo = isExpress ? undefined : {
602654
brokerLogs: {
603655
cloudWatchLogs: {
604656
enabled:
@@ -678,7 +730,7 @@ export class Cluster extends ClusterBase {
678730
securityGroups: this.connections.securityGroups.map(
679731
(group) => group.securityGroupId,
680732
),
681-
storageInfo: {
733+
storageInfo: isExpress ? undefined : {
682734
ebsStorageInfo: {
683735
volumeSize: volumeSize,
684736
},
@@ -691,7 +743,7 @@ export class Cluster extends ClusterBase {
691743
configurationInfo: props.configurationInfo,
692744
enhancedMonitoring: props.monitoring?.clusterMonitoringLevel,
693745
openMonitoring: openMonitoring,
694-
storageMode: props.storageMode,
746+
storageMode: isExpress ? undefined : props.storageMode,
695747
loggingInfo: loggingInfo,
696748
clientAuthentication,
697749
});
@@ -706,8 +758,9 @@ export class Cluster extends ClusterBase {
706758
});
707759
}
708760

709-
private mskInstanceType(instanceType: ec2.InstanceType): string {
710-
return `kafka.${instanceType.toString()}`;
761+
private mskInstanceType(instanceType: ec2.InstanceType, express?:boolean): string {
762+
const prefix = express ? 'express.' : 'kafka.';
763+
return `${prefix}${instanceType.toString()}`;
711764
}
712765

713766
/**

0 commit comments

Comments
 (0)