arc-macro-custom-domain
Advanced tools
Comparing version 1.0.1 to 2.0.0
21
index.js
module.exports = function(arc, cloudformation, stage) { | ||
//only on stage | ||
if (stage !== 'staging' || !arc.customDomain) { | ||
if (!arc.customDomain) { | ||
return cloudformation; | ||
} | ||
const domainName = process.env.ARC_DOMAIN || arc.customDomain[0]; | ||
const route53Host = arc.customDomain[1]; | ||
const certArn = arc.customDomain[2]; | ||
const params = {}; | ||
arc.customDomain.forEach(e => { | ||
params[e[0]] = e[1]; | ||
}); | ||
const domainName = process.env.ARC_DOMAIN || ( | ||
stage === 'staging' ? params.stagingDomain : params.productionDomain); | ||
// abort if no domainName was specified: | ||
if (!domainName) { | ||
console.log('WARNING: no domain name was specified for arc-macro-custom-domain!! (did you forget to set something?)'); | ||
return cloudformation; | ||
} | ||
const route53Host = params.zoneName; | ||
const certArn = stage === 'staging' ? params.stagingCertArn : params.productionCertArn; | ||
const restId = Object.keys(cloudformation.Resources)[0]; //probably could make this better | ||
cloudformation.Resources.ApiGatewayDomain = { | ||
@@ -13,0 +20,0 @@ Type: 'AWS::ApiGateway::DomainName', |
{ | ||
"name": "arc-macro-custom-domain", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "- only works on staging (for now) - can override domain with `ARC_DOMAIN`", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# arc-macro-custom-domain | ||
- only works on staging (for now) | ||
- can override domain with `ARC_DOMAIN` | ||
@@ -18,5 +17,7 @@ | ||
@customDomain | ||
{domain} | ||
{route53 host} | ||
{certArn} | ||
zoneName {route53 host} | ||
productionCertArn {production arn} | ||
productionDomain {production domain} | ||
stagingCertArn {staging arn} | ||
stagingDomain {staging domain} | ||
``` |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2821
6
63
23
1