{
  "typeName" : "AWS::ECR::RegistryPolicy",
  "description" : "The AWS::ECR::RegistryPolicy 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: https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-ecr.git",
  "definitions" : {
    "RegistryId" : {
      "type" : "string",
      "description" : "The registry id.",
      "minLength" : 12,
      "maxLength" : 12,
      "pattern" : "^[0-9]{12}$"
    }
  },
  "properties" : {
    "RegistryId" : {
      "$ref" : "#/definitions/RegistryId"
    },
    "PolicyText" : {
      "type" : "object",
      "description" : "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 (https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html) in the Amazon Elastic Container Registry User Guide."
    }
  },
  "required" : [ "PolicyText" ],
  "readOnlyProperties" : [ "/properties/RegistryId" ],
  "primaryIdentifier" : [ "/properties/RegistryId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ecr:PutRegistryPolicy" ]
    },
    "read" : {
      "permissions" : [ "ecr:GetRegistryPolicy" ]
    },
    "list" : {
      "permissions" : [ "ecr:GetRegistryPolicy" ]
    },
    "update" : {
      "permissions" : [ "ecr:PutRegistryPolicy" ]
    },
    "delete" : {
      "permissions" : [ "ecr:DeleteRegistryPolicy" ]
    }
  },
  "additionalProperties" : false
}