https://prefect.io logo
Title
s

Stephen Lloyd

01/24/2023, 8:42 AM
Separate question, I’m trying to write a python file for the deployment. When I use Deployment.build_from_flow, the flow actually executes. I’d rather not do that. How can I avoid it?
from atlan import atlan_flow
from prefect.deployments import Deployment
from prefect.filesystems import S3
from prefect_aws.ecs import ECSTask, AwsCredentials

aws_credentials_block = AwsCredentials.load("dev-aws-credentials")

ecs_task_block = ECSTask.load("ecs-task-poc-dev")
s3_block = S3.load("poc-s3-storage")

deployment = Deployment.build_from_flow( 
    flow=atlan_flow,
    name='atlan poc deployment',
    infrastructure=ecs_task_block,
    description='a flow deployment',
    tags=['poc'],
    work_queue_name='poc-queue',
    output=True,
    apply=True,
    # storage=s3_block

)
s

Stephen Lloyd

01/27/2023, 11:08 AM
@Anna Geller Thanks for this response. The direction I’m hoping to go is avoiding work on the CLI. I’m trying to substantially reduce what is required to write a flow. My hope is to write a class around the deployment with a couple of overridable settings.
a

Anna Geller

01/27/2023, 1:33 PM
you always need to touch CLI to create a deployment, even if it's just to run a python script, right?
up to you, both are valid ways