Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): v2.139.1 #30007

Merged
merged 5 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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

## [2.139.1-alpha.0](https:/aws/aws-cdk/compare/v2.139.0-alpha.0...v2.139.1-alpha.0) (2024-04-29)

## [2.139.0-alpha.0](https:/aws/aws-cdk/compare/v2.138.0-alpha.0...v2.139.0-alpha.0) (2024-04-24)

## [2.138.0-alpha.0](https:/aws/aws-cdk/compare/v2.137.0-alpha.0...v2.138.0-alpha.0) (2024-04-18)
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## [2.139.1](https:/aws/aws-cdk/compare/v2.139.0...v2.139.1) (2024-04-29)


### Reverts

* "fix(lambda): version.fromVersionArn creates invalid Version object" ([#30003](https:/aws/aws-cdk/issues/30003)) ([ced7a46](https:/aws/aws-cdk/commit/ced7a46b45aeee335264d91cf8287da4837dbab8))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the quotes around this?


## [2.139.0](https:/aws/aws-cdk/compare/v2.138.0...v2.139.0) (2024-04-24)


Expand Down
13 changes: 1 addition & 12 deletions packages/aws-cdk-lib/aws-lambda/lib/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,18 +671,7 @@ export class Function extends FunctionBase {
* in the same account and region as the stack you are importing it into.
*/
public static fromFunctionArn(scope: Construct, id: string, functionArn: string): IFunction {
/**
* If the functionArn has a trailing version or alias (more than 7 parts when split by ":",
* we trim off the trailing version/alias to retrieve the real functionArn.
* See lambda resource ARN format here: https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html
*/
const parts = functionArn.split(':');
if (parts.length > 7) {
const _functionArn = parts.slice(0, 7).join(':');
return Function.fromFunctionAttributes(scope, id, { functionArn: _functionArn });
} else {
return Function.fromFunctionAttributes(scope, id, { functionArn });
}
return Function.fromFunctionAttributes(scope, id, { functionArn });
}

/**
Expand Down
24 changes: 0 additions & 24 deletions packages/aws-cdk-lib/aws-lambda/test/function.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,30 +397,6 @@ describe('function', () => {
expect(imported.functionName).toEqual('ProcessKinesisRecords');
});

test('fromFunctionArn with verionArn as the input', () => {
// GIVEN
const stack2 = new cdk.Stack();

// WHEN
const imported = lambda.Function.fromFunctionArn(stack2, 'Imported', 'arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords:1');

// THEN
expect(imported.functionArn).toEqual('arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords');
expect(imported.functionName).toEqual('ProcessKinesisRecords');
});

test('fromFunctionArn with trailing alias as the input', () => {
// GIVEN
const stack2 = new cdk.Stack();

// WHEN
const imported = lambda.Function.fromFunctionArn(stack2, 'Imported', 'arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords:TEST');

// THEN
expect(imported.functionArn).toEqual('arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords');
expect(imported.functionName).toEqual('ProcessKinesisRecords');
});

test('Function.fromFunctionName', () => {
// GIVEN
const stack = new cdk.Stack();
Expand Down
3 changes: 0 additions & 3 deletions packages/aws-cdk-lib/aws-lambda/test/lambda-version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ describe('lambda version', () => {
// WHEN
const version = lambda.Version.fromVersionArn(stack, 'Version', 'arn:aws:lambda:region:account-id:function:function-name:version');

expect(version.version).toStrictEqual('version');
expect(version.lambda.functionArn).toStrictEqual('arn:aws:lambda:region:account-id:function:function-name');

new cdk.CfnOutput(stack, 'ARN', { value: version.functionArn });
new cdk.CfnOutput(stack, 'Name', { value: version.functionName });

Expand Down
4 changes: 2 additions & 2 deletions version.v2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "2.139.0",
"alphaVersion": "2.139.0-alpha.0"
"version": "2.139.1",
"alphaVersion": "2.139.1-alpha.0"
}
Loading