Amazon EC2 Container Registry

2020/12/08 - Amazon EC2 Container Registry - 5 new api methods

Changes  This release adds support for configuring cross-region and cross-account replication of your Amazon ECR images.

DescribeRegistry (new) Link ¶

Describes the settings for a registry. The replication configuration for a repository can be created or updated with the PutReplicationConfiguration API action.

See also: AWS API Documentation

Request Syntax

client.describe_registry()
rtype

dict

returns

Response Syntax

{
    'registryId': 'string',
    'replicationConfiguration': {
        'rules': [
            {
                'destinations': [
                    {
                        'region': 'string',
                        'registryId': 'string'
                    },
                ]
            },
        ]
    }
}

Response Structure

  • (dict) --

    • registryId (string) --

      The ID of the registry.

    • replicationConfiguration (dict) --

      The replication configuration for the registry.

      • rules (list) --

        An array of objects representing the replication rules for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.

        • (dict) --

          An array of objects representing the replication destinations for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.

          • destinations (list) --

            An array of objects representing the details of a replication destination.

            • (dict) --

              An array of objects representing the details of a replication destination.

              • region (string) --

                A Region to replicate to.

              • registryId (string) --

                The account ID of the destination registry to replicate to.

GetRegistryPolicy (new) Link ¶

Retrieves the permissions policy for a registry.

See also: AWS API Documentation

Request Syntax

client.get_registry_policy()
rtype

dict

returns

Response Syntax

{
    'registryId': 'string',
    'policyText': 'string'
}

Response Structure

  • (dict) --

    • registryId (string) --

      The ID of the registry.

    • policyText (string) --

      The JSON text of the permissions policy for a registry.

PutReplicationConfiguration (new) Link ¶

Creates or updates the replication configuration for a registry. The existing replication configuration for a repository can be retrieved with the DescribeRegistry API action. The first time the PutReplicationConfiguration API is called, a service-linked IAM role is created in your account for the replication process. For more information, see Using Service-Linked Roles for Amazon ECR in the Amazon Elastic Container Registry User Guide .

Note

When configuring cross-account replication, the destination account must grant the source account permission to replicate. This permission is controlled using a registry permissions policy. For more information, see PutRegistryPolicy.

See also: AWS API Documentation

Request Syntax

client.put_replication_configuration(
    replicationConfiguration={
        'rules': [
            {
                'destinations': [
                    {
                        'region': 'string',
                        'registryId': 'string'
                    },
                ]
            },
        ]
    }
)
type replicationConfiguration

dict

param replicationConfiguration

[REQUIRED]

An object representing the replication configuration for a registry.

  • rules (list) -- [REQUIRED]

    An array of objects representing the replication rules for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.

    • (dict) --

      An array of objects representing the replication destinations for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.

      • destinations (list) -- [REQUIRED]

        An array of objects representing the details of a replication destination.

        • (dict) --

          An array of objects representing the details of a replication destination.

          • region (string) -- [REQUIRED]

            A Region to replicate to.

          • registryId (string) -- [REQUIRED]

            The account ID of the destination registry to replicate to.

rtype

dict

returns

Response Syntax

{
    'replicationConfiguration': {
        'rules': [
            {
                'destinations': [
                    {
                        'region': 'string',
                        'registryId': 'string'
                    },
                ]
            },
        ]
    }
}

Response Structure

  • (dict) --

    • replicationConfiguration (dict) --

      The contents of the replication configuration for the registry.

      • rules (list) --

        An array of objects representing the replication rules for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.

        • (dict) --

          An array of objects representing the replication destinations for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.

          • destinations (list) --

            An array of objects representing the details of a replication destination.

            • (dict) --

              An array of objects representing the details of a replication destination.

              • region (string) --

                A Region to replicate to.

              • registryId (string) --

                The account ID of the destination registry to replicate to.

DeleteRegistryPolicy (new) Link ¶

Deletes the registry permissions policy.

See also: AWS API Documentation

Request Syntax

client.delete_registry_policy()
rtype

dict

returns

Response Syntax

{
    'registryId': 'string',
    'policyText': 'string'
}

Response Structure

  • (dict) --

    • registryId (string) --

      The registry ID associated with the request.

    • policyText (string) --

      The contents of the registry permissions policy that was deleted.

PutRegistryPolicy (new) Link ¶

Creates or updates the permissions policy for your registry.

A registry policy is used to specify permissions for another AWS account and is used when configuring cross-account replication. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide .

See also: AWS API Documentation

Request Syntax

client.put_registry_policy(
    policyText='string'
)
type policyText

string

param policyText

[REQUIRED]

The JSON policy text to apply to your registry. The policy text follows the same format as IAM policy text. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide .

rtype

dict

returns

Response Syntax

{
    'registryId': 'string',
    'policyText': 'string'
}

Response Structure

  • (dict) --

    • registryId (string) --

      The registry ID.

    • policyText (string) --

      The JSON policy text for your registry.