Can you give a use-case example of Blocks vs Varia...
# ppcc-may-16-2023
s
Can you give a use-case example of Blocks vs Variables?
1
c
They are very similar in general; an example that I have used, are static API urls for a 3rd party api. There are routine messages sent in a flow to this 3rd party api (jira) , but I have different api URLS between tiers (dev / stage / prod) . I use the same code in the flow to reference the same named variable, but different values across workspaces
e.g., dev might be:
https:/dev.jira.com
then
<https://stage.jira.com>
where the flow code references just a single name variable
then if it changes, I can just change it in a single location
s
Blocks are preferred over Variables for storing sensitive information, right?
c
yes, specifically SecretStr which are intentionally obfuscated
🙌 2
An alternate mechanism is using a JSON block to store a reference / location to a secret in your existing secrets manager like AWS / Azure Keyvault
its beautiful 1
you can defer the secrets that way, but that requires a little more hand-written code to access
using like identity