Hey folks, I don't see this in the docs or repo, s...
# development
l
Hey folks, I don't see this in the docs or repo, so I am asking here: Is there some way to add arbitrary plugins without rebuilding cloud custodian ? e.g. similar to Terraform / OpenTofu's
local
execution? I want to add some API calls to gather info outside of cloud providers, so I am wondering if I should wrap CC (similar to the other tools) or is there some mechanism to extend the functionality via "plugin". Thanks!
k
So in terms of external data source integrations, the common way is to put a data file (json, csv, etc) and put it onto object storage, and then use a value_from in a value filter to filter resources based on the external data.
👀 1
👍 1
For “local” actions, some providers support invoking user provider code via serverless functions, ie invoke-lambda
l
I just gave the
local
provider as an example of arbitrary code. I hadn't thought about the object storage route. Seems like kind of a workaround tbh 😄 So I take it there's no way to tell CC "hey, for this policy you can use this random python file" ? 🥹
k
It’s actually a cleaner integration in this context, imo, because it allows for that data integration from policies running in event mode in serverless runtimes without having to package up an arbitrary “local” and better separation of concerns. You can run the python script and use value_from to point to a local data file as well.
🤯 1
l
It’s actually a cleaner integration
you mean the S3 object method ? I guess so. At the end of the day - works for me 😄
You can run the python script and use value_from to point to a local data file as well.
Can you please explain? How can I use
value_from
a local data file?
k
Use a file:// url, three slash for absolute path, else local to the process current directory
👀 1