@serverless/domain
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "@serverless/domain", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"main": "./serverless.js", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -149,3 +149,3 @@ const { Component } = require('@serverless/core') | ||
) | ||
await addDomainToCloudfrontDistribution(clients.cf, subdomain) | ||
await addDomainToCloudfrontDistribution(clients.cf, subdomain, certificate.CertificateArn) | ||
@@ -152,0 +152,0 @@ this.context.debug(`Configuring DNS for distribution "${subdomain.url}".`) |
14
utils.js
@@ -794,3 +794,3 @@ const aws = require('aws-sdk') | ||
const addDomainToCloudfrontDistribution = async (cf, subdomain, distributionUrl) => { | ||
const addDomainToCloudfrontDistribution = async (cf, subdomain, certificateArn) => { | ||
// Update logic is a bit weird... | ||
@@ -800,3 +800,3 @@ // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFront.html#updateDistribution-property | ||
// 1. we gotta get the config first... | ||
const params = await cf.getDistributionConfig({ Id: subdomain.id }).promise() | ||
const params = await cf.getDistributionConfig({ Id: subdomain.distributionId }).promise() | ||
@@ -810,3 +810,3 @@ // 2. then add this property | ||
// 4. then set this property | ||
params.Id = subdomain.id | ||
params.Id = subdomain.distributionId | ||
@@ -819,2 +819,10 @@ // 5. then make our changes | ||
params.DistributionConfig.ViewerCertificate = { | ||
ACMCertificateArn: certificateArn, | ||
SSLSupportMethod: 'sni-only', | ||
MinimumProtocolVersion: 'TLSv1.1_2016', | ||
Certificate: certificateArn, | ||
CertificateSource: 'acm' | ||
} | ||
// 6. then finally update! | ||
@@ -821,0 +829,0 @@ const res = await cf.updateDistribution(params).promise() |
48837
1051