Skip to content

Commit

Permalink
Merge branch 'main' into codebuildKmsKey
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinZZ committed Apr 30, 2024
2 parents 6b5c115 + fd3a5e3 commit 862cd14
Show file tree
Hide file tree
Showing 28 changed files with 165 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-merit-badger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
badges: '[beginning-contributor,repeat-contributor,valued-contributor,admired-contributor,star-contributor,distinguished-contributor]'
thresholds: '[0,3,6,13,25,50]'
badge-type: 'achievement'
ignore-usernames: '[rix0rrr,iliapolo,otaviomacedo,kaizencc,comcalvi,TheRealAmazonKendra,vinayak-kukreja,mrgrain,pahud,cgarvis,kellertk,HBobertz,sumupitchayan,SankyRed,udaypant,colifran,khushail,scanlonp,mikewrighton,moelasmar,paulhcsun,awsmjs,evgenyka,GavinZZ,aaythapa,xazhao,ConnorRobertson,ssenchenko,gracelu0,jfuss,SimonCMoore,shikha372,kirtishrinkhala,godwingrs22,aws-cdk-automation,dependabot[bot],mergify[bot]]'
ignore-usernames: '[rix0rrr,iliapolo,otaviomacedo,kaizencc,comcalvi,TheRealAmazonKendra,vinayak-kukreja,mrgrain,pahud,cgarvis,kellertk,HBobertz,sumupitchayan,SankyRed,udaypant,colifran,khushail,scanlonp,mikewrighton,moelasmar,paulhcsun,awsmjs,evgenyka,GavinZZ,aaythapa,xazhao,ConnorRobertson,ssenchenko,gracelu0,jfuss,SimonCMoore,shikha372,kirtishrinkhala,godwingrs22,bergjaak,aws-cdk-automation,dependabot[bot],mergify[bot]]'
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pull_request_rules:
label:
add: [ contribution/core ]
conditions:
- author~=^(rix0rrr|iliapolo|otaviomacedo|kaizencc|comcalvi|TheRealAmazonKendra|vinayak-kukreja|mrgrain|pahud|cgarvis|kellertk|HBobertz|sumupitchayan|SankyRed|udaypant|colifran|scanlonp|mikewrighton|moelasmar|paulhcsun|awsmjs|evgenyka|GavinZZ|aaythapa|xazhao|ConnorRobertson|ssenchenko|gracelu0|jfuss|SimonCMoore|shikha372|kirtishrinkhala|godwingrs22)$
- author~=^(rix0rrr|iliapolo|otaviomacedo|kaizencc|comcalvi|TheRealAmazonKendra|vinayak-kukreja|mrgrain|pahud|cgarvis|kellertk|HBobertz|sumupitchayan|SankyRed|udaypant|colifran|scanlonp|mikewrighton|moelasmar|paulhcsun|awsmjs|evgenyka|GavinZZ|aaythapa|xazhao|ConnorRobertson|ssenchenko|gracelu0|jfuss|SimonCMoore|shikha372|kirtishrinkhala|godwingrs22|bergjaak)$
- -label~="contribution/core"
- name: automatic merge
actions:
Expand Down
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://github.com/conventional-changelog/standard-version) for commit guidelines.

## [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)

## [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)

## [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)
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://github.com/conventional-changelog/standard-version) for commit guidelines.

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


### Reverts

* 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))

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


Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/cloudformation-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"license": "Apache-2.0",
"dependencies": {
"@aws-cdk/aws-service-spec": "^0.0.64",
"@aws-cdk/service-spec-types": "^0.0.64",
"@aws-cdk/aws-service-spec": "^0.0.65",
"@aws-cdk/service-spec-types": "^0.0.65",
"chalk": "^4",
"diff": "^5.2.0",
"fast-deep-equal": "^3.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/integ-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@aws-cdk/cloud-assembly-schema": "0.0.0",
"@aws-cdk/cloudformation-diff": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/aws-service-spec": "^0.0.64",
"@aws-cdk/aws-service-spec": "^0.0.65",
"cdk-assets": "0.0.0",
"@aws-cdk/cdk-cli-wrapper": "0.0.0",
"aws-cdk": "0.0.0",
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
13 changes: 13 additions & 0 deletions packages/aws-cdk-lib/aws-paymentcryptography/.jsiirc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.paymentcryptography"
},
"dotnet": {
"package": "Amazon.CDK.AWS.PaymentCryptography"
},
"python": {
"module": "aws_cdk.aws_paymentcryptography"
}
}
}
39 changes: 39 additions & 0 deletions packages/aws-cdk-lib/aws-paymentcryptography/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# AWS::PaymentCryptography Construct Library
<!--BEGIN STABILITY BANNER-->

