This component makes it easy to deploy a static website to s3 along with an optional CloudFront distribution using any of the supported Pulumi programming languages including markup languages like YAML and JSON.
TypeScript:
const site = new staticwebsite.Website("website", {sitePath: "../website/build"});
export const url = site.websiteURL;
YAML:
resources:
web:
type: "aws-static-website:index:Website"
properties:
sitePath: "../website/build"
outputs:
websiteURL: ${web.websiteURL}
TypeScript:
const site = new staticwebsite.Website("website", {
withCDN: true,
sitePath: "../website/build",
targetDomain: "my-awesome-site.com",
withLogs: true,
cacheTTL: 600,
});
export const url = site.websiteURL;
YAML:
resources:
web:
type: "aws-static-website:index:Website"
properties:
withCDN: true
sitePath: "../website/build"
targetDomain: "my-awesome-site.com"
withLogs: true
cacheTTL: 600
outputs:
websiteURL: ${web.websiteURL}
See the examples directory for fully working examples of how to consume this component.
If you are new to Pulumi and do not yet have our Pulumi installed, see our getting started guide to get up and running.
Install the SDK package corresponding to the language or runtime you are using. If using YAML or one of our other markup languages, this step can be skipped.
npm install @pulumi/aws-static-website
pip3 install pulumi_aws_static_website
go get -t github.com/pulumi/pulumi-aws-static-website/sdk/go/aws-static-website
This package can then be consumed just like any other package by importing it into your project (e.g. import * as website from '@pulumi/aws-static-website'
)
This component takes the following inputs.
all
, 100
, and 200
"