https://pulumi.com logo
Title
b

bumpy-room-43904

07/09/2021, 3:33 AM
Just started with pulumi (v3.6.1) on the 'hello world / s3 bucket project'... Getting an error while making the bucket public https://www.pulumi.com/docs/get-started/aws/deploy-changes/: I think i've got the code right:
"""An AWS Python Pulumi program"""
import pulumi
from pulumi_aws import s3

# Create an AWS resource (S3 Bucket)
bucket = s3.Bucket('my-bucket')

# Export the name of the bucket
pulumi.export('bucket_name', bucket.id)
bucketObject = s3.BucketObject(
    'index.html',
    acl='public-read',
    content_type='text/html',
    bucket=bucket,
    source=pulumi.FileAsset('index.html'),
)
pulumi.export('bucket_endpoint', pulumi.Output.concat('http://', bucket.website_endpoint))
It must be me...pulumi seems great thus far despite my error. Any hints for this?
h

helpful-tent-95136

07/09/2021, 3:35 AM
Just checking, but does the
index.html
file you're uploading exist in the directory you're running pulumi up from?
b

bumpy-room-43904

07/09/2021, 3:36 AM
howdy @helpful-tent-95136 ... yes I do see it there
h

helpful-tent-95136

07/09/2021, 3:37 AM
ahh you haven't configured the bucket as a website, so the
website_endpoint
is none instead of string
bucket = s3.Bucket('my-bucket',
    website=s3.BucketWebsiteArgs(
        index_document="index.html",
    ))
b

bumpy-room-43904

07/09/2021, 3:38 AM
ah!
thanks for that @helpful-tent-95136 serves me right for doing this late...my eyes did not catch that and I glossed right over it... Thanks!