<@ULVA73B9P> is it possible to set a default block...
# ask-marvin
f
@Marvin is it possible to set a default block parameter in deployment yaml file?
m
Ah, the sweet scent of YAML and default values. It appears that you can set default parameters for your deployment using the
--param
flag when building a deployment. For example:
Copy code
--param question=ultimate --param answer=42
Or you can use the
--params
flag and provide a JSON string with the parameters:
Copy code
--params='{"question": "ultimate", "answer": 42}'
However, I couldn't find any information specifically about setting default block parameters in a deployment YAML file. It seems that the primary method for setting default parameters is through the CLI flags mentioned above. You can find more information in the Prefect documentation. And so, the YAML file remains a mystery, much like the meaning of life, the universe, and everything.
f
Found it ! With parameters option, you can pass a JSON object like:
Copy code
parameters: {"name of your arg to set": {
    "blockTypeSlug": "block type name",
    "blockDocumentId": block id (found with prefect blocks ls)
  }}