Why does let siteBucket = new aws.s3.Bucket(“s3-bo...
# general
Why does let siteBucket = new aws.s3.Bucket(“s3-bob-pr000001”); result in a bucket name of s3-bob-pr000001-d16b3d1 ?
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
, IIRC you would do this:
Copy code
new aws.s3.Bucket("my-bucket", { bucket: "my-bucket" })
This is super useful when you want to replace a bucket in-place, for example.
In effect (if you know the Terraform provider) you can think of it as setting
rather than
for resources which support that
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
That’s inherited from the Terraform provider, which inherits it from the API
yeah got it