This message was deleted.
# typescript
s
This message was deleted.
w
I don’t have sample code for you, but I’m tempted to say you should be able to use “get” to lookup a bucket, and skip creating if the get is successful. https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucketobject/#look-up
b
Thanks. I ended up using aws.s3.getBucket to check for bucket existence in the end, similar to BucketObject. Cheers.
l
This isn't the normal pattern for achieving this in Pulumi. If you want to have a bucket managed by Pulumi, then the if-already-exists logic should be handled manually, once. The resource would be imported (via
pulumi import
or by adding the import ID to the resource opts) if it exists, and not imported if it doesn't. This avoids conditional code that should run only once.