1.0.12 • Published 2 years ago

serverless-spa-config v1.0.12

Weekly downloads
113
License
MIT
Repository
github
Last release
2 years ago

serverless-spa-config

Serverless plugin to configure S3, CloudFront and Route53 for a SPA or JAMStack site.

  • Creates S3 Website bucket
  • Creates CloudFront distribution (unless disabled:true)
  • Creates Route 53 RecordSet (unless disabled:true or hostedZoneId:undefined or endpoint:undefined)
  • Creates S3 Website redirect bucket (when redirect:true)
    • And creates corresponding CloudFront distribution and Route 53 RecordSet

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

serverless.yml

Optional settings are commented out and show default values

plugins:
  - serverless-spa-deploy
  - serverless-spa-config

custom:
  spa:
    files: # per serverless-spa-deploy
      ...
    # redirect: true
  dns:
    hostedZoneId: ZZZZZZZZZZZZZZ
    domainName: example.com
    endpoint: app.${self:custom.cdn.domainName}
  cdn:
    aliases:
      - ${self:custom.cdn.endpoint}
    acmCertificateArn: arn:aws:acm:us-east-1:account-id:certificate/certificate-id
    # priceClass: PriceClass_100
    # api:
    #   domainName: ${opt:stage}-api.${self:custom.dns.domainName}
    #   pathPattern: /api-*
    #   # originPath: /${opt:stage}
    # failover: 
    #   # criteria: [ 500, 502, 503, 504 ]
    #   us-west-2:
    #     bucketDomainName: ${self:service}-${opt:stage}-us-east-1.s3.us-east-1.amazonaws.com
    #     originAccessIdentityId: ${cf(us-east-1):${self:service}-${opt:stage}.WebsiteBucketOriginAccessIdentityId, 'UNDEFINED'}
    #   us-east-1:
    #     bucketDomainName: ${self:service}-${opt:stage}-us-west-2.s3.us-west-2.amazonaws.com
    #     originAccessIdentityId: ${cf(us-west-2):${self:service}-${opt:stage}.WebsiteBucketOriginAccessIdentityId, 'UNDEFINED'}
    # logging:
    #   bucketName: ${self:custom.cdn.logging.bucketName}.s3.amazonaws.com
    #   prefix: aws-cloudfront
    # webACLId: arn:aws:waf::account-id:resource-type/resource-id
    # disabled: true
    # enabled: stage1,stage2
1.0.11

2 years ago

1.0.10

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago