https://pulumi.com logo
#general
Title
# general
f

flaky-receptionist-88878

09/14/2018, 8:06 PM
Why does let siteBucket = new aws.s3.Bucket(“s3-bob-pr000001”); result in a bucket name of s3-bob-pr000001-d16b3d1 ?
m

microscopic-florist-22719

09/14/2018, 8:09 PM
The Pulumi AWS provider adds a bit of randomness to the names of its resources by default in order to help ensure uniqueness. You can override this by manually specifying a name. In the case of
aws.s3.Bucket
, IIRC you would do this:
Copy code
new aws.s3.Bucket("my-bucket", { bucket: "my-bucket" })
c

creamy-potato-29402

09/14/2018, 8:10 PM
This is super useful when you want to replace a bucket in-place, for example.
s

stocky-spoon-28903

09/14/2018, 8:17 PM
In effect (if you know the Terraform provider) you can think of it as setting
name_prefix
rather than
name
for resources which support that
f

flaky-receptionist-88878

09/14/2018, 8:19 PM
thanks, yes I can see why in some cases having the unique name is handy, in this case I just wanted what I asked for. Thanks for the explantation and example that solves my issue.
Not sure if this is worth me creating a github issue, but why when doing this with bucket vs sqs is one called bucket and the other name?
let siteBucket = new aws.s3.Bucket(“s3-bob-pr000001”, { bucket: “s3-bob-pr000001" }) let sqs = new aws.sqs.Queue(“sqs-bob-pr000001”, { name: “sqs-bob-pr000001"})
Not trolling just curios
🙂
hmm maybe because that’s how terraform is doing it
s

stocky-spoon-28903

09/14/2018, 8:37 PM
That’s inherited from the Terraform provider, which inherits it from the API
f

flaky-receptionist-88878

09/14/2018, 8:37 PM
yeah got it