Skip to content

Commit b88f959

Browse files
authored
chore(release): v2.139.1 (#30007)
See CHANGELOG
2 parents 2699ffd + 3ff013b commit b88f959

File tree

6 files changed

+12
-41
lines changed

6 files changed

+12
-41
lines changed

CHANGELOG.v2.alpha.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
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.139.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.139.0-alpha.0...v2.139.1-alpha.0) (2024-04-29)
6+
57
## [2.139.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.138.0-alpha.0...v2.139.0-alpha.0) (2024-04-24)
68

79
## [2.138.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.137.0-alpha.0...v2.138.0-alpha.0) (2024-04-18)

CHANGELOG.v2.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
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.139.1](https://github.com/aws/aws-cdk/compare/v2.139.0...v2.139.1) (2024-04-29)
6+
7+
8+
### Reverts
9+
10+
* fix(lambda): version.fromVersionArn creates invalid Version object ([#30003](https://github.com/aws/aws-cdk/issues/30003)) ([ced7a46](https://github.com/aws/aws-cdk/commit/ced7a46b45aeee335264d91cf8287da4837dbab8))
11+
512
## [2.139.0](https://github.com/aws/aws-cdk/compare/v2.138.0...v2.139.0) (2024-04-24)
613

714

packages/aws-cdk-lib/aws-lambda/lib/function.ts

+1-12
Original file line numberDiff line numberDiff line change
@@ -671,18 +671,7 @@ export class Function extends FunctionBase {
671671
* in the same account and region as the stack you are importing it into.
672672
*/
673673
public static fromFunctionArn(scope: Construct, id: string, functionArn: string): IFunction {
674-
/**
675-
* If the functionArn has a trailing version or alias (more than 7 parts when split by ":",
676-
* we trim off the trailing version/alias to retrieve the real functionArn.
677-
* See lambda resource ARN format here: https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html
678-
*/
679-
const parts = functionArn.split(':');
680-
if (parts.length > 7) {
681-
const _functionArn = parts.slice(0, 7).join(':');
682-
return Function.fromFunctionAttributes(scope, id, { functionArn: _functionArn });
683-
} else {
684-
return Function.fromFunctionAttributes(scope, id, { functionArn });
685-
}
674+
return Function.fromFunctionAttributes(scope, id, { functionArn });
686675
}
687676

688677
/**

packages/aws-cdk-lib/aws-lambda/test/function.test.ts

-24
Original file line numberDiff line numberDiff line change
@@ -397,30 +397,6 @@ describe('function', () => {
397397
expect(imported.functionName).toEqual('ProcessKinesisRecords');
398398
});
399399

400-
test('fromFunctionArn with verionArn as the input', () => {
401-
// GIVEN
402-
const stack2 = new cdk.Stack();
403-
404-
// WHEN
405-
const imported = lambda.Function.fromFunctionArn(stack2, 'Imported', 'arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords:1');
406-
407-
// THEN
408-
expect(imported.functionArn).toEqual('arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords');
409-
expect(imported.functionName).toEqual('ProcessKinesisRecords');
410-
});
411-
412-
test('fromFunctionArn with trailing alias as the input', () => {
413-
// GIVEN
414-
const stack2 = new cdk.Stack();
415-
416-
// WHEN
417-
const imported = lambda.Function.fromFunctionArn(stack2, 'Imported', 'arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords:TEST');
418-
419-
// THEN
420-
expect(imported.functionArn).toEqual('arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords');
421-
expect(imported.functionName).toEqual('ProcessKinesisRecords');
422-
});
423-
424400
test('Function.fromFunctionName', () => {
425401
// GIVEN
426402
const stack = new cdk.Stack();

packages/aws-cdk-lib/aws-lambda/test/lambda-version.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ describe('lambda version', () => {
1515
// WHEN
1616
const version = lambda.Version.fromVersionArn(stack, 'Version', 'arn:aws:lambda:region:account-id:function:function-name:version');
1717

18-
expect(version.version).toStrictEqual('version');
19-
expect(version.lambda.functionArn).toStrictEqual('arn:aws:lambda:region:account-id:function:function-name');
20-
2118
new cdk.CfnOutput(stack, 'ARN', { value: version.functionArn });
2219
new cdk.CfnOutput(stack, 'Name', { value: version.functionName });
2320

version.v2.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "2.139.0",
3-
"alphaVersion": "2.139.0-alpha.0"
2+
"version": "2.139.1",
3+
"alphaVersion": "2.139.1-alpha.0"
44
}

0 commit comments

Comments
 (0)