Skip to content

Commit

Permalink
Merge branch 'main' into pahud/aws-eks-cannot-update-cluster-21439
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Dec 20, 2022
2 parents 6f18a71 + fcf1bfa commit 452d01b
Show file tree
Hide file tree
Showing 447 changed files with 13,795 additions and 3,666 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.v2.alpha.md
Expand Up @@ -2,6 +2,34 @@

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.55.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.55.0-alpha.0...v2.55.1-alpha.0) (2022-12-16)

## [2.55.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.54.0-alpha.0...v2.55.0-alpha.0) (2022-12-14)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **appsync:** `DataSource.createResolver`,
`DataSource.createFunction`, and `GraphQlApi.createResolver` now require
2 arguments instead of 1.
* **appsync:** Renames `Schema` to `SchemaFile` that implements `ISchema`. Removes all `addXxx` type methods from `GraphQlApi`.

### Features

* **aws-lambda-python:** add command hooks for bundling to allow for execution of custom commands in the build container ([#23330](https://github.com/aws/aws-cdk/issues/23330)) ([d3d071f](https://github.com/aws/aws-cdk/commit/d3d071f51fab61ae0e484f143e68e698bba48537))
* **gamelift:** add GameSessionQueue L2 Construct for GameLift ([#23266](https://github.com/aws/aws-cdk/issues/23266)) ([1ded644](https://github.com/aws/aws-cdk/commit/1ded64430d8258f6666743e245ef5ac31ed4bf0b))


### Bug Fixes

* **appsync:** unexpected resolver replacement ([#23322](https://github.com/aws/aws-cdk/issues/23322)) ([6dc15d4](https://github.com/aws/aws-cdk/commit/6dc15d40764dc71fe6a3b70691f586e96cdcf730)), closes [#13269](https://github.com/aws/aws-cdk/issues/13269)
* **servicecatalogappregistry:** synth error when associating a nested stack ([#23248](https://github.com/aws/aws-cdk/issues/23248)) ([30301d9](https://github.com/aws/aws-cdk/commit/30301d9e5ab4af86c5e48a5ad47013924acdfed7))


### Miscellaneous Chores

* **appsync:** removes codefirst schema generation ([#23250](https://github.com/aws/aws-cdk/issues/23250)) ([2bd1e41](https://github.com/aws/aws-cdk/commit/2bd1e4184aea054766f7872b300b960b2b83ef06))

## [2.54.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.53.0-alpha.0...v2.54.0-alpha.0) (2022-12-07)


Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.v2.md
Expand Up @@ -2,6 +2,40 @@

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.55.1](https://github.com/aws/aws-cdk/compare/v2.55.0...v2.55.1) (2022-12-16)


### Bug Fixes

* **s3-deployment:** source markers missing when there are multiple sources ([0bb0181](https://github.com/aws/aws-cdk/commit/0bb01815b2fa7708ded6a72e220916e2388993cf)), closes [#23321](https://github.com/aws/aws-cdk/issues/23321) [40aws-cdk/aws-s3-deployment/lib/lambda/index.py#L64](https://github.com/40aws-cdk/aws-s3-deployment/lib/lambda/index.py/issues/L64) [40aws-cdk/aws-s3-deployment/lib/lambda/index.py#L137](https://github.com/40aws-cdk/aws-s3-deployment/lib/lambda/index.py/issues/L137)

## [2.55.0](https://github.com/aws/aws-cdk/compare/v2.54.0...v2.55.0) (2022-12-14)


### Features

* **autoscaling:** support default instance warmup for Auto Scaling groups ([#23285](https://github.com/aws/aws-cdk/issues/23285)) ([3f706e2](https://github.com/aws/aws-cdk/commit/3f706e2210fb1ffe2b70e27862a17594c3337800))
* **cfnspec:** cloudformation spec v101.0.0 ([#23294](https://github.com/aws/aws-cdk/issues/23294)) ([3951f09](https://github.com/aws/aws-cdk/commit/3951f09fb370b74936f3fb45e7188ac6c7343b67))
* **cognito:** add new AdvancedSecurityMode property ([#23261](https://github.com/aws/aws-cdk/issues/23261)) ([9cc9bd3](https://github.com/aws/aws-cdk/commit/9cc9bd34a9d67e7e072292e20aeb9e003e55f158))
* **core:** add volumes-from option to docker run command for bundling ([#22829](https://github.com/aws/aws-cdk/issues/22829)) ([813c2f1](https://github.com/aws/aws-cdk/commit/813c2f17b6c0f1056ed43a8a93f4cffbe9ae9736)), closes [#8799](https://github.com/aws/aws-cdk/issues/8799) [#21660](https://github.com/aws/aws-cdk/issues/21660)
* **s3:** update runtime of notifications-handler to python3.9 ([#23209](https://github.com/aws/aws-cdk/issues/23209)) ([b2d293d](https://github.com/aws/aws-cdk/commit/b2d293d3f8d36547d8cfd7ff3957428718c3827f))
* **s3-deployment:** add additional sources with `addSource` ([#23321](https://github.com/aws/aws-cdk/issues/23321)) ([b34d0b7](https://github.com/aws/aws-cdk/commit/b34d0b7b0152dc5edb2f963054c6af273119006e)), closes [#22857](https://github.com/aws/aws-cdk/issues/22857)


### Bug Fixes

* **cloudwatch:** math expressions incorrectly warn about metricsinsights variable names ([#23316](https://github.com/aws/aws-cdk/issues/23316)) ([55108b9](https://github.com/aws/aws-cdk/commit/55108b969a94f671a492b4536d2ad9d13d11cf9d))
* **core:** cross stack references to string lists break ([#22873](https://github.com/aws/aws-cdk/issues/22873)) ([3ddb8cf](https://github.com/aws/aws-cdk/commit/3ddb8cf44f1e7a285b767f4f4540924a728083c4)), closes [/docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html#aws-resource-ec2](https://github.com/aws//docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html/issues/aws-resource-ec2) [#21682](https://github.com/aws/aws-cdk/issues/21682)
* **custom-resources:** inactive lambda functions fail on invoke ([#22612](https://github.com/aws/aws-cdk/issues/22612)) ([def2971](https://github.com/aws/aws-cdk/commit/def2971d91eedbd327d3acec201d902376129f25)), closes [#20123](https://github.com/aws/aws-cdk/issues/20123)
* **ec2:** Invalid security group ID ([#22859](https://github.com/aws/aws-cdk/issues/22859)) ([c2043c8](https://github.com/aws/aws-cdk/commit/c2043c8dfaaa3189f625dd93c94ee9139e5505e6)), closes [aws-cdk/aws-ec2/lib/peer.ts#L224](https://github.com/aws-cdk/aws-ec2/lib/peer.ts/issues/L224)
* **ecr:** grants for cross-account principals result in failed deployments ([#16376](https://github.com/aws/aws-cdk/issues/16376)) ([84e20f8](https://github.com/aws/aws-cdk/commit/84e20f8da37c22639c033f51c89ef608260e7578)), closes [#15070](https://github.com/aws/aws-cdk/issues/15070)
* **opensearch:** Don't throw a Az count mismatch for imported VPCs ([#22654](https://github.com/aws/aws-cdk/issues/22654)) ([6a28b7f](https://github.com/aws/aws-cdk/commit/6a28b7f0aecf0bc9c5876bf4c7df87d69f0af836)), closes [#22651](https://github.com/aws/aws-cdk/issues/22651)


### Reverts

* "chore: save exclusion rules when bumping the CFN spec ([#22788](https://github.com/aws/aws-cdk/issues/22788))" ([#23282](https://github.com/aws/aws-cdk/issues/23282)) ([cc76cfb](https://github.com/aws/aws-cdk/commit/cc76cfb124a59131996d75d05a82b7985c787ae0))

## [2.54.0](https://github.com/aws/aws-cdk/compare/v2.53.0...v2.54.0) (2022-12-07)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.85",
"cdk-generate-synthetic-examples": "^0.1.92",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
Expand Down
10 changes: 8 additions & 2 deletions packages/@aws-cdk/aws-apigateway/lib/base-path-mapping.ts
Expand Up @@ -56,8 +56,14 @@ export class BasePathMapping extends Resource {
super(scope, id);

if (props.basePath && !Token.isUnresolved(props.basePath)) {
if (!props.basePath.match(/^[a-zA-Z0-9$_.+!*'()-]+$/)) {
throw new Error(`A base path may only contain letters, numbers, and one of "$-_.+!*'()", received: ${props.basePath}`);
if (props.basePath.startsWith('/') || props.basePath.endsWith('/')) {
throw new Error(`A base path cannot start or end with /", received: ${props.basePath}`);
}
if (props.basePath.match(/\/{2,}/)) {
throw new Error(`A base path cannot have more than one consecutive /", received: ${props.basePath}`);
}
if (!props.basePath.match(/^[a-zA-Z0-9$_.+!*'()-/]+$/)) {
throw new Error(`A base path may only contain letters, numbers, and one of "$-_.+!*'()/", received: ${props.basePath}`);
}
}

Expand Down
110 changes: 103 additions & 7 deletions packages/@aws-cdk/aws-apigateway/test/base-path-mapping.test.ts
Expand Up @@ -8,7 +8,7 @@ describe('BasePathMapping', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have atleast one method.
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
Expand All @@ -33,7 +33,7 @@ describe('BasePathMapping', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have atleast one method.
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
Expand All @@ -53,19 +53,43 @@ describe('BasePathMapping', () => {
});
});

test('throw error for invalid basePath property', () => {
test('specify multi-level basePath property', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have atleast one method.
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
endpointType: apigw.EndpointType.REGIONAL,
});

// WHEN
const invalidBasePath = '/invalid-/base-path';
new apigw.BasePathMapping(stack, 'MyBasePath', {
restApi: api,
domainName: domain,
basePath: 'api/v1/example',
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::BasePathMapping', {
BasePath: 'api/v1/example',
});
});

test('throws when basePath contains an invalid character', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
endpointType: apigw.EndpointType.REGIONAL,
});

// WHEN
const invalidBasePath = 'invalid-/base-path?';

// THEN
expect(() => {
Expand All @@ -77,11 +101,83 @@ describe('BasePathMapping', () => {
}).toThrowError(/base path may only contain/);
});

test('throw error for basePath starting with /', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
endpointType: apigw.EndpointType.REGIONAL,
});

// WHEN
const invalidBasePath = '/invalid-base-path';

// THEN
expect(() => {
new apigw.BasePathMapping(stack, 'MyBasePath', {
restApi: api,
domainName: domain,
basePath: invalidBasePath,
});
}).toThrowError(/A base path cannot start or end with/);
});

test('throw error for basePath ending with /', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
endpointType: apigw.EndpointType.REGIONAL,
});

// WHEN
const invalidBasePath = 'invalid-base-path/';

// THEN
expect(() => {
new apigw.BasePathMapping(stack, 'MyBasePath', {
restApi: api,
domainName: domain,
basePath: invalidBasePath,
});
}).toThrowError(/A base path cannot start or end with/);
});

test('throw error for basePath containing more than one consecutive /', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
endpointType: apigw.EndpointType.REGIONAL,
});

// WHEN
const invalidBasePath = 'in//valid-base-path';

// THEN
expect(() => {
new apigw.BasePathMapping(stack, 'MyBasePath', {
restApi: api,
domainName: domain,
basePath: invalidBasePath,
});
}).toThrowError(/A base path cannot have more than one consecutive \//);
});

test('specify stage property', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have atleast one method.
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
Expand Down Expand Up @@ -111,7 +207,7 @@ describe('BasePathMapping', () => {
// GIVEN
const stack = new cdk.Stack();
const api = new apigw.RestApi(stack, 'MyApi');
api.root.addMethod('GET'); // api must have atleast one method.
api.root.addMethod('GET'); // api must have at least one method.
const domain = new apigw.DomainName(stack, 'MyDomain', {
domainName: 'example.com',
certificate: acm.Certificate.fromCertificateArn(stack, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
Expand Down
Expand Up @@ -81,6 +81,12 @@
"data": "MappingTwo551C79ED"
}
],
"/test-stack/MappingThree/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "MappingThree36BBA1B6"
}
],
"/test-stack/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
Expand Down
Expand Up @@ -70,6 +70,16 @@
"Ref": "ApiF70053CD"
}
}
},
"MappingThree36BBA1B6": {
"Type": "AWS::ApiGateway::BasePathMapping",
"Properties": {
"DomainName": "domainName",
"BasePath": "api/v1/multi-level-path",
"RestApiId": {
"Ref": "ApiF70053CD"
}
}
}
},
"Outputs": {
Expand Down
Expand Up @@ -217,6 +217,34 @@
"fqn": "@aws-cdk/aws-apigateway.BasePathMapping",
"version": "0.0.0"
}
},
"MappingThree": {
"id": "MappingThree",
"path": "test-stack/MappingThree",
"children": {
"Resource": {
"id": "Resource",
"path": "test-stack/MappingThree/Resource",
"attributes": {
"aws:cdk:cloudformation:type": "AWS::ApiGateway::BasePathMapping",
"aws:cdk:cloudformation:props": {
"domainName": "domainName",
"basePath": "path",
"restApiId": {
"Ref": "ApiF70053CD"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-apigateway.CfnBasePathMapping",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-apigateway.BasePathMapping",
"version": "0.0.0"
}
}
},
"constructInfo": {
Expand Down
Expand Up @@ -27,6 +27,13 @@ export class TestStack extends cdk.Stack {
basePath: 'path',
attachToStage: false,
});

new apigateway.BasePathMapping(this, 'MappingThree', {
domainName,
restApi,
basePath: 'api/v1/multi-level-path',
attachToStage: false,
});
}
}

Expand Down

0 comments on commit 452d01b

Please sign in to comment.