https://pulumi.com logo
b

big-potato-91793

08/23/2019, 2:28 PM
Hey, quckie question, i’m trying to create a s3 bucket with a specific name. any reason why pulumi add a has at the end of the bucket?
b

best-xylophone-83824

08/23/2019, 2:36 PM
add
{name : "name-i-want"}
{arn: "arn:aws:s3:::name-i-want"}
as a second argument
b

big-potato-91793

08/23/2019, 2:40 PM
i add the
bucket
params in the
BucketArgs
lol this add pulumi at the end lol
g

gentle-diamond-70147

08/23/2019, 3:00 PM
This is due to the auto-naming functionality in Pulumi - https://www.pulumi.com/docs/reference/programming-model/#autonaming. Setting
bucket
will override this functionality and use the exact value you specify.
b

big-potato-91793

08/23/2019, 3:03 PM
so what should be the way to do it?
g

gentle-diamond-70147

08/23/2019, 3:05 PM
The auto-naming functionality is helpful for resources that require unique names and you will be replacing at times during deployments. If you don't want this, you can specify a static name like this:
Copy code
const bucket = new aws.s3.Bucket("my-bucket", {
    bucket: "my-bucket",
});
b

best-xylophone-83824

08/23/2019, 3:11 PM
@gentle-diamond-70147, do you think it is worth auto-enabling "deleteBeforeUpdate" for resources with overridden id?
g

gentle-diamond-70147

08/23/2019, 3:17 PM
Do you mean
deleteBeforeReplace
? I believe we're doing exactly that with https://github.com/pulumi/pulumi-terraform/issues/383.
b

best-xylophone-83824

08/23/2019, 3:29 PM
nice! it was just merged 🙂 I can remove reduntant options from our code now
b

big-potato-91793

08/23/2019, 3:32 PM
and do you know if it’s possible to get the aws region?