Host a Static Website on Amazon S3
A static website hosted on AWS S3
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set aws-go-s3-foldercd pulumi-examples/aws-go-s3-folderA static website that uses S3’s website support. For a detailed walkthrough of this example, see the tutorial Static Website on AWS S3.
Deploying and running the program#
-
Create a new stack:
Terminal window pulumi stack init website-testing -
Set the AWS region:
$ pulumi config set aws:region us-west-2 -
Run
pulumi upto preview and deploy changes.Terminal window pulumi upPreviewing stack 'website-testing'Previewing changes:...Performing changes:#: Resource Type Name Status Extra Inf1: pulumi:pulumi:Stack website-testing + created2: aws:s3:Bucket s3-website-bucket + created3: aws:s3:BucketPolicy bucketPolicy + created4: aws:s3:BucketObject favicon.png + created5: aws:s3:BucketObject index.html + createdinfo: 5 changes performed:+ 5 resources createdUpdate duration: 8.827698762s -
To see the resources that were created, run
pulumi stack:Terminal window pulumi stackCurrent stack is go-website-testing:Managed by https://api.pulumi.comOwner: swgillespieLast updated: 13 minutes ago (2018-06-15 14:19:06.856631155 -0700 PDT)Pulumi version: v0.14.0-rc1Plugin go [language] version: 0.14.0-rc1Plugin aws [resource] version: 0.14.0-rc1Current stack resources (5):TYPE NAMEpulumi:pulumi:Stack website-testingaws:s3/bucket:Bucket s3-website-bucketaws:s3/bucketPolicy:BucketPolicy bucketPolicyaws:s3/bucketObject:BucketObject www/index.htmlaws:s3/bucketObject:BucketObject www/favicon.png -
To clean up resources, run
pulumi destroyand answer the confirmation question at the prompt.