https://prefect.io logo
Title
d

Deceivious

08/19/2022, 10:18 AM
Hi all, I am using prefect 2.1.1 trying to build a deployment through the provided python object [
from prefect.deployments import Deployment
]. I am not sure about how to get
infrastructure block
and
storage block
(created through the UI) added to the Deployment. Is this feature not included in the object?
1
a

Anna Geller

08/19/2022, 11:11 AM
you can totally do that - if not please share your error, but I agree using CLI for this is easier
d

Deceivious

08/19/2022, 11:59 AM
@Anna Geller what would be the parameter argument for them? Passing string into infra and storage gives type validation issues.
a

Anna Geller

08/19/2022, 12:20 PM
-ib infra_block_type/infra_block_name
d

Deceivious

08/19/2022, 12:22 PM
@Anna Geller I meant through the python Deployment object
a

Anna Geller

08/19/2022, 12:23 PM
e.g. DockerContainer.load("name")
again, I prefer CLI so no expert on the Python UX
d

Deceivious

08/19/2022, 12:23 PM
thanks what about storage container?
a

Anna Geller

08/19/2022, 12:23 PM
same S3.load("name")
d

Deceivious

08/19/2022, 12:24 PM
Thank you. Ill test it out.
🙌 1
While having CLI commands in a script to perform deployments is okay [Ive manged to get the CLI commands working and tested], Because we are already writing the flows in python would be great to have deployment scripts in python as well. But CLI is good 🙂
a

Anna Geller

08/19/2022, 12:34 PM
Good is an understatement, this CLI is amazing :)
🙌 2
🍷 2