---

![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)

> All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use.
>
> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib
---

<!--END STABILITY BANNER-->

This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

```ts nofixture
import * as paymentcryptography from 'aws-cdk-lib/aws-paymentcryptography';
```

<!--BEGIN CFNONLY DISCLAIMER-->

There are no official hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet. Here are some suggestions on how to proceed:

- Search [Construct Hub for PaymentCryptography construct libraries](https://constructs.dev/search?q=paymentcryptography)
- 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::PaymentCryptography resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_PaymentCryptography.html) directly.


<!--BEGIN CFNONLY DISCLAIMER-->

There are no hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet.
However, you can still use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, and use this service exactly as you would using CloudFormation directly.

For more information on the resources and properties available for this service, see the [CloudFormation documentation for AWS::PaymentCryptography](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_PaymentCryptography.html).

(Read the [CDK Contributing Guide](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and submit an RFC if you are interested in contributing to this construct library.)

<!--END CFNONLY DISCLAIMER-->
1 change: 1 addition & 0 deletions packages/aws-cdk-lib/aws-paymentcryptography/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib';
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/aws-paymentcryptography/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// AWS::PaymentCryptography Cloudformation Resources
export * from './paymentcryptography.generated';
13 changes: 13 additions & 0 deletions packages/aws-cdk-lib/aws-route53profiles/.jsiirc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.route53profiles"
},
"dotnet": {
"package": "Amazon.CDK.AWS.Route53Profiles"
},
"python": {
"module": "aws_cdk.aws_route53profiles"
}
}
}
39 changes: 39 additions & 0 deletions packages/aws-cdk-lib/aws-route53profiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# AWS::Route53Profiles Construct Library
<!--BEGIN STABILITY BANNER-->

---

![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)

> All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use.
>
> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib
---

<!--END STABILITY BANNER-->

This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

```ts nofixture
import * as route53profiles from 'aws-cdk-lib/aws-route53profiles';
```

<!--BEGIN CFNONLY DISCLAIMER-->

There are no official hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet. Here are some suggestions on how to proceed:

- Search [Construct Hub for Route53Profiles construct libraries](https://constructs.dev/search?q=route53profiles)
- 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::Route53Profiles resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Route53Profiles.html) directly.


<!--BEGIN CFNONLY DISCLAIMER-->

There are no hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet.
However, you can still use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, and use this service exactly as you would using CloudFormation directly.

For more information on the resources and properties available for this service, see the [CloudFormation documentation for AWS::Route53Profiles](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Route53Profiles.html).

