# ECS Agent
# ECSAgent
class
prefect.agent.ecs.agent.ECSAgent
(agent_config_id=None, name=None, labels=None, env_vars=None, max_polls=None, agent_address=None, no_cloud_logs=None, task_definition_path=None, run_task_kwargs_path=None, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None, region_name=None, cluster=None, launch_type=None, task_role_arn=None, execution_role_arn=None, botocore_config=None)[source]Agent which deploys flow runs as ECS tasks.
Args:
agent_config_id (str, optional)
: An optional agent configuration ID that can be used to set configuration based on an agent from a backend API. If set all configuration values will be pulled from the backend agent configuration.name (str, optional)
: An optional name to give this agent. Can also be set through the environment variablePREFECT__CLOUD__AGENT__NAME
. Defaults to "agent".labels (List[str], optional)
: A list of labels, which are arbitrary string identifiers used by Prefect Agents when polling for work.env_vars (dict, optional)
: A dictionary of environment variables and values that will be set on each flow run that this agent submits for execution.max_polls (int, optional)
: Maximum number of times the agent will poll Prefect Cloud for flow runs; defaults to infinite.agent_address (str, optional)
: Address to serve internal api at. Currently this is just health checks for use by an orchestration layer. Leave blank for no api server (default).no_cloud_logs (bool, optional)
: Disable logging to a Prefect backend for this agent and all deployed flow runs. Defaults toFalse
.task_definition_path (str, optional)
: Path to a task definition template to use when defining new tasks. If not provided, the default template will be used.run_task_kwargs_path (str, optional)
: Path to ayaml
file containing default kwargs to pass toECS.client.run_task
. May be a local path, or a remote path on e.g.s3
.aws_access_key_id (str, optional)
: AWS access key id for connecting the boto3 client. If not provided, will be loaded from your environment (via either theAWS_ACCESS_KEY_ID
environment variable, or the~/.aws/config
file). See the boto3 credentials docs for more information.aws_secret_access_key (str, optional)
: AWS secret access key for connecting the boto3 client. If not provided, will be loaded from your environment (via either theAWS_SECRET_ACCESS_KEY
environment variable, or the~/.aws/config
file). See the boto3 credentials docs for more information.aws_session_token (str, optional)
: AWS session key for connecting the boto3 client. If not provided, will be loaded from your environment (via either theAWS_SESSION_TOKEN
environment variable, or the~/.aws/config
file). See the boto3 credentials docs for more information.region_name (str, optional)
: AWS region name to launch ECS tasks in. If not provided, will be loaded from your environment (via either theAWS_DEFAULT_REGION
environment variable, or the~/.aws/config
file). See the boto3 configuration docs for more information.cluster (str, optional)
: The AWS cluster to use, defaults to"default"
if not provided.launch_type (str, optional)
: The launch type to use, either"FARGATE"
(default) or"EC2"
.task_role_arn (str, optional)
: The default task role ARN to use when registering ECS tasks created by this agent.execution_role_arn (str, optional)
: The default execution role ARN to use when registering ECS tasks created by this agent.botocore_config (dict, optional)
: Additional botocore configuration options to be passed to the boto3 client. See the boto3 configuration docs for more information.
methods: |
---|
prefect.agent.agent.Agent.start ()[source] |
The main entrypoint to the agent process. Sets up the agent then continuously polls for work to submit. |
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC