Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Deploying a S3 Static Website using Pulumi on LocalStack

In this example, we will demonstrate how to deploy a simple S3 Static Website using Pulumi on LocalStack. With the help of the Pulumi Node.js SDK, we will declaratively provision AWS resources & infrastructure locally on LocalStack and on the real AWS cloud.

Prerequisites

Start LocalStack

export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
localstack auth set-token $LOCALSTACK_AUTH_TOKEN
localstack start -d
localstack wait -t 30

Initialize Pulumi Stack

pulumilocal stack init website-testing
pulumilocal config set aws:region us-east-1

Installing dependencies

Install the dependencies via:

yarn install

Deploying the stack

To preview and deploy the stack, run:

pulumilocal up

After the Pulumi stack has been deployed, you should be able to check the available S3 buckets via:

awslocal s3 ls

You can access the S3 website by using the bucket name in the following format: http://<BUCKET_NAME>.s3-website.localhost.localstack.cloud:4566. Since the endpoint is configured to use localhost.localstack.cloud, no real AWS resources have been created.

License

This code is available under the Apache 2.0 license.