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

dry-journalist-60579

12/06/2023, 8:53 PM
Is there a way to make a new resource wait for a resource to be deleted before trying to create? I have a set of DNS records I was replacing where I need to delete a ComponentResource that contains DNS record resources. I wanted to do it all together but
update
fails because of a race condition where it tries to create the new DNS records before the old ones have been deleted…
b
d

dry-journalist-60579

12/06/2023, 8:57 PM
Hmm but I don’t want to recreate the
ComponentResource
that I’m trying to delete
I want to replace the
ComponentResource
(which contains a
route53.Record
) with a new
route53.Record
that conflicts
My new record is dependent on waiting for the old record to finish deleting
b

billions-xylophone-85957

12/06/2023, 8:58 PM
so you're not updating the same resource, you're creating a new one?
d

dry-journalist-60579

12/06/2023, 8:59 PM
Yeah, I have a website on S3 in my component resource with a CNAME pointing to that S3 bucket. I want to delete the s3 bucket, the CNAME, etc. and replace it all with a webflow website…
I ended up splitting the deployments into phases, but it just led to more downtime
First commit was to delete the old resource, run the update… wait… then add the new code and run the update
b

billions-xylophone-85957

12/06/2023, 9:00 PM
if you're adding a new resource, I think this is the only way
can you update the existing one instead of creating a new one?
d

dry-keyboard-94795

12/06/2023, 9:12 PM
For your specific case (moving the dns record), you could use Alias. This will tell pulumi you've moved the code, and it'll run an update as needed instead of a delete + create. A short guide on this: https://www.pulumi.com/blog/cumundi-guest-post/
d

dry-journalist-60579

12/06/2023, 9:36 PM
hmm so the
ComponentResource
is a custom resource I created to set up a Route53/S3/CloudFront http redirect on a TLD. It’s a set of 8 related AWS resources. The new thing I want to create is a single A record
I can’t update the existing resource because it’s buried within my
ComponentResource
2 Views