repository#

State module for managing Amazon ECR Repositories.

async idem_aws.states.aws.ecr.repository.present(hub, ctx, name: str, resource_id: str = None, registry_id: str = None, image_tag_mutability: str = None, image_scanning_configuration: ~types.The image scanning configuration for the repository.ImageScanningConfiguration = None, encryption_configuration: ~types.The encryption configuration for the repository.EncryptionConfiguration = None, tags: ~typing.Dict[str, ~typing.Any] = None) Dict[str, Any][source]#

Creates an AWS ECR repository.

Repository properties cannot be updated after creation, only tags can be updated.

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

  • resource_id (str, Optional) – The name of the ECR repository in Amazon Web Services.

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

  • image_tag_mutability (str, Optional) – The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.

  • image_scanning_configuration (dict, Optional) –

    The image scanning configuration for the repository.

    • scanOnPush (bool, Optional):

      The setting that determines whether images are scanned after being pushed to a repository. If set to true , images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started.

  • encryption_configuration (dict, Optional) –

    The encryption configuration for the repository.

    • encryptionType (str):

      The encryption type to use. If you use the KMS encryption type, the contents of the repository will be encrypted using server-side encryption with Key Management Service key stored in KMS. If you use the AES256 encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 encryption algorithm.

    • kmsKey (str, Optional):

      If you use the KMS encryption type, specify the KMS key to use for encryption. The alias, key ID, or full ARN of the KMS key can be specified. The key must exist in the same Region as the repository. If no key is specified, the default Amazon Web Services managed KMS key for Amazon ECR will be used.

  • tags (dict or list, Optional) –

    Dict in the format of {tag-key: tag-value} or List of tags in the format of [{"Key": tag-key, "Value": tag-value}] to associate with the repository.

    • Key (str):

      One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values. Tag keys can have a maximum character length of 128 characters

    • Value (str):

      A value acts as a descriptor within a tag category (key). Tag values can have a maximum length of 256 characters.

Request Syntax:
[idem_test_aws_ecr_repository]:
  aws.ecr.repository.present:
    - name: 'string'
    - registry_id: 'string'
    - image_tag_mutability: 'MUTABLE|IMMUTABLE'
    - image_scanning_configuration:
        scanOnPush: True|False
    - encryption_configuration:
        encryptionType: 'AES256|KMS'
        kmsKey: 'string'
    - tags:
      - Key: 'string'
        Value: 'string'
Returns:

Dict[str, Any]

Examples

idem_test_aws_ecr_repository:
  aws.ecr.repository.present:
    - name: idem_test_ecr_repository
    - registry_id: idem_test_ecr_registry
    - image_tag_mutability: 'MUTABLE'
    - image_scanning_configuration:
        scanOnPush: False
    - encryption_configuration:
        encryptionType: 'AES256'
    - tags:
      - Key: provider
        Value: idem
async idem_aws.states.aws.ecr.repository.absent(hub, ctx, name: str, resource_id: str = None, registry_id: str = None, force: bool = None) Dict[str, Any][source]#

Deletes an AWS ECR repository.

If the repository contains images, you must either delete all images in the repository or use the force option to delete the repository.

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

  • resource_id (str, Optional) –

    The name of the ECR repository in Amazon Web Services.

    Warning

    Idem automatically considers this resource being absent if this field is not specified.

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

  • force (bool, Optional) – If a repository contains images, forces the deletion.

Request syntax:
[idem_test_aws_ecr_repository]:
  aws.ecr.repository.absent:
    - name: 'string'
    - resource_id: 'string'
    - registry_id: 'string'
    - force: True|False
Returns:

Dict[str, Any]

Examples

idem_test_aws_ecr_repository:
  aws.ecr.repository.absent:
    - name: idem_test_ecr_repository
    - resource_id: idem_test_ecr_repository
    - registry_id: idem_test_ecr_registry
    - force: True
async idem_aws.states.aws.ecr.repository.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describes AWS ECR repositories in a registry in a way that can be recreated/managed with the corresponding “present” function.

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe aws.ecr.repository