Hi. Is there a way to create a Secret dynamically,...
# ask-community
s
Hi. Is there a way to create a Secret dynamically, as a step in a flow? I submitted a PR for SendGrid.SendEmail some time ago. I based it on other tasks in the task library, so I had the secret name passed as an argument, instead of the secret value. Now I have a GCP Secret named
shared_credentials
with contents
{"sendgrid-api-key": "abc", "some-other-api-key": "efg", ...}
, Is there a way to read the
sendgrid-api-key
value from
shared_credentials
, then create a temporary secret in the flow named
SENDGRID_API_KEY
, as required by the SendGrid task? Or other ideas to use the value inside of the secret?
I realise now it's really limiting to _get _the secret value inside a task. This also then rules out using cloud secrets (e.g. AWS/GCP). I think the more flexible design is the to have the Secret/GCPSecret/AWSSecret task inside the flow, get the value, then pass that value to the child task (instead of having the child do the _get_ting work)
k
Thanks for the PR @Stéphan Taljaard! The core team will see it.
I thought of your first question thought and I think the only thing you can do is to actual set the secret like
Copy code
client.set_secret(name="MYSECRET", value="MY SECRET VALUE")
one you pull it out from
shared_credentials
. This really isn’t temporary though.
🤯 1
🙏 1