serverless-spa-apig
Advanced tools
Comparing version
16
index.js
@@ -45,2 +45,3 @@ const path = require('path'); | ||
this.prepareApiGateway(resources); | ||
this.prepareVpcEndpoint(resources); | ||
} | ||
@@ -116,4 +117,19 @@ | ||
} | ||
prepareVpcEndpoint(resources) { | ||
const vpcEndpointId = this.serverless.service.custom.apig.vpcEndpointId; | ||
const policy = this.serverless.service.custom.apig.policy; | ||
if (vpcEndpointId) { | ||
resources.Resources.SpaServer.Properties.EndpointConfiguration.Types[0] = 'PRIVATE'; | ||
if (policy) { | ||
resources.Resources.SpaServer.Properties.Policy = policy; | ||
} | ||
} else { | ||
delete resources.Resources.SpaServer.Properties.EndpointConfiguration.VpcEndpointIds; | ||
delete resources.Resources.SpaServer.Properties.Policy; | ||
} | ||
} | ||
} | ||
module.exports = Plugin; |
{ | ||
"name": "serverless-spa-apig", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Serverless plugin to configure S3, API Gateway and Route53 for a SPA or JAMStack site.", | ||
@@ -5,0 +5,0 @@ "author": "John Gilbert <john.gilbert@danteinc.com> (danteinc.com)", |
@@ -35,2 +35,4 @@ # serverless-spa-apig | ||
# webACLId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | ||
# vpcEndpointId: xxxxxx | ||
# policy: | ||
``` |
Sorry, the diff of this file is not supported yet
15319
12.66%109
14.74%38
5.56%