Skip to content

Commit

Permalink
fix(cloudfront): Update Suported Security Protocol enum and set TLS_V…
Browse files Browse the repository at this point in the history
  • Loading branch information
robertd committed Aug 19, 2020
1 parent a038304 commit f6c25ad
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/README.md
Expand Up @@ -101,7 +101,7 @@ your domain name, and provide one (or more) domain names from the certificate fo

The certificate must be present in the AWS Certificate Manager (ACM) service in the US East (N. Virginia) region; the certificate
may either be created by ACM, or created elsewhere and imported into ACM. When a certificate is used, the distribution will support HTTPS connections
from SNI only and a minimum protocol version of TLSv1.2_2018.
from SNI only and a minimum protocol version of TLSv1.2_2019.

```ts
const myCertificate = new acm.DnsValidatedCertificate(this, 'mySiteCert', {
Expand Down
5 changes: 3 additions & 2 deletions packages/@aws-cdk/aws-cloudfront/lib/distribution.ts
Expand Up @@ -430,7 +430,7 @@ export class Distribution extends Resource implements IDistribution {
return {
acmCertificateArn: certificate.certificateArn,
sslSupportMethod: SSLMethod.SNI,
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2018,
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2019,
};
}
}
Expand Down Expand Up @@ -510,7 +510,8 @@ export enum SecurityPolicyProtocol {
TLS_V1 = 'TLSv1',
TLS_V1_2016 = 'TLSv1_2016',
TLS_V1_1_2016 = 'TLSv1.1_2016',
TLS_V1_2_2018 = 'TLSv1.2_2018'
TLS_V1_2_2018 = 'TLSv1.2_2018',
TLS_V1_2_2019 = 'TLSv1.2_2019'
}

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts
Expand Up @@ -247,7 +247,7 @@ export interface CustomOriginConfig {
/**
* The SSL versions to use when interacting with the origin.
*
* @default OriginSslPolicy.TLSv1_2
* @default OriginSslPolicy.TLS_V1_2
*/
readonly allowedOriginSSLVersions?: OriginSslPolicy[];

Expand Down Expand Up @@ -702,6 +702,7 @@ export class CloudFrontWebDistribution extends cdk.Resource implements IDistribu
[SSLMethod.SNI]: [
SecurityPolicyProtocol.TLS_V1, SecurityPolicyProtocol.TLS_V1_1_2016,
SecurityPolicyProtocol.TLS_V1_2016, SecurityPolicyProtocol.TLS_V1_2_2018,
SecurityPolicyProtocol.TLS_V1_2_2019,
],
[SSLMethod.VIP]: [SecurityPolicyProtocol.SSL_V3, SecurityPolicyProtocol.TLS_V1],
};
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloudfront/package.json
Expand Up @@ -138,6 +138,7 @@
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_2016",
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_1_2016",
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_2_2018",
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_2_2019",
"docs-public-apis:@aws-cdk/aws-cloudfront.ViewerCertificate.aliases",
"docs-public-apis:@aws-cdk/aws-cloudfront.ViewerCertificate.props",
"docs-public-apis:@aws-cdk/aws-cloudfront.ViewerCertificateOptions",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts
Expand Up @@ -98,7 +98,7 @@ test('exhaustive example of props renders correctly', () => {
ViewerCertificate: {
AcmCertificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012',
SslSupportMethod: 'sni-only',
MinimumProtocolVersion: 'TLSv1.2_2018',
MinimumProtocolVersion: 'TLSv1.2_2019',
},
},
});
Expand Down Expand Up @@ -299,7 +299,7 @@ describe('certificates', () => {
ViewerCertificate: {
AcmCertificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012',
SslSupportMethod: 'sni-only',
MinimumProtocolVersion: 'TLSv1.2_2018',
MinimumProtocolVersion: 'TLSv1.2_2019',
},
},
});
Expand Down

0 comments on commit f6c25ad

Please sign in to comment.