Skip to content

Commit 8359f15

Browse files
authored
Merge branch 'main' into fix/route53-cross-account-delegation
2 parents 8847d96 + 07a8698 commit 8359f15

File tree

64 files changed

+90896
-30918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+90896
-30918
lines changed

CHANGELOG.v2.alpha.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.203.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.202.0-alpha.0...v2.203.0-alpha.0) (2025-07-01)
6+
7+
8+
### Features
9+
10+
* **ec2:** support for client route enforcement for client VPN endpoint ([#34405](https://github.com/aws/aws-cdk/issues/34405)) ([063f4e7](https://github.com/aws/aws-cdk/commit/063f4e79d7416c52b622450222c5439e893ca74c))
11+
12+
13+
### Bug Fixes
14+
15+
* **ec2:** don't use inferenceAccellerators in the constructors if not needed ([#34618](https://github.com/aws/aws-cdk/issues/34618)) ([054c6c5](https://github.com/aws/aws-cdk/commit/054c6c53982b8ba33ca31af6752b1662ed5752b8)), closes [#33505](https://github.com/aws/aws-cdk/issues/33505) [/github.com/aws/aws-cdk/issues/33505#issuecomment-2770818825](https://github.com/aws//github.com/aws/aws-cdk/issues/33505/issues/issuecomment-2770818825) [#34610](https://github.com/aws/aws-cdk/issues/34610)
16+
517
## [2.202.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.201.0-alpha.0...v2.202.0-alpha.0) (2025-06-20)
618

719

CHANGELOG.v2.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,38 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.203.0](https://github.com/aws/aws-cdk/compare/v2.202.0...v2.203.0) (2025-07-01)
6+
7+
8+
### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
9+
10+
* **cloudformation:** Some L1 resources experienced breaking changes due to updated CloudFormation resources. Please check the notes for each specific module for more information.
11+
12+
- ***aws-cdk-lib.aws_kendra.CfnDataSource.TemplateConfigurationProperty***: `template` property here has changed from `string` to `json`
13+
14+
### Features
15+
16+
* **rds:** instance engine lifecycle support ([#34719](https://github.com/aws/aws-cdk/issues/34719)) ([bab7413](https://github.com/aws/aws-cdk/commit/bab74137f17bb0759b1a922d8e88df5c0f6e9bc1)), closes [#34492](https://github.com/aws/aws-cdk/issues/34492)
17+
* report feature flag configuration into Cloud Assembly ([#34798](https://github.com/aws/aws-cdk/issues/34798)) ([76af7dc](https://github.com/aws/aws-cdk/commit/76af7dc8b5bc80dcc00ad9f3bbf6dc8fecfec5c3))
18+
* **backup:** add support for ScheduleExpressionTimezone ([#34603](https://github.com/aws/aws-cdk/issues/34603)) ([8ceea43](https://github.com/aws/aws-cdk/commit/8ceea437e332d4a1339c26f13b59b424ef389135)), closes [#34532](https://github.com/aws/aws-cdk/issues/34532)
19+
* **cloudformation:** update L1 CloudFormation resource definitions ([#34839](https://github.com/aws/aws-cdk/issues/34839)) ([4c75889](https://github.com/aws/aws-cdk/commit/4c75889fb44e16bc5ef979c5c6d42390ddc0a17b))
20+
* **cloudwatch:** add account id field for log query and metric widgets to support cross account visibility ([#34793](https://github.com/aws/aws-cdk/issues/34793)) ([ac4d09d](https://github.com/aws/aws-cdk/commit/ac4d09d91bcedc4dca144ba68b1951cc12c9b70c)), closes [#26105](https://github.com/aws/aws-cdk/issues/26105)
21+
* **lambda:** function log removal policy ([#34723](https://github.com/aws/aws-cdk/issues/34723)) ([0388483](https://github.com/aws/aws-cdk/commit/0388483537bbd2f6fef4e8dd3156341a90ee9d68)), closes [#34669](https://github.com/aws/aws-cdk/issues/34669)
22+
* **pipelines:** cdk-assets version is configurable ([#34802](https://github.com/aws/aws-cdk/issues/34802)) ([a361c9c](https://github.com/aws/aws-cdk/commit/a361c9ce325f6d1f63a62c69d26af4ce6b2e12f3))
23+
* update L1 CloudFormation resource definitions ([#34792](https://github.com/aws/aws-cdk/issues/34792)) ([074cb8c](https://github.com/aws/aws-cdk/commit/074cb8c8502463e658ab009c5bebf5a84ad6555b))
24+
25+
26+
### Bug Fixes
27+
28+
* **codecov:** update codecov-upload.yml ([#34845](https://github.com/aws/aws-cdk/issues/34845)) ([8055016](https://github.com/aws/aws-cdk/commit/805501692991825aa4949bf830fa40e4e1c4cd6b)), closes [/github.com/aws/aws-cdk/blob/main/codecov.yml#L35](https://github.com/aws//github.com/aws/aws-cdk/blob/main/codecov.yml/issues/L35)
29+
* **codecov:** update codecov-upload.yml action to upload report with correct path ([#34814](https://github.com/aws/aws-cdk/issues/34814)) ([705e76b](https://github.com/aws/aws-cdk/commit/705e76bf22da1e743f22428aab4c36f900b484e5))
30+
* **stepfunctions-tasks:** properly serialize CallAwsServiceCrossRegion Lambda responses ([#34843](https://github.com/aws/aws-cdk/issues/34843)) ([a4b15df](https://github.com/aws/aws-cdk/commit/a4b15df5d1669056947df757471ad0b921335f23)), closes [#34768](https://github.com/aws/aws-cdk/issues/34768)
31+
32+
33+
### Reverts
34+
35+
* "ci: add tool to sync with project board" ([#34817](https://github.com/aws/aws-cdk/issues/34817)) ([1965014](https://github.com/aws/aws-cdk/commit/1965014d1233b956fc2c6cbbdf72bfade9aaab5d)), closes [aws/aws-cdk#34776](https://github.com/aws/aws-cdk/issues/34776)
36+
537
## [2.202.0](https://github.com/aws/aws-cdk/compare/v2.201.0...v2.202.0) (2025-06-20)
638

739

packages/@aws-cdk/aws-bedrock-alpha/bedrock/agents/agent-alias.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { ArnFormat, aws_bedrock as bedrock, IResource, Resource, Stack } from 'aws-cdk-lib';
22
import * as events from 'aws-cdk-lib/aws-events';
33
import * as iam from 'aws-cdk-lib/aws-iam';
4+
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
5+
import { propertyInjectable } from 'aws-cdk-lib/core/lib/prop-injectable';
46
import { Construct } from 'constructs';
57
import { IAgent } from './agent';
68

@@ -186,7 +188,10 @@ export interface AgentAliasAttributes {
186188
* Class to create an Agent Alias with CDK.
187189
* @cloudformationResource AWS::Bedrock::AgentAlias
188190
*/
191+
@propertyInjectable
189192
export class AgentAlias extends AgentAliasBase {
193+
/** Uniquely identifies this class. */
194+
public static readonly PROPERTY_INJECTION_ID: string = '@aws-cdk.aws-bedrock-alpha.AgentAlias';
190195
// ------------------------------------------------------
191196
// Imports
192197
// ------------------------------------------------------
@@ -229,6 +234,8 @@ export class AgentAlias extends AgentAliasBase {
229234
// ------------------------------------------------------
230235
constructor(scope: Construct, id: string, props: AgentAliasProps) {
231236
super(scope, id);
237+
// Enhanced CDK Analytics Telemetry
238+
addConstructMetadata(this, props);
232239

233240
// ------------------------------------------------------
234241
// Set properties or defaults

packages/@aws-cdk/aws-bedrock-alpha/bedrock/agents/agent.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import * as events from 'aws-cdk-lib/aws-events';
66
import * as iam from 'aws-cdk-lib/aws-iam';
77
import * as kms from 'aws-cdk-lib/aws-kms';
88
import * as s3 from 'aws-cdk-lib/aws-s3';
9+
import { addConstructMetadata, MethodMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
10+
import { propertyInjectable } from 'aws-cdk-lib/core/lib/prop-injectable';
911
import { Construct, IConstruct } from 'constructs';
1012
// Internal Libs
1113
import { AgentActionGroup } from './action-group';
@@ -333,7 +335,11 @@ export interface AgentAttributes {
333335
* Class to create (or import) an Agent with CDK.
334336
* @cloudformationResource AWS::Bedrock::Agent
335337
*/
338+
@propertyInjectable
336339
export class Agent extends AgentBase implements IAgent {
340+
/** Uniquely identifies this class. */
341+
public static readonly PROPERTY_INJECTION_ID: string = '@aws-cdk.aws-bedrock-alpha.Agent';
342+
337343
/**
338344
* Static Method for importing an existing Bedrock Agent.
339345
*/
@@ -429,6 +435,8 @@ export class Agent extends AgentBase implements IAgent {
429435
// ------------------------------------------------------
430436
constructor(scope: Construct, id: string, props: AgentProps) {
431437
super(scope, id);
438+
// Enhanced CDK Analytics Telemetry
439+
addConstructMetadata(this, props);
432440

433441
// ------------------------------------------------------
434442
// Validate props
@@ -580,6 +588,7 @@ export class Agent extends AgentBase implements IAgent {
580588
* - Lambda function invoke permissions if executor is present
581589
* - S3 GetObject permissions if apiSchema.s3File is present
582590
*/
591+
@MethodMetadata()
583592
public addActionGroup(actionGroup: AgentActionGroup) {
584593
validation.throwIfInvalid(this.validateActionGroup, actionGroup);
585594
this.actionGroups.push(actionGroup);
@@ -640,6 +649,7 @@ export class Agent extends AgentBase implements IAgent {
640649
*
641650
* @default - No collaboration configuration.
642651
*/
652+
@MethodMetadata()
643653
public addActionGroups(...actionGroups: AgentActionGroup[]) {
644654
actionGroups.forEach(ag => this.addActionGroup(ag));
645655
}

packages/@aws-cdk/aws-lambda-python-alpha/README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,23 @@ new python.PythonFunction(this, 'MyFunction', {
6565

6666
## Packaging
6767

68-
If `requirements.txt`, `Pipfile` or `poetry.lock` exists at the entry path, the construct will handle installing all required modules in a [Lambda compatible Docker container](https://gallery.ecr.aws/sam/build-python3.7) according to the `runtime` and with the Docker platform based on the target architecture of the Lambda function.
68+
If `requirements.txt`, `Pipfile`, `uv.lock` or `poetry.lock` exists at the entry path, the construct will handle installing all required modules in a [Lambda compatible Docker container](https://gallery.ecr.aws/sam/build-python3.13) according to the `runtime` and with the Docker platform based on the target architecture of the Lambda function.
6969

7070
Python bundles are only recreated and published when a file in a source directory has changed.
7171
Therefore (and as a general best-practice), it is highly recommended to commit a lockfile with a
7272
list of all transitive dependencies and their exact versions. This will ensure that when any dependency version is updated, the bundle asset is recreated and uploaded.
7373

74-
To that end, we recommend using [`pipenv`] or [`poetry`] which have lockfile support.
74+
To that end, we recommend using [`pipenv`], [`uv`] or [`poetry`] which have lockfile support.
7575

7676
- [`pipenv`](https://pipenv-fork.readthedocs.io/en/latest/basics.html#example-pipfile-lock)
7777
- [`poetry`](https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control)
78+
- [`uv`](https://docs.astral.sh/uv/concepts/projects/sync/#exporting-the-lockfile)
7879

7980
Packaging is executed using the `Packaging` class, which:
8081

8182
1. Infers the packaging type based on the files present.
82-
2. If it sees a `Pipfile` or a `poetry.lock` file, it exports it to a compatible `requirements.txt` file with credentials (if they're available in the source files or in the bundling container).
83-
3. Installs dependencies using `pip`.
83+
2. If it sees a `Pipfile`, `uv.lock` or a `poetry.lock` file, it exports it to a compatible `requirements.txt` file with credentials (if they're available in the source files or in the bundling container).
84+
3. Installs dependencies using `pip` or `uv`.
8485
4. Copies the dependencies into an asset that is bundled for the Lambda package.
8586

8687
**Lambda with a requirements.txt**
@@ -109,6 +110,18 @@ Packaging is executed using the `Packaging` class, which:
109110
├── poetry.lock # your poetry lock file has to be present at the entry path
110111
```
111112

113+
**Lambda with a uv.lock**
114+
115+
Reference: https://docs.astral.sh/uv/concepts/projects/layout/
116+
117+
```plaintext
118+
.
119+
├── lambda_function.py # exports a function named 'handler'
120+
├── pyproject.toml # your poetry project definition
121+
├── uv.lock # your uv lock file has to be present at the entry path
122+
├── .python-version # this file is ignored, python version is configured via Runtime
123+
```
124+
112125
**Excluding source files**
113126

114127
You can exclude files from being copied using the optional bundling string array parameter `assetExcludes`:

packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARG HTTPS_PROXY
99
# pipenv 2022.4.8 is the last version with Python 3.6 support
1010
ARG PIPENV_VERSION=2022.4.8
1111
ARG POETRY_VERSION=1.5.1
12+
ARG UV_VERSION=0.6.9
1213

1314
# Add virtualenv path
1415
ENV PATH="/usr/app/venv/bin:$PATH"
@@ -19,6 +20,9 @@ ENV PIP_CACHE_DIR=/tmp/pip-cache
1920
# set the poetry cache
2021
ENV POETRY_CACHE_DIR=/tmp/poetry-cache
2122

23+
# set the uv cache
24+
ENV UV_CACHE_DIR=/tmp/uv-cache
25+
2226
RUN \
2327
# create a new virtualenv for python to use
2428
# so that it isn't using root
@@ -33,10 +37,14 @@ RUN \
3337
mkdir /tmp/poetry-cache && \
3438
# Ensure all users can write to poetry cache
3539
chmod -R 777 /tmp/poetry-cache && \
36-
# Install pipenv and poetry
37-
pip install pipenv==$PIPENV_VERSION poetry==$POETRY_VERSION && \
40+
# Create a new location for the uv cache
41+
mkdir /tmp/uv-cache && \
42+
# Ensure all users can write to uv cache
43+
chmod -R 777 /tmp/uv-cache && \
44+
# Install pipenv, poetry and uv
45+
pip install pipenv==$PIPENV_VERSION poetry==$POETRY_VERSION uv==${UV_VERSION} && \
3846
# Ensure no temporary files remain in the caches
39-
rm -rf /tmp/pip-cache/* /tmp/poetry-cache/*
47+
rm -rf /tmp/pip-cache/* /tmp/poetry-cache/* /tmp/uv-cache/*
4048

4149
# Setting a non-root user to run default command,
4250
# This will be overridden later when the Docker container is running, using either the local OS user or props.user.

packages/@aws-cdk/aws-lambda-python-alpha/lib/bundling.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,25 @@ export class Bundling implements CdkBundlingOptions {
122122
const packaging = Packaging.fromEntry(options.entry, options.poetryIncludeHashes, options.poetryWithoutUrls);
123123
let bundlingCommands: string[] = [];
124124
bundlingCommands.push(...options.commandHooks?.beforeBundling(options.inputDir, options.outputDir) ?? []);
125-
const exclusionStr = options.assetExcludes?.map(item => `--exclude='${item}'`).join(' ');
125+
126+
const excludes = options.assetExcludes ?? [];
127+
if (packaging.dependenciesFile == DependenciesFile.UV && !excludes.includes('.python-version')) {
128+
excludes.push('.python-version');
129+
}
130+
131+
const exclusionStr = excludes.map(item => `--exclude='${item}'`).join(' ');
126132
bundlingCommands.push([
127133
'rsync', '-rLv', exclusionStr ?? '', `${options.inputDir}/`, options.outputDir,
128134
].filter(item => item).join(' '));
129135
bundlingCommands.push(`cd ${options.outputDir}`);
130136
bundlingCommands.push(packaging.exportCommand ?? '');
131-
if (packaging.dependenciesFile) {
137+
138+
if (packaging.dependenciesFile == DependenciesFile.UV) {
139+
bundlingCommands.push(`uv pip install -r ${DependenciesFile.PIP} --target ${options.outputDir}`);
140+
} else if (packaging.dependenciesFile) {
132141
bundlingCommands.push(`python -m pip install -r ${DependenciesFile.PIP} -t ${options.outputDir}`);
133142
}
143+
134144
bundlingCommands.push(...options.commandHooks?.afterBundling(options.inputDir, options.outputDir) ?? []);
135145
return bundlingCommands;
136146
}

packages/@aws-cdk/aws-lambda-python-alpha/lib/packaging.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export enum DependenciesFile {
55
PIP = 'requirements.txt',
66
POETRY = 'poetry.lock',
77
PIPENV = 'Pipfile.lock',
8+
UV = 'uv.lock',
89
NONE = '',
910
}
1011

@@ -79,6 +80,16 @@ export class Packaging {
7980
});
8081
}
8182

83+
/**
84+
* Packaging with `uv`.
85+
*/
86+
public static withUv() {
87+
return new Packaging({
88+
dependenciesFile: DependenciesFile.UV,
89+
exportCommand: `uv export --frozen --no-emit-workspace --no-dev --no-editable -o ${DependenciesFile.PIP}`,
90+
});
91+
}
92+
8293
/**
8394
* No dependencies or packaging.
8495
*/
@@ -93,6 +104,8 @@ export class Packaging {
93104
return this.withPoetry({ poetryIncludeHashes, poetryWithoutUrls });
94105
} else if (fs.existsSync(path.join(entry, DependenciesFile.PIP))) {
95106
return this.withPip();
107+
} else if (fs.existsSync(path.join(entry, DependenciesFile.UV))) {
108+
return this.withUv();
96109
} else {
97110
return this.withNoPackaging();
98111
}

packages/@aws-cdk/aws-lambda-python-alpha/test/bundling.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,3 +582,29 @@ test('with command hooks', () => {
582582
}),
583583
}));
584584
});
585+
586+
test('Bundling a function with uv dependencies', () => {
587+
const entry = path.join(__dirname, 'lambda-handler-uv');
588+
589+
const assetCode = Bundling.bundle({
590+
entry: path.join(entry, '.'),
591+
runtime: Runtime.PYTHON_3_13,
592+
outputPathSuffix: 'python',
593+
});
594+
595+
expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({
596+
bundling: expect.objectContaining({
597+
command: [
598+
'bash', '-c',
599+
"rsync -rLv --exclude='.python-version' /asset-input/ /asset-output/python && cd /asset-output/python && uv export --frozen --no-emit-workspace --no-dev --no-editable -o requirements.txt && uv pip install -r requirements.txt --target /asset-output/python",
600+
],
601+
}),
602+
}));
603+
604+
const files = fs.readdirSync(assetCode.path);
605+
expect(files).toContain('index.py');
606+
expect(files).toContain('pyproject.toml');
607+
expect(files).toContain('uv.lock');
608+
// Contains hidden files.
609+
expect(files).toContain('.ignorefile');
610+
});

0 commit comments

Comments
 (0)