{
  "typeName" : "AWS::ECR::ReplicationConfiguration",
  "description" : "The AWS::ECR::ReplicationConfiguration resource configures the replication destinations for an Amazon Elastic Container Registry (Amazon Private ECR). For more information, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/replication.html",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-ecr.git",
  "definitions" : {
    "ReplicationConfiguration" : {
      "type" : "object",
      "properties" : {
        "Rules" : {
          "type" : "array",
          "minItems" : 0,
          "maxItems" : 10,
          "items" : {
            "$ref" : "#/definitions/ReplicationRule"
          },
          "description" : "An array of objects representing the replication rules for a replication configuration. A replication configuration may contain a maximum of 10 rules."
        }
      },
      "description" : "An object representing the replication configuration for a registry.",
      "required" : [ "Rules" ],
      "additionalProperties" : false
    },
    "ReplicationRule" : {
      "type" : "object",
      "properties" : {
        "RepositoryFilters" : {
          "type" : "array",
          "minItems" : 0,
          "maxItems" : 100,
          "items" : {
            "$ref" : "#/definitions/RepositoryFilter"
          },
          "description" : "An array of objects representing the details of a repository filter."
        },
        "Destinations" : {
          "type" : "array",
          "minItems" : 1,
          "maxItems" : 25,
          "items" : {
            "$ref" : "#/definitions/ReplicationDestination"
          },
          "description" : "An array of objects representing the details of a replication destination."
        }
      },
      "description" : "An array of objects representing the details of a replication destination.",
      "required" : [ "Destinations" ],
      "additionalProperties" : false
    },
    "RepositoryFilter" : {
      "type" : "object",
      "properties" : {
        "Filter" : {
          "$ref" : "#/definitions/Filter"
        },
        "FilterType" : {
          "$ref" : "#/definitions/FilterType"
        }
      },
      "description" : "An array of objects representing the details of a repository filter.",
      "required" : [ "Filter", "FilterType" ],
      "additionalProperties" : false
    },
    "Filter" : {
      "type" : "string",
      "description" : "The repository filter to be applied for replication.",
      "pattern" : "^(?:[a-z0-9]+(?:[._-][a-z0-9]*)*/)*[a-z0-9]*(?:[._-][a-z0-9]*)*$"
    },
    "FilterType" : {
      "description" : "Type of repository filter",
      "type" : "string",
      "enum" : [ "PREFIX_MATCH" ]
    },
    "ReplicationDestination" : {
      "type" : "object",
      "properties" : {
        "Region" : {
          "$ref" : "#/definitions/Region"
        },
        "RegistryId" : {
          "$ref" : "#/definitions/RegistryId"
        }
      },
      "description" : "An array of objects representing the details of a replication destination.",
      "required" : [ "Region", "RegistryId" ],
      "additionalProperties" : false
    },
    "RegistryId" : {
      "type" : "string",
      "description" : "The account ID of the destination registry to replicate to.",
      "pattern" : "^[0-9]{12}$"
    },
    "Region" : {
      "description" : "A Region to replicate to.",
      "type" : "string",
      "pattern" : "[0-9a-z-]{2,25}"
    }
  },
  "properties" : {
    "ReplicationConfiguration" : {
      "$ref" : "#/definitions/ReplicationConfiguration"
    },
    "RegistryId" : {
      "type" : "string",
      "description" : "The RegistryId associated with the aws account."
    }
  },
  "required" : [ "ReplicationConfiguration" ],
  "primaryIdentifier" : [ "/properties/RegistryId" ],
  "readOnlyProperties" : [ "/properties/RegistryId" ],
  "additionalProperties" : false,
  "handlers" : {
    "create" : {
      "permissions" : [ "ecr:DescribeRegistry", "ecr:PutReplicationConfiguration", "iam:CreateServiceLinkedRole" ]
    },
    "read" : {
      "permissions" : [ "ecr:DescribeRegistry" ]
    },
    "update" : {
      "permissions" : [ "ecr:DescribeRegistry", "ecr:PutReplicationConfiguration", "iam:CreateServiceLinkedRole" ]
    },
    "delete" : {
      "permissions" : [ "ecr:DescribeRegistry", "ecr:PutReplicationConfiguration", "iam:CreateServiceLinkedRole" ]
    },
    "list" : {
      "permissions" : [ "ecr:DescribeRegistry" ]
    }
  }
}