Socket
Socket
Sign inDemoInstall

arc-macro-custom-domain

Package Overview
Dependencies
0
Maintainers
6
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc