{
  "typeName" : "AWS::EC2::InstanceConnectEndpoint",
  "description" : "Resource Type definition for AWS::EC2::InstanceConnectEndpoint",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "SecurityGroupId" : {
      "description" : "The ID of the security group.",
      "type" : "string"
    },
    "NetworkInterfaceId" : {
      "description" : "The ID of the network interface.",
      "type" : "string"
    },
    "InstanceConnectEndpointPublicDnsNames" : {
      "description" : "The public DNS names of the endpoint, including IPv4-only and dualstack DNS names.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Ipv4" : {
          "description" : "The IPv4-only DNS name of the EC2 Instance Connect Endpoint.",
          "type" : "object",
          "$ref" : "#/definitions/InstanceConnectEndpointDnsNames"
        },
        "Dualstack" : {
          "description" : "The dualstack DNS name of the EC2 Instance Connect Endpoint. A dualstack DNS name supports connections from both IPv4 and IPv6 clients.",
          "type" : "object",
          "$ref" : "#/definitions/InstanceConnectEndpointDnsNames"
        }
      }
    },
    "InstanceConnectEndpointDnsNames" : {
      "description" : "The DNS names of the endpoint.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "DnsName" : {
          "description" : "The DNS name of the EC2 Instance Connect Endpoint.",
          "type" : "string"
        },
        "FipsDnsName" : {
          "description" : "The Federal Information Processing Standards (FIPS) compliant DNS name of the EC2 Instance Connect Endpoint.",
          "type" : "string"
        }
      }
    }
  },
  "properties" : {
    "Id" : {
      "description" : "The ID of the EC2 Instance Connect Endpoint.",
      "type" : "string"
    },
    "SubnetId" : {
      "description" : "The ID of the subnet in which the EC2 Instance Connect Endpoint was created.",
      "type" : "string"
    },
    "ClientToken" : {
      "description" : "The client token of the instance connect endpoint.",
      "type" : "string"
    },
    "PreserveClientIp" : {
      "description" : "Indicates whether your client's IP address is preserved as the source when you connect to a resource.",
      "type" : "boolean"
    },
    "Tags" : {
      "description" : "The tags assigned to the EC2 Instance Connect Endpoint.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "SecurityGroupIds" : {
      "description" : "The security groups associated with the endpoint.",
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/SecurityGroupId"
      }
    },
    "AvailabilityZone" : {
      "description" : "The Availability Zone of the EC2 Instance Connect Endpoint",
      "type" : "string"
    },
    "AvailabilityZoneId" : {
      "description" : "The ID of the Availability Zone of the EC2 Instance Connect Endpoint",
      "type" : "string"
    },
    "CreatedAt" : {
      "description" : "The date and time that the EC2 Instance Connect Endpoint was created",
      "type" : "string"
    },
    "InstanceConnectEndpointArn" : {
      "description" : "The Amazon Resource Name (ARN) of the EC2 Instance Connect Endpoint",
      "type" : "string"
    },
    "NetworkInterfaceIds" : {
      "description" : "The ID of the elastic network interface that Amazon EC2 automatically created when creating the EC2 Instance Connect Endpoint",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/NetworkInterfaceId"
      }
    },
    "OwnerId" : {
      "description" : "The ID of the AWS account that created the EC2 Instance Connect Endpoint",
      "type" : "string"
    },
    "PublicDnsNames" : {
      "description" : "The public DNS names of the endpoint",
      "type" : "object",
      "$ref" : "#/definitions/InstanceConnectEndpointPublicDnsNames"
    },
    "State" : {
      "description" : "The current state of the EC2 Instance Connect Endpoint",
      "type" : "string",
      "enum" : [ "create-in-progress", "create-complete", "create-failed", "delete-in-progress", "delete-complete", "delete-failed", "update-in-progress", "update-complete", "update-failed" ]
    },
    "StateMessage" : {
      "description" : "The message for the current state of the EC2 Instance Connect Endpoint. Can include a failure message",
      "type" : "string"
    },
    "VpcId" : {
      "description" : "The ID of the VPC in which the EC2 Instance Connect Endpoint was created",
      "type" : "string"
    }
  },
  "additionalProperties" : false,
  "required" : [ "SubnetId" ],
  "readOnlyProperties" : [ "/properties/Id", "/properties/AvailabilityZone", "/properties/AvailabilityZoneId", "/properties/CreatedAt", "/properties/InstanceConnectEndpointArn", "/properties/NetworkInterfaceIds", "/properties/OwnerId", "/properties/PublicDnsNames", "/properties/State", "/properties/StateMessage", "/properties/VpcId" ],
  "createOnlyProperties" : [ "/properties/SubnetId", "/properties/ClientToken", "/properties/PreserveClientIp", "/properties/SecurityGroupIds" ],
  "writeOnlyProperties" : [ "/properties/ClientToken" ],
  "primaryIdentifier" : [ "/properties/Id" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "ec2:CreateTags", "ec2:DeleteTags" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "ec2:CreateInstanceConnectEndpoint", "ec2:DescribeInstanceConnectEndpoints", "ec2:CreateTags", "ec2:CreateNetworkInterface", "iam:CreateServiceLinkedRole" ]
    },
    "read" : {
      "permissions" : [ "ec2:DescribeInstanceConnectEndpoints" ]
    },
    "update" : {
      "permissions" : [ "ec2:DescribeInstanceConnectEndpoints", "ec2:CreateTags", "ec2:DeleteTags" ]
    },
    "delete" : {
      "permissions" : [ "ec2:DeleteInstanceConnectEndpoint", "ec2:DescribeInstanceConnectEndpoints" ]
    },
    "list" : {
      "permissions" : [ "ec2:DescribeInstanceConnectEndpoints" ]
    }
  }
}