Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

airflow.providers.amazon.aws.operators.ecr

Classes

EcrCreateRepositoryOperator

Create an Amazon ECR repository.

EcrSetRepositoryPolicyOperator

Set the repository policy for an Amazon ECR repository.

EcrDeleteRepositoryOperator

Delete an Amazon ECR repository.

Module Contents

class airflow.providers.amazon.aws.operators.ecr.EcrCreateRepositoryOperator(*, repository_name, registry_id=None, tags=None, image_tag_mutability=None, image_tag_mutability_exclusion_filters=None, image_scanning_configuration=None, encryption_configuration=None, aws_conn_id='aws_default', **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.ecr.EcrHook]

Create an Amazon ECR repository.

See also

For more information on how to use this operator, take a look at the guide: Create an ECR repository

Parameters:
  • repository_name (str) – The name of the repository to create. (templated)

  • registry_id (str | None) – The AWS account ID associated with the registry. (templated)

  • tags (list[dict[str, str]] | None) – Metadata to apply to the repository. (templated)

  • image_tag_mutability (str | None) – The tag mutability setting for the repository. (templated)

  • image_tag_mutability_exclusion_filters (list[dict[str, str]] | None) – Filters that override the repository’s image tag mutability setting. (templated)

  • image_scanning_configuration (dict[str, bool] | None) – The image scanning configuration for the repository. (templated)

  • encryption_configuration (dict[str, str] | None) – The encryption configuration for the repository. (templated)

  • aws_conn_id (str | None) – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).

  • region_name – AWS region_name. If not specified then the default boto3 behaviour is used.

  • verify – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers: ClassVar[dict[str, str]][source]
repository_name[source]
registry_id = None[source]
tags = None[source]
image_tag_mutability = None[source]
image_tag_mutability_exclusion_filters = None[source]
image_scanning_configuration = None[source]
encryption_configuration = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.amazon.aws.operators.ecr.EcrSetRepositoryPolicyOperator(*, repository_name, policy_text, registry_id=None, force=False, aws_conn_id='aws_default', **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.ecr.EcrHook]

Set the repository policy for an Amazon ECR repository.

See also

For more information on how to use this operator, take a look at the guide: Set an ECR repository policy

Parameters:
  • repository_name (str) – The name of the repository to receive the policy. (templated)

  • policy_text (str) – The JSON repository policy text to apply. (templated)

  • registry_id (str | None) – The AWS account ID associated with the registry. (templated)

  • force (bool) – Whether to replace an existing policy that prevents setting a new policy. (templated)

  • aws_conn_id (str | None) – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).

  • region_name – AWS region_name. If not specified then the default boto3 behaviour is used.

  • verify – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers: ClassVar[dict[str, str]][source]
repository_name[source]
policy_text[source]
registry_id = None[source]
force = False[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.amazon.aws.operators.ecr.EcrDeleteRepositoryOperator(*, repository_name, registry_id=None, force=False, aws_conn_id='aws_default', **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.ecr.EcrHook]

Delete an Amazon ECR repository.

See also

For more information on how to use this operator, take a look at the guide: Delete an ECR repository

Parameters:
  • repository_name (str) – The name of the repository to delete. (templated)

  • registry_id (str | None) – The AWS account ID associated with the registry. (templated)

  • force (bool) – Whether to delete the repository when it contains images. (templated)

  • aws_conn_id (str | None) – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).

  • region_name – AWS region_name. If not specified then the default boto3 behaviour is used.

  • verify – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
repository_name[source]
registry_id = None[source]
force = False[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?