Skip to content

Proposal: Static WebsitesΒ #624

@brettstack

Description

@brettstack

SAM should provide a way to easily create static websites hosted on S3 and CloudFront. The purpose of this Issue is to gather requirements from the community to ensure we address primary use-cases.

Requirements:

  1. Create an S3 Bucket configured with WebsiteConfiguration
    1. Option for enabling S3 redirect configuration for clean SPA routes
    2. Allow specifying CodeUri which points to the assets directory to upload to S3.
      1. Currently, Lambda Functions get uploaded to an existing S3 Bucket prior to SAM transformation, whereas the S3 bucket for websites will be created within the stack. One option is to upload to an existing S3 Bucket (the same one used for Lambda and APIs) and have a CloudFormation Custom Resource for copying to the Website S3 bucket.
      2. The same Custom Resource could be used for deployments (invalidate CloudFront cache)
      3. CodeUri should be optional to allow users to handle UI deployments external to SAM.
      4. We may decide to punt the CodeUri/Deployment story as a follow-up so that we can deliver the infrastructure story first.
  2. Create a CloudFront distribution to provide caching, edge nodes, custom domain support, etc.
    1. CloudFront distribution should provide opinionated defaults, but all properties should be configurable by end user
  3. Allow for specifying a custom domain name
    1. Route53 configuration
    2. ACM Certificate (optionally pass in your own)
    3. Support for redirecting non-www to www

Please describe your use case and let us know how SAM could make it easier for you to create websites.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions