serverless-spa-apig

1.0.4 • Public • Published

serverless-spa-apig

Serverless plugin to configure S3, API Gateway and Route53 for a SPA.

This approach is useful when CloudFront is not permitted. It sets up API Gateway as a proxy to S3.

  • Creates S3 bucket
  • Creates API Gateway (unless apig:false)
  • Creates Custom DomainName and BasePathMapping (when domainName is provided)
  • Creates Route 53 RecordSet (when hostedZoneId is provided)

This plugin is designed to work in conjunction with the serverless-spa-deploy plugin.

serverless.yml

Optional settings are commented out

plugins:
  - serverless-spa-deploy
  - serverless-spa-apig

custom:
  # partition: aws-us-gov
  spa:
    websiteBucketNameOutputRef: SpaBucketName
    acl: private
    files: # per serverless-spa-deploy
      ...
  apig: # false
    hostedZoneId: ZZZZZZZZZZZZZZZZZZZZ
    domainName: example.com
    acmCertificateArn: arn:aws:acm:us-east-1:0123456789:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    # webACLId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    # vpcEndpointId: xxxxxx
    # policy:

Package Sidebar

Install

npm i serverless-spa-apig

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

15.3 kB

Total Files

5

Last publish

Collaborators

  • jgilbert01