Skip to content

Commit dfb44b8

Browse files
authored
Merge branch 'master' into bundling-excl-stage
2 parents 218f8fc + 29b379c commit dfb44b8

File tree

95 files changed

+9905
-1458
lines changed

Some content is hidden

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

95 files changed

+9905
-1458
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
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+
## [1.134.0](https://github.com/aws/aws-cdk/compare/v1.133.0...v1.134.0) (2021-11-23)
6+
7+
8+
### Features
9+
10+
* **apigatewayv2:** domain endpoint type, security policy and endpoint migration ([#17518](https://github.com/aws/aws-cdk/issues/17518)) ([261b331](https://github.com/aws/aws-cdk/commit/261b331e89be01dc996d153c91b4018e7ddfda29))
11+
* **cfnspec:** cloudformation spec v49.0.0 ([#17621](https://github.com/aws/aws-cdk/issues/17621)) ([ce638b4](https://github.com/aws/aws-cdk/commit/ce638b407ac9efc6a3ee4d5ecd22c68ab68b8e58))
12+
* **docdb:** add option to set the name of the generated Secret ([#17574](https://github.com/aws/aws-cdk/issues/17574)) ([18c9ef7](https://github.com/aws/aws-cdk/commit/18c9ef713717fcb2f84e687c1e34c887a50264bd)), closes [#17572](https://github.com/aws/aws-cdk/issues/17572)
13+
* **eks:** ALB Controller ([#17618](https://github.com/aws/aws-cdk/issues/17618)) ([1faf31d](https://github.com/aws/aws-cdk/commit/1faf31d1ec7ffec4c6323a050126b0b054094c63))
14+
* **msk:** add Kafka version 2.6.2 ([#17497](https://github.com/aws/aws-cdk/issues/17497)) ([5f1f476](https://github.com/aws/aws-cdk/commit/5f1f4762e964345741426fa1242320a5fc117338))
15+
16+
17+
### Bug Fixes
18+
19+
* **assets:** add missing SAM asset metadata information ([#17591](https://github.com/aws/aws-cdk/issues/17591)) ([55df760](https://github.com/aws/aws-cdk/commit/55df760fdd9514384de019e5ce338d5250c7df97)), closes [#14593](https://github.com/aws/aws-cdk/issues/14593)
20+
* **aws-ecs:** check for invalid capacityProviderName ([#17291](https://github.com/aws/aws-cdk/issues/17291)) ([6e2fde4](https://github.com/aws/aws-cdk/commit/6e2fde452de73c51011ddb14ede40ca0471d3663)), closes [#17321](https://github.com/aws/aws-cdk/issues/17321)
21+
* **opensearch:** correctly validate ebs configuration against instance types ([#16911](https://github.com/aws/aws-cdk/issues/16911)) ([34af598](https://github.com/aws/aws-cdk/commit/34af5988b7c1ff003d10612150191803f762a79f)), closes [#11898](https://github.com/aws/aws-cdk/issues/11898)
22+
523
## [1.133.0](https://github.com/aws/aws-cdk/compare/v1.132.0...v1.133.0) (2021-11-19)
624

725

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,12 @@ contain three slashes to achieve the same effect:
556556
For a practical example of how making sample code compilable works, see the
557557
`aws-ec2` package.
558558

559+
> ⚠️ NOTE: README files often contain code snippets that refer to modules that are consumers
560+
> of the current module, and hence not present in the current module's dependency closure.
561+
> Compilation of these snippets will fail if the module referenced has not been built.
562+
> For the best experience when working on snippets, a full build of the CDK repo is required.
563+
> However, it may be prudent to "build up" these modules as required.
564+
559565
#### Recommendations
560566

561567
In order to offer a consistent documentation style throughout the AWS CDK

DEPRECATED_APIs.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -600,20 +600,10 @@
600600
| @aws-cdk/aws-dynamodb | Table.​grantListStreams() | Use {@link #grantTableListStreams} for more granular permission |
601601
| @aws-cdk/aws-dynamodb | Table.​metricSystemErrors() | use `metricSystemErrorsForOperations`. |
602602
| @aws-cdk/aws-dynamodb | TableOptions.​serverSideEncryption | This property is deprecated. In order to obtain the same behavior as enabling this, set the `encryption` property to `TableEncryption.AWS_MANAGED` instead. |
603-
| @aws-cdk/aws-rds | Credentials.​fromUsername() | use `fromGeneratedSecret()` or `fromPassword()` for new Clusters and Instances. Note that switching from `fromUsername()` to `fromGeneratedSecret()` or `fromPassword()` for already deployed Clusters or Instances will result in their replacement! |
604603
| @aws-cdk/aws-rds | CredentialsFromUsernameOptions | supporting API `fromUsername()` has been deprecated. See deprecation notice of the API. |
605604
| @aws-cdk/aws-rds | CredentialsFromUsernameOptions.​password | supporting API `fromUsername()` has been deprecated. See deprecation notice of the API. |
606-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​MARIADB | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link mariaDb()} method |
607-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​MYSQL | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link mysql()} method |
608-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​EE | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link oracleEe()} method |
609605
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​SE | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
610606
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​SE1 | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
611-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​SE2 | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link oracleSe2()} method |
612-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​POSTGRES | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link postgres()} method |
613-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​EE | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerEe()} method |
614-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​EX | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerEx()} method |
615-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​SE | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerSe()} method |
616-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​WEB | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerWeb()} method |
617607
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​oracleSe() | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
618608
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​oracleSe1() | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
619609
| @aws-cdk/aws-rds | DatabaseInstanceNewProps.​vpcPlacement | use `vpcSubnets` |
@@ -751,7 +741,6 @@
751741
| @aws-cdk/aws-ecs | BaseService.​configureAwsVpcNetworking() | use configureAwsVpcNetworkingWithSecurityGroups instead. |
752742
| @aws-cdk/aws-ecs | BaseServiceOptions.​propagateTaskTagsFrom | Use `propagateTags` instead. |
753743
| @aws-cdk/aws-ecs | Cluster.​addAutoScalingGroup() | Use {@link Cluster.addAsgCapacityProvider} instead. |
754-
| @aws-cdk/aws-ecs | Cluster.​addCapacity() | Use {@link Cluster.addAsgCapacityProvider} instead. |
755744
| @aws-cdk/aws-ecs | Cluster.​addCapacityProvider() | Use {@link enableFargateCapacityProviders} instead. |
756745
| @aws-cdk/aws-ecs | ClusterProps.​capacityProviders | Use {@link ClusterProps.enableFargateCapacityProviders} instead. |
757746
| @aws-cdk/aws-ecs | Ec2ServiceProps.​securityGroup | use securityGroups instead. |

deprecated_apis.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -599,17 +599,8 @@ constructs.Node#uniqueId
599599
@aws-cdk/aws-rds.Credentials#fromUsername
600600
@aws-cdk/aws-rds.CredentialsFromUsernameOptions
601601
@aws-cdk/aws-rds.CredentialsFromUsernameOptions#password
602-
@aws-cdk/aws-rds.DatabaseInstanceEngine#MARIADB
603-
@aws-cdk/aws-rds.DatabaseInstanceEngine#MYSQL
604-
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_EE
605602
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE
606603
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE1
607-
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE2
608-
@aws-cdk/aws-rds.DatabaseInstanceEngine#POSTGRES
609-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_EE
610-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_EX
611-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_SE
612-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_WEB
613604
@aws-cdk/aws-rds.DatabaseInstanceEngine#oracleSe
614605
@aws-cdk/aws-rds.DatabaseInstanceEngine#oracleSe1
615606
@aws-cdk/aws-rds.DatabaseInstanceNewProps#vpcPlacement
@@ -721,7 +712,6 @@ constructs.Node#uniqueId
721712
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_6
722713
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_8
723714
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_9
724-
@aws-cdk/aws-rds.SnapshotCredentials#fromGeneratedPassword
725715
@aws-cdk/aws-rds.SqlServerEngineVersion#VER_15_00_4043_23_V1
726716
@aws-cdk/aws-autoscaling.BlockDevice#mappingEnabled
727717
@aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps#notificationsTopic
@@ -747,7 +737,6 @@ constructs.Node#uniqueId
747737
@aws-cdk/aws-ecs.BaseService#configureAwsVpcNetworking
748738
@aws-cdk/aws-ecs.BaseServiceOptions#propagateTaskTagsFrom
749739
@aws-cdk/aws-ecs.Cluster#addAutoScalingGroup
750-
@aws-cdk/aws-ecs.Cluster#addCapacity
751740
@aws-cdk/aws-ecs.Cluster#addCapacityProvider
752741
@aws-cdk/aws-ecs.ClusterProps#capacityProviders
753742
@aws-cdk/aws-ecs.Ec2ServiceProps#securityGroup

packages/@aws-cdk/assertions/rosetta/default.ts-fixture

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { Construct, Stack } from '@aws-cdk/core';
1+
// Fixture with packages imported, but nothing else
2+
import { Construct } from 'constructs';
3+
import { Stack } from '@aws-cdk/core';
24
import { Capture, Match, Template } from '@aws-cdk/assertions';
35

46
class Fixture extends Stack {

packages/@aws-cdk/aws-apigateway/rosetta/default.ts-fixture

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Fixture with packages imported, but nothing else
2-
import { Construct, Stack } from '@aws-cdk/core';
2+
import { Construct } from 'constructs';
3+
import { Stack } from '@aws-cdk/core';
34
import apigateway = require('@aws-cdk/aws-apigateway');
45
import cognito = require('@aws-cdk/aws-cognito');
56
import lambda = require('@aws-cdk/aws-lambda');

packages/@aws-cdk/aws-apigatewayv2/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ const api = new apigwv2.HttpApi(this, 'HttpProxyProdApi', {
204204
});
205205
```
206206

207+
To migrate a domain endpoint from one type to another, you can add a new endpoint configuration via `addEndpoint()`
208+
and then configure DNS records to route traffic to the new endpoint. After that, you can remove the previous endpoint configuration.
209+
Learn more at [Migrating a custom domain name](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-regional-api-custom-domain-migrate.html)
210+
207211
To associate a specific `Stage` to a custom domain mapping -
208212

209213
```ts

packages/@aws-cdk/aws-apigatewayv2/lib/common/domain-name.ts

Lines changed: 102 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
import { ICertificate } from '@aws-cdk/aws-certificatemanager';
22
import { IBucket } from '@aws-cdk/aws-s3';
3-
import { IResource, Resource, Token } from '@aws-cdk/core';
3+
import { IResource, Lazy, Resource, Token } from '@aws-cdk/core';
44
import { Construct } from 'constructs';
55
import { CfnDomainName, CfnDomainNameProps } from '../apigatewayv2.generated';
66

7+
/**
8+
* The minimum version of the SSL protocol that you want API Gateway to use for HTTPS connections.
9+
*/
10+
export enum SecurityPolicy {
11+
/** Cipher suite TLS 1.0 */
12+
TLS_1_0 = 'TLS_1_0',
13+
14+
/** Cipher suite TLS 1.2 */
15+
TLS_1_2 = 'TLS_1_2',
16+
}
17+
18+
/**
19+
* Endpoint type for a domain name.
20+
*/
21+
export enum EndpointType {
22+
/**
23+
* For an edge-optimized custom domain name.
24+
*/
25+
EDGE = 'EDGE',
26+
/**
27+
* For a regional custom domain name.
28+
*/
29+
REGIONAL = 'REGIONAL',
30+
}
31+
732
/**
833
* Represents an APIGatewayV2 DomainName
934
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html
@@ -51,20 +76,54 @@ export interface DomainNameAttributes {
5176
/**
5277
* properties used for creating the DomainName
5378
*/
54-
export interface DomainNameProps {
79+
export interface DomainNameProps extends EndpointOptions {
5580
/**
5681
* The custom domain name
5782
*/
5883
readonly domainName: string;
84+
85+
/**
86+
* The mutual TLS authentication configuration for a custom domain name.
87+
* @default - mTLS is not configured.
88+
*/
89+
readonly mtls?: MTLSConfig;
90+
}
91+
92+
/**
93+
* properties for creating a domain name endpoint
94+
*/
95+
export interface EndpointOptions {
5996
/**
60-
* The ACM certificate for this domain name
97+
* The ACM certificate for this domain name.
98+
* Certificate can be both ACM issued or imported.
6199
*/
62100
readonly certificate: ICertificate;
101+
63102
/**
64-
* The mutual TLS authentication configuration for a custom domain name.
65-
* @default - mTLS is not configured.
103+
* The user-friendly name of the certificate that will be used by the endpoint for this domain name.
104+
* @default - No friendly certificate name
105+
*/
106+
readonly certificateName?: string;
107+
108+
/**
109+
* The type of endpoint for this DomainName.
110+
* @default EndpointType.REGIONAL
111+
*/
112+
readonly endpointType?: EndpointType;
113+
114+
/**
115+
* The Transport Layer Security (TLS) version + cipher suite for this domain name.
116+
* @default SecurityPolicy.TLS_1_2
117+
*/
118+
readonly securityPolicy?: SecurityPolicy;
119+
120+
/**
121+
* A public certificate issued by ACM to validate that you own a custom domain. This parameter is required
122+
* only when you configure mutual TLS authentication and you specify an ACM imported or private CA certificate
123+
* for `certificate`. The ownership certificate validates that you have permissions to use the domain name.
124+
* @default - only required when configuring mTLS
66125
*/
67-
readonly mtls?: MTLSConfig
126+
readonly ownershipCertificate?: ICertificate;
68127
}
69128

70129
/**
@@ -107,6 +166,7 @@ export class DomainName extends Resource implements IDomainName {
107166
public readonly name: string;
108167
public readonly regionalDomainName: string;
109168
public readonly regionalHostedZoneId: string;
169+
private readonly domainNameConfigurations: CfnDomainName.DomainNameConfigurationProperty[] = [];
110170

111171
constructor(scope: Construct, id: string, props: DomainNameProps) {
112172
super(scope, id);
@@ -115,21 +175,25 @@ export class DomainName extends Resource implements IDomainName {
115175
throw new Error('empty string for domainName not allowed');
116176
}
117177

178+
// validation for ownership certificate
179+
if (props.ownershipCertificate && !props.mtls) {
180+
throw new Error('ownership certificate can only be used with mtls domains');
181+
}
182+
118183
const mtlsConfig = this.configureMTLS(props.mtls);
119184
const domainNameProps: CfnDomainNameProps = {
120185
domainName: props.domainName,
121-
domainNameConfigurations: [
122-
{
123-
certificateArn: props.certificate.certificateArn,
124-
endpointType: 'REGIONAL',
125-
},
126-
],
186+
domainNameConfigurations: Lazy.any({ produce: () => this.domainNameConfigurations }),
127187
mutualTlsAuthentication: mtlsConfig,
128188
};
129189
const resource = new CfnDomainName(this, 'Resource', domainNameProps);
130190
this.name = resource.ref;
131191
this.regionalDomainName = Token.asString(resource.getAtt('RegionalDomainName'));
132192
this.regionalHostedZoneId = Token.asString(resource.getAtt('RegionalHostedZoneId'));
193+
194+
if (props.certificate) {
195+
this.addEndpoint(props);
196+
}
133197
}
134198

135199
private configureMTLS(mtlsConfig?: MTLSConfig): CfnDomainName.MutualTlsAuthenticationProperty | undefined {
@@ -139,4 +203,30 @@ export class DomainName extends Resource implements IDomainName {
139203
truststoreVersion: mtlsConfig.version,
140204
};
141205
}
206+
207+
/**
208+
* Adds an endpoint to a domain name.
209+
* @param options domain name endpoint properties to be set
210+
*/
211+
public addEndpoint(options: EndpointOptions) : void {
212+
const domainNameConfig: CfnDomainName.DomainNameConfigurationProperty = {
213+
certificateArn: options.certificate.certificateArn,
214+
certificateName: options.certificateName,
215+
endpointType: options.endpointType ? options.endpointType?.toString() : 'REGIONAL',
216+
ownershipVerificationCertificateArn: options.ownershipCertificate?.certificateArn,
217+
securityPolicy: options.securityPolicy?.toString(),
218+
};
219+
220+
this.validateEndpointType(domainNameConfig.endpointType);
221+
this.domainNameConfigurations.push(domainNameConfig);
222+
}
223+
224+
// validates that the new domain name configuration has a unique endpoint
225+
private validateEndpointType(endpointType: string | undefined) : void {
226+
for (let config of this.domainNameConfigurations) {
227+
if (endpointType && endpointType == config.endpointType) {
228+
throw new Error(`an endpoint with type ${endpointType} already exists`);
229+
}
230+
}
231+
}
142232
}

0 commit comments

Comments
 (0)