lifecycle_policy#

Exec module for managing Amazon EC2 Container Registry (ECR) Lifecycle Policies.

async idem_aws.exec.aws.ecr.lifecycle_policy.get(hub, ctx, name: str, resource_id: str = None, registry_id: str = None, repository_name: str = None) Dict[str, Any][source]#

Retrieves a Amazon EC2 Container Registry (ECR) Lifecycle Policy created on a repository in a registry.

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – The name of the ECR repository in Amazon Web Services. If resource_id is not None, it takes precedence in get API call.

  • registry_id (str, Optional) – The Amazon Web Services account ID associated with the registry that contains the repository to search. If you do not specify a registry, the default registry is assumed.

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

Returns:

Return image repository in a given registry.

Return type:

Dict[str, Any]

Examples

Calling this exec module function from the cli:

idem exec aws.ecr.lifecycle_policy.get name='idem_name' resource_id='ecr_lifecycle_policy'

Calling this exec module function from within a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.ecr.lifecycle_policy.get
    - kwargs:
        name: 'idem_name'
        resource_id: 'ecr_lifecycle_policy'