(Read the [CDK Contributing Guide](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and submit an RFC if you are interested in contributing to this construct library.)

<!--END CFNONLY DISCLAIMER-->
1 change: 1 addition & 0 deletions packages/aws-cdk-lib/aws-route53profiles/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib';
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/aws-route53profiles/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// AWS::Route53Profiles Cloudformation Resources
export * from './route53profiles.generated';
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export * as aws_opsworkscm from './aws-opsworkscm';
export * as aws_organizations from './aws-organizations';
export * as aws_osis from './aws-osis';
export * as aws_panorama from './aws-panorama';
export * as aws_paymentcryptography from './aws-paymentcryptography';
export * as aws_pcaconnectorad from './aws-pcaconnectorad';
export * as aws_personalize from './aws-personalize';
export * as aws_pinpoint from './aws-pinpoint';
Expand All @@ -213,6 +214,7 @@ export * as aws_rolesanywhere from './aws-rolesanywhere';
export * as aws_route53 from './aws-route53';
export * as aws_route53_patterns from './aws-route53-patterns';
export * as aws_route53_targets from './aws-route53-targets';
export * as aws_route53profiles from './aws-route53profiles';
export * as aws_route53recoverycontrol from './aws-route53recoverycontrol';
export * as aws_route53recoveryreadiness from './aws-route53recoveryreadiness';
export * as aws_route53resolver from './aws-route53resolver';
Expand Down
4 changes: 3 additions & 1 deletion packages/aws-cdk-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"mime-types": "^2.1.35"
},
"devDependencies": {
"@aws-cdk/aws-service-spec": "^0.0.64",
"@aws-cdk/aws-service-spec": "^0.0.65",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/custom-resource-handlers": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
Expand Down Expand Up @@ -407,6 +407,7 @@
"./aws-organizations": "./aws-organizations/index.js",
"./aws-osis": "./aws-osis/index.js",
"./aws-panorama": "./aws-panorama/index.js",
"./aws-paymentcryptography": "./aws-paymentcryptography/index.js",
"./aws-pcaconnectorad": "./aws-pcaconnectorad/index.js",
"./aws-personalize": "./aws-personalize/index.js",
"./aws-pinpoint": "./aws-pinpoint/index.js",
Expand All @@ -429,6 +430,7 @@
"./aws-route53": "./aws-route53/index.js",
"./aws-route53-patterns": "./aws-route53-patterns/index.js",
"./aws-route53-targets": "./aws-route53-targets/index.js",
"./aws-route53profiles": "./aws-route53profiles/index.js",
"./aws-route53recoverycontrol": "./aws-route53recoverycontrol/index.js",
"./aws-route53recoveryreadiness": "./aws-route53recoveryreadiness/index.js",
"./aws-route53resolver": "./aws-route53resolver/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/aws-cdk-lib/scripts/scope-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@
"aws-panorama": [
"AWS::Panorama"
],
"aws-paymentcryptography": [
"AWS::PaymentCryptography"
],
"aws-pcaconnectorad": [
"AWS::PCAConnectorAD"
],
Expand Down Expand Up @@ -582,6 +585,9 @@
"aws-route53": [
"AWS::Route53"
],
"aws-route53profiles": [
"AWS::Route53Profiles"
],
"aws-route53recoverycontrol": [
"AWS::Route53RecoveryControl"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

----------------

** cdk-from-cfn@0.156.0 - https://www.npmjs.com/package/cdk-from-cfn/v/0.156.0 | MIT OR Apache-2.0
** cdk-from-cfn@0.157.0 - https://www.npmjs.com/package/cdk-from-cfn/v/0.157.0 | MIT OR Apache-2.0

----------------

Expand Down
5 changes: 1 addition & 4 deletions packages/aws-cdk/lib/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ export function generateStack(template: string, stackName: string, language: str
try {
return cdk_from_cfn.transmute(template, language, formattedStackName);
} catch (e) {
const errorMessage = (e as Error).message === 'unreachable'
? 'template and/or language inputs caused the source code to panic'
: (e as Error).message.replace('TransmuteError: ', '');
throw new Error(`${formattedStackName} could not be generated because ${errorMessage}`);
throw new Error(`${formattedStackName} could not be generated because ${(e as Error).message}`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"aws-sdk": "^2.1600.0",
"camelcase": "^6.3.0",
"cdk-assets": "0.0.0",
"cdk-from-cfn": "^0.156.0",
"cdk-from-cfn": "^0.157.0",
"chalk": "^4",
"chokidar": "^3.6.0",
"decamelize": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk/test/cdk-toolkit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,8 @@ describe('synth', () => {
stackName: 'cannot-generate-template',
fromPath: path.join(__dirname, 'commands', 'test-resources', 'templates', 'sqs-template.json'),
language: 'rust',
})).rejects.toThrowError('CannotGenerateTemplateStack could not be generated because template and/or language inputs caused the source code to panic');
expect(stderrMock.mock.calls[1][0]).toContain(' ❌ Migrate failed for `cannot-generate-template`: CannotGenerateTemplateStack could not be generated because template and/or language inputs caused the source code to panic');
})).rejects.toThrowError('CannotGenerateTemplateStack could not be generated because rust is not a supported language');
expect(stderrMock.mock.calls[1][0]).toContain(' ❌ Migrate failed for `cannot-generate-template`: CannotGenerateTemplateStack could not be generated because rust is not a supported language');
});

cliTest('migrate succeeds for valid template from local path when no lanugage is provided', async (workDir) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/test/commands/migrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('Migrate Function Tests', () => {
});

test('generateStack throws error when called for other language', () => {
expect(() => generateStack(validTemplate, 'BadBadBad', 'php')).toThrowError('BadBadBadStack could not be generated because template and/or language inputs caused the source code to panic');
expect(() => generateStack(validTemplate, 'BadBadBad', 'php')).toThrowError('BadBadBadStack could not be generated because php is not a supported language');
});

test('generateStack throws error for invalid resource property', () => {
Expand Down
4 changes: 2 additions & 2 deletions tools/@aws-cdk/spec2cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
},
"license": "Apache-2.0",
"dependencies": {
"@aws-cdk/aws-service-spec": "^0.0.64",
"@aws-cdk/aws-service-spec": "^0.0.65",
"@aws-cdk/service-spec-importers": "^0.0.31",
"@aws-cdk/service-spec-types": "^0.0.64",
"@aws-cdk/service-spec-types": "^0.0.65",
"@cdklabs/tskb": "^0.0.3",
"@cdklabs/typewriter": "^0.0.3",
"camelcase": "^6",
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

0 comments on commit 862cd14

Please sign in to comment.