https://pulumi.com logo
b

breezy-butcher-78604

07/14/2021, 5:57 AM
was
deleteBeforeReplace
removed from resource options recently? I can't see it in the type declaration with
@pulumi/pulumi
v3.6.1
1
never mind... its part of
CustomResourceOptions
what exactly is a "custom resource" defined as? why can't this be an option for all resource types?
h

helpful-tent-95136

07/14/2021, 6:07 AM
CustomResource is a resource whose create, read, update, and delete (CRUD) operations are managed by performing external operations on some physical entity.
I.e. a job inside a kubernetes cluster is a custom resource
because it's a resource inside another resource that is managed via a provider rather than part of say AWS or GCP directly 🤔
b

breezy-butcher-78604

07/14/2021, 6:12 AM
👀 Anthony!!!!!
😁 1
so im trying to set
deleteBeforeReplace
on an ECS service via a transformation function (since the resource is part of a component resource). if i create a service myself (ie not part of a component) it supports the
deleteBeforeReplace
property. however when I'm doing a stack transformation, the options are typed as
ResourceOptions
which has no
deleteBeforeReplace
property which means i get a type error if I try to set it in a stack transform.
h

helpful-tent-95136

07/14/2021, 6:33 AM
can you do it on the resource managing the ecs service? dunno, you've bumped into a doozy 😕 the distinction between custom resources and component resources seems unintuitive to me so i'm not much help i'm afraid
b

breezy-butcher-78604

07/14/2021, 6:52 AM
if i change how the property is assigned it doesnt throw a type error. eg this is fine. i guess because
ResourceOptions
is a subset of
CustomResourceOptions
so this will work for now, but yeah i agree the typing and definition of custom resources vs "regular" resources seems strange
s

steep-sunset-89396

07/15/2021, 3:05 AM
@breezy-butcher-78604 Are you using the
awsx
package to create that resource?
b

breezy-butcher-78604

07/15/2021, 3:07 AM
the ECS service is from
aws
but its using a task definition created with
awsx
s

steep-sunset-89396

07/15/2021, 3:47 AM
ok, and that's the task def that you want to
deleteBeforeReplace
, am I understanding you correctly?
b

breezy-butcher-78604

07/15/2021, 3:50 AM
no i want the service to have
deleteBeforeReplace