{
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-redshift",
  "tagging" : {
    "taggable" : false
  },
  "handlers" : {
    "read" : {
      "permissions" : [ "redshift:DescribeEndpointAccess", "ec2:DescribeClientVpnEndpoints", "ec2:DescribeVpcEndpoint", "ec2:DescribeVpcAttribute", "ec2:DescribeSecurityGroups", "ec2:DescribeAddresses", "ec2:DescribeInternetGateways", "ec2:DescribeSubnets" ]
    },
    "create" : {
      "permissions" : [ "redshift:CreateEndpointAccess", "redshift:DescribeEndpointAccess", "ec2:CreateClientVpnEndpoint", "ec2:CreateVpcEndpoint", "ec2:DescribeVpcAttribute", "ec2:DescribeSecurityGroups", "ec2:DescribeAddresses", "ec2:DescribeInternetGateways", "ec2:DescribeSubnets" ],
      "timeoutInMinutes" : 60
    },
    "update" : {
      "permissions" : [ "redshift:DescribeEndpointAccess", "redshift:ModifyEndpointAccess", "ec2:ModifyClientVpnEndpoint", "ec2:ModifyVpcEndpoint", "ec2:DescribeVpcAttribute", "ec2:DescribeSecurityGroups", "ec2:DescribeAddresses", "ec2:DescribeInternetGateways", "ec2:DescribeSubnets" ],
      "timeoutInMinutes" : 60
    },
    "list" : {
      "permissions" : [ "redshift:DescribeEndpointAccess", "ec2:DescribeClientVpnEndpoints", "ec2:DescribeVpcEndpoints", "ec2:DescribeVpcAttribute", "ec2:DescribeSecurityGroups", "ec2:DescribeAddresses", "ec2:DescribeInternetGateways", "ec2:DescribeSubnets" ]
    },
    "delete" : {
      "permissions" : [ "redshift:DeleteEndpointAccess", "redshift:DescribeEndpointAccess", "ec2:DeleteClientVpnEndpoint", "ec2:DeleteVpcEndpoint", "ec2:DescribeVpcAttribute", "ec2:DescribeSecurityGroups", "ec2:DescribeAddresses", "ec2:DescribeInternetGateways", "ec2:DescribeSubnets", "ec2:DescribeVpcEndpoint" ],
      "timeoutInMinutes" : 60
    }
  },
  "typeName" : "AWS::Redshift::EndpointAccess",
  "readOnlyProperties" : [ "/properties/Address", "/properties/EndpointStatus", "/properties/EndpointCreateTime", "/properties/Port", "/properties/VpcSecurityGroups", "/properties/VpcSecurityGroups/*/VpcSecurityGroupId", "/properties/VpcSecurityGroups/*/Status", "/properties/VpcEndpoint", "/properties/VpcEndpoint/VpcEndpointId", "/properties/VpcEndpoint/VpcId", "/properties/VpcEndpoint/NetworkInterfaces/*/NetworkInterfaceId", "/properties/VpcEndpoint/NetworkInterfaces/*/PrivateIpAddress", "/properties/VpcEndpoint/NetworkInterfaces/*/SubnetId", "/properties/VpcEndpoint/NetworkInterfaces/*/AvailabilityZone" ],
  "description" : "Resource schema for a Redshift-managed VPC endpoint.",
  "createOnlyProperties" : [ "/properties/EndpointName", "/properties/ClusterIdentifier", "/properties/ResourceOwner", "/properties/SubnetGroupName" ],
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/EndpointName" ],
  "definitions" : {
    "VpcSecurityGroup" : {
      "description" : "Describes the members of a VPC security group.",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Status" : {
          "description" : "The status of the VPC security group.",
          "type" : "string"
        },
        "VpcSecurityGroupId" : {
          "description" : "The identifier of the VPC security group.",
          "type" : "string"
        }
      }
    },
    "NetworkInterface" : {
      "description" : "Describes a network interface.",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "PrivateIpAddress" : {
          "description" : "The IPv4 address of the network interface within the subnet.",
          "type" : "string"
        },
        "AvailabilityZone" : {
          "description" : "The Availability Zone.",
          "type" : "string"
        },
        "SubnetId" : {
          "description" : "The subnet identifier.",
          "type" : "string"
        },
        "NetworkInterfaceId" : {
          "description" : "The network interface identifier.",
          "type" : "string"
        }
      }
    }
  },
  "properties" : {
    "EndpointStatus" : {
      "description" : "The status of the endpoint.",
      "type" : "string"
    },
    "VpcEndpoint" : {
      "description" : "The connection endpoint for connecting to an Amazon Redshift cluster through the proxy.",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "VpcId" : {
          "relationshipRef" : {
            "typeName" : "AWS::EC2::VPCEndpoint",
            "propertyPath" : "/properties/VpcId"
          },
          "description" : "The VPC identifier that the endpoint is associated.",
          "type" : "string"
        },
        "NetworkInterfaces" : {
          "description" : "One or more network interfaces of the endpoint. Also known as an interface endpoint.",
          "insertionOrder" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/NetworkInterface"
          }
        },
        "VpcEndpointId" : {
          "relationshipRef" : {
            "typeName" : "AWS::EC2::VPCEndpoint",
            "propertyPath" : "/properties/Id"
          },
          "description" : "The connection endpoint ID for connecting an Amazon Redshift cluster through the proxy.",
          "type" : "string"
        }
      }
    },
    "Address" : {
      "description" : "The DNS address of the endpoint.",
      "type" : "string"
    },
    "EndpointName" : {
      "pattern" : "^(?=^[a-z][a-z0-9]*(-[a-z0-9]+)*$).{1,30}$",
      "description" : "The name of the endpoint.",
      "type" : "string"
    },
    "VpcSecurityGroupIds" : {
      "description" : "A list of vpc security group ids to apply to the created endpoint access.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "ResourceOwner" : {
      "pattern" : "^\\d{12}$",
      "description" : "The AWS account ID of the owner of the cluster.",
      "type" : "string"
    },
    "SubnetGroupName" : {
      "pattern" : "^(?=^[a-zA-Z0-9-]+$).{1,255}$",
      "description" : "The subnet group name where Amazon Redshift chooses to deploy the endpoint.",
      "type" : "string"
    },
    "Port" : {
      "description" : "The port number on which the cluster accepts incoming connections.",
      "type" : "integer"
    },
    "EndpointCreateTime" : {
      "description" : "The time (UTC) that the endpoint was created.",
      "type" : "string"
    },
    "ClusterIdentifier" : {
      "description" : "A unique identifier for the cluster. You use this identifier to refer to the cluster for any subsequent cluster operations such as deleting or modifying. All alphabetical characters must be lower case, no hypens at the end, no two consecutive hyphens. Cluster name should be unique for all clusters within an AWS account",
      "type" : "string"
    },
    "VpcSecurityGroups" : {
      "description" : "A list of Virtual Private Cloud (VPC) security groups to be associated with the endpoint.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/VpcSecurityGroup"
      }
    }
  },
  "required" : [ "ClusterIdentifier", "SubnetGroupName", "EndpointName", "VpcSecurityGroupIds" ]
}