I was running through the getting started tutorial...
# general
I was running through the getting started tutorial and decided to change it a bit to add an image into the html:
Copy code
"use strict";
const fs = require("fs");
const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");
const htmlTemplate = `<!DOCTYPE html>
<html lang="en">
		<h1>Hi from Pulumi!</h1>
		<img src="{object}"></img>

// Create an AWS resource (S3 Bucket)
const bucket = new aws.s3.Bucket("my-bucket", {
    website: {
        indexDocument: "index.html"
const imgObject = new aws.s3.BucketObject("roo.jpg", {
    source: new pulumi.asset.FileAsset("roo.jpg"),
    acl: "public-read",
    contentType: "image/jpeg"

const imgUrl = pulumi.interpolate`http://${bucket.bucketEndpoint}/roo.jpg`
const html = htmlTemplate.replace("{object}", imgUrl)
fs.writeFileSync("index.html", html)

const indexObject = new aws.s3.BucketObject("index.html", {
    source: new pulumi.asset.FileAsset("index.html"),
    acl: "public-read",
    contentType: "text/html"
// Export the name of the bucket
exports.bucketName = bucket.id;
exports.bucketEndpoint = pulumi.interpolate`http://${bucket.websiteEndpoint}`;