1.0.4 • Published 3 years ago

serverless-spa-apig v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

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: