{
  "typeName" : "AWS::CodeConnections::Connection",
  "description" : "Schema for AWS::CodeConnections::Connection resource which can be used to connect external source providers with other AWS services (i.e. AWS CodePipeline)",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-codeconnections.git",
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Value", "Key" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "ConnectionArn" : {
      "description" : "The Amazon Resource Name (ARN) of the  connection. The ARN is used as the connection reference when the connection is shared between AWS services.",
      "type" : "string",
      "minLength" : 0,
      "maxLength" : 256,
      "pattern" : "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+"
    },
    "ConnectionName" : {
      "description" : "The name of the connection. Connection names must be unique in an AWS user account.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 32
    },
    "ConnectionStatus" : {
      "description" : "The current status of the connection.",
      "type" : "string"
    },
    "OwnerAccountId" : {
      "description" : "The name of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.",
      "type" : "string",
      "minLength" : 12,
      "maxLength" : 12,
      "pattern" : "[0-9]{12}"
    },
    "ProviderType" : {
      "description" : "The name of the external provider where your third-party code repository is configured. You must specify either a ProviderType or a HostArn.",
      "type" : "string"
    },
    "HostArn" : {
      "description" : "The host arn configured to represent the infrastructure where your third-party provider is installed. You must specify either a ProviderType or a HostArn.",
      "type" : "string",
      "minLength" : 0,
      "maxLength" : 256,
      "pattern" : "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+"
    },
    "Tags" : {
      "description" : "Specifies the tags applied to a connection.",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "insertionOrder" : false
    }
  },
  "required" : [ "ConnectionName" ],
  "createOnlyProperties" : [ "/properties/ConnectionName", "/properties/ProviderType", "/properties/HostArn" ],
  "readOnlyProperties" : [ "/properties/ConnectionArn", "/properties/ConnectionStatus", "/properties/OwnerAccountId" ],
  "primaryIdentifier" : [ "/properties/ConnectionArn" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "codeconnections:TagResource", "codeconnections:ListTagsForResource", "codeconnections:UntagResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "codeconnections:CreateConnection", "codeconnections:TagResource" ]
    },
    "read" : {
      "permissions" : [ "codeconnections:GetConnection", "codeconnections:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "codeconnections:ListTagsForResource", "codeconnections:TagResource", "codeconnections:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "codeconnections:DeleteConnection" ]
    },
    "list" : {
      "permissions" : [ "codeconnections:ListConnections", "codeconnections:ListTagsForResource" ]
    }
  },
  "additionalProperties" : false
}