Skip to main content

prefect.infrastructure.provisioners.ecs

Functions

console_context

Classes

IamPolicyResource

Represents an IAM policy resource for managing ECS tasks. Args:
  • policy_name: The name of the IAM policy. Defaults to “prefect-ecs-policy”.
Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions an IAM policy. Args:
  • advance: A callback function to indicate progress.
Returns:
  • The ARN (Amazon Resource Name) of the created IAM policy.

requires_provisioning

Check if this resource requires provisioning. Returns:
  • True if provisioning is required, False otherwise.

IamUserResource

Represents an IAM user resource for managing ECS tasks. Args:
  • user_name: The desired name of the IAM user.
Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions an IAM user. Args:
  • advance: A callback function to indicate progress.

requires_provisioning

Check if this resource requires provisioning. Returns:
  • True if provisioning is required, False otherwise.

CredentialsBlockResource

Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions an AWS credentials block. Will generate new credentials if the block does not already exist. Updates the aws_credentials variable in the job template to reference the block. Args:
  • base_job_template: The base job template.
  • advance: A callback function to indicate progress.
  • client: A Prefect client to use for interacting with the Prefect API.

requires_provisioning

AuthenticationResource

Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions the authentication resources. Args:
  • base_job_template: The base job template of the work pool to provision infrastructure for.
  • advance: A callback function to indicate progress.

requires_provisioning

Check if this resource requires provisioning. Returns:
  • True if provisioning is required, False otherwise.

resources

ClusterResource

Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions an ECS cluster. Will update the cluster variable in the job template to reference the cluster. Args:
  • base_job_template: The base job template of the work pool to provision infrastructure for.
  • advance: A callback function to indicate progress.

requires_provisioning

Check if this resource requires provisioning. Returns:
  • True if provisioning is required, False otherwise.

VpcResource

Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions a VPC. Chooses a CIDR block to avoid conflicting with any existing VPCs. Will update the vpc_id variable in the job template to reference the VPC. Args:
  • base_job_template: The base job template of the work pool to provision infrastructure for.
  • advance: A callback function to indicate progress.

requires_provisioning

Check if this resource requires provisioning. Returns:
  • True if provisioning is required, False otherwise.

ContainerRepositoryResource

Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions an ECR repository. Args:
  • base_job_template: The base job template of the work pool to provision infrastructure for.
  • advance: A callback function to indicate progress.

requires_provisioning

Check if this resource requires provisioning. Returns:
  • True if provisioning is required, False otherwise.

ExecutionRoleResource

Methods:

get_planned_actions

Returns a description of the planned actions for provisioning this resource. Returns:
  • Optional[str]: A description of the planned actions for provisioning the resource, or None if provisioning is not required.

get_task_count

Returns the number of tasks that will be executed to provision this resource. Returns:
  • The number of tasks to be provisioned.

next_steps

provision

Provisions an IAM role. Args:
  • base_job_template: The base job template of the work pool to provision infrastructure for.
  • advance: A callback function to indicate progress.

requires_provisioning

Check if this resource requires provisioning. Returns:
  • True if provisioning is required, False otherwise.

ElasticContainerServicePushProvisioner

An infrastructure provisioner for ECS push work pools. Methods:

console

console

is_boto3_installed

Check if boto3 is installed.

provision

Provisions the infrastructure for an ECS push work pool. Args:
  • work_pool_name: The name of the work pool to provision infrastructure for.
  • base_job_template: The base job template of the work pool to provision infrastructure for.
Returns:
  • An updated copy base job template.