https://pulumi.com logo
Title
r

refined-terabyte-65361

08/12/2021, 8:04 PM
Hello i am trying to creatre s3 bucket using pulumi typescript
const accessLogsBucket = new aws.s3.Bucket(`${project}-access-logs`);
const BucketPublicAccessBlock = new aws.s3.BucketPublicAccessBlock("BucketPublicAccessBlock", {
  bucket: accessLogsBucket.id,
  blockPublicAcls: true,
  blockPublicPolicy: true,
});
bucket gets created but its gets id attached to it like this dev-access-logs-cf9291d how to stop getting that id for bucket name
s

steep-toddler-94095

08/12/2021, 8:06 PM
aws.s3.Bucket(`${project}-access-logs`,{bucket:`${project}-access-logs`});
otherwise it will use the pulumi resource name and append a random string at the end
1
this goes for all resources that can be given a name
b

billowy-army-68599

08/12/2021, 8:28 PM
https://www.pulumi.com/docs/intro/concepts/resources/#autonaming we strongly recommend not disabling autonaming
(although in the case of s3 buckets it might be necessary)\
r

refined-terabyte-65361

08/12/2021, 9:02 PM
i am facing new issue so when i am random string fro bucket name when i try to destroy the resource is not deleted only when there is random string resource is being deleted
b

billowy-army-68599

08/12/2021, 9:54 PM
can you show me the output from your destroy?
r

refined-terabyte-65361

08/12/2021, 10:13 PM
destroy out put is not showing s3 resource in it
b

billowy-army-68599

08/12/2021, 10:25 PM
Can you describe the process you’re going through? You’ll need to run a pulumi up after your change your code
r

refined-terabyte-65361

08/12/2021, 10:32 PM
I think the issue is bucket is not empty thats why its not destroyed when i deleted dirrectory in bucket its working normal