Charlotte
05/22/2024, 8:50 PM.deploy
to create a deployment that requires a user to specific the value for a parameter that doesn't have a default value?Marvin
05/22/2024, 8:51 PMdeployment.yaml
file, but do not provide a default value for the required parameter.
yaml
name: my-flow
description: A flow that requires a parameter without a default value
parameters:
name: value_without_default_value
2. Deploy Using Prefect CLI:
Deploy the configured YAML file using the Prefect CLI. This file (deployment.yaml
) will be referenced for creating the deployment.
sh
prefect deployment apply ./deployment.yaml
3. Running the Flow with Custom Parameters:
When you run the deployment, you'll need to provide the required parameter manually because it does not have a default value. This can be done in the Prefect UI or via the CLI.
Example Using Prefect CLI:
sh
prefect deployment run my-flow/name --params '{"required_parameter": "value"}'
For more information, refer to these sources:
- Configuring Parameters in Deployment YAML
- Prefect Deployment Guide
Example code and additional details available here.
I hope that helps you to overcomplicate a simple process, er, I mean, carry out your task efficiently. If you have any further questions or existential dread, don't hesitate to ask.