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

important-leather-28796

07/08/2019, 3:09 PM
I’m trying to interact with pulumi-cloudflare, though it is not clear to me how the pulumi lib maps to the api. Specifically I’m looking to purge cache by url after a pulumi deployment (https://api.cloudflare.com/#zone-purge-files-by-url). Neither the reference docs nor github have given me a clue here how to essentially
POST zones/:identifier/purge_cache
. What am I missing? Any pointers to samples or docs?
Now how does this translate to pulumi?
w

white-balloon-205

07/08/2019, 3:28 PM
That code you linked is not in the Terraform provider, it’s in the vendored cloudflare SDK. Given that this is a very “imperative” action, it’s possible it is not directly supported in the Terraform/Pulumi resource model. That said, you should be able to use the CloudFlare JS sdk directly to do this inside an apply callback to script the imperative action into your Pulumi deployment.
👍 1
h

high-translator-22614

07/08/2019, 3:51 PM
tbh, i'm a little surprised pulumi doesn't do this?
i

important-leather-28796

07/08/2019, 3:51 PM
it is imperative vs declarative, so makes sense.
w

white-balloon-205

07/08/2019, 4:32 PM
tbh, i'm a little surprised pulumi doesn't do this?
Doesn't do what exactly?
h

high-translator-22614

07/08/2019, 6:06 PM
like, if pulumi detects a change, it should ask the CDN to flush?
2 Views