Does the automation API allow me to control what r...
# automation-api
h
Does the automation API allow me to control what resources get updated/deleted? Is there any sort of lifecycle hook where I can affect the state of the stack or similar before pulumi performs an update?
Context is trying to work around this Lambda@Edge situation where AWS will not delete the lambda function (in fact, it happens automatically) and pulumi throws an error when trying to update.
l
I suppose you could use automation API to remove the resource from the state file using stack.export/stack.import, but that's a bit messy.
Alternatively, why not just create the resource via the AWS SDK? It sounds like you don't really want to manage it with a desired state model.
h
Well I do want it as part of my deployment and I really like the function serialization that pulumi provides
But that is a possible workaround, thank you
g
we are doing similar thing with
aws:iam:ServiceLinkedRole
, where, before running the
pulumi up
, we just check if the role is there (using the AWS SDK)
h
Its really amazon's fault
g
once the check is done,
pulumi up
proceeds doing its thing
not sure if this is related to your scenario, but still mentioned it just in case 🙂
h
thank you 🙂
🚀 1
l
It would be worth opening an issue in the AWS provider. There may be something we can do at a lower level to support this.
h
I found this, which suggests using
pulumi state delete
to remove the fucntion from the state ... https://github.com/pulumi/pulumi-aws/issues/1045