{
  "typeName" : "AWS::EC2::NetworkInterface",
  "$schema" : "https://raw.githubusercontent.com/aws-cloudformation/cloudformation-resource-schema/master/src/main/resources/schema/provider.definition.schema.v1.json",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-ec2/networkinterface",
  "description" : "The AWS::EC2::NetworkInterface resource creates network interface",
  "additionalProperties" : false,
  "properties" : {
    "Description" : {
      "description" : "A description for the network interface.",
      "type" : "string"
    },
    "PrivateIpAddress" : {
      "description" : "Assigns a single private IP address to the network interface, which is used as the primary private IP address. If you want to specify multiple private IP address, use the PrivateIpAddresses property. ",
      "type" : "string"
    },
    "PrivateIpAddresses" : {
      "description" : "Assigns a list of private IP addresses to the network interface. You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/PrivateIpAddressSpecification"
      }
    },
    "SecondaryPrivateIpAddressCount" : {
      "description" : "The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses",
      "type" : "integer"
    },
    "PrimaryPrivateIpAddress" : {
      "description" : "Returns the primary private IP address of the network interface.",
      "type" : "string"
    },
    "Ipv4Prefixes" : {
      "description" : "Assigns a list of IPv4 prefixes to the network interface. If you want EC2 to automatically assign IPv4 prefixes, use the Ipv4PrefixCount property and do not specify this property. Presently, only /28 prefixes are supported. You can't specify IPv4 prefixes if you've specified one of the following: a count of IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Ipv4PrefixSpecification"
      }
    },
    "Ipv4PrefixCount" : {
      "description" : "The number of IPv4 prefixes to assign to a network interface. When you specify a number of IPv4 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if available, or from free spaces in the subnet. By default, these will be /28 prefixes. You can't specify a count of IPv4 prefixes if you've specified one of the following: specific IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses.",
      "type" : "integer"
    },
    "GroupSet" : {
      "description" : "A list of security group IDs associated with this network interface.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "type" : "string"
      }
    },
    "Ipv6Addresses" : {
      "description" : "One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface. If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify this property.",
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/InstanceIpv6Address"
      }
    },
    "Ipv6Prefixes" : {
      "description" : "Assigns a list of IPv6 prefixes to the network interface. If you want EC2 to automatically assign IPv6 prefixes, use the Ipv6PrefixCount property and do not specify this property. Presently, only /80 prefixes are supported. You can't specify IPv6 prefixes if you've specified one of the following: a count of IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Ipv6PrefixSpecification"
      }
    },
    "Ipv6PrefixCount" : {
      "description" : "The number of IPv6 prefixes to assign to a network interface. When you specify a number of IPv6 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if available, or from free spaces in the subnet. By default, these will be /80 prefixes. You can't specify a count of IPv6 prefixes if you've specified one of the following: specific IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses.",
      "type" : "integer"
    },
    "SubnetId" : {
      "description" : "The ID of the subnet to associate with the network interface.",
      "type" : "string"
    },
    "SourceDestCheck" : {
      "description" : "Indicates whether traffic to or from the instance is validated.",
      "type" : "boolean"
    },
    "InterfaceType" : {
      "description" : "Indicates the type of network interface.",
      "type" : "string"
    },
    "SecondaryPrivateIpAddresses" : {
      "description" : "Returns the secondary private IP addresses of the network interface.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "type" : "string"
      }
    },
    "Ipv6AddressCount" : {
      "description" : "The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the Ipv6Addresses property and don't specify this property.",
      "type" : "integer"
    },
    "EnablePrimaryIpv6" : {
      "description" : "If you have instances or ENIs that rely on the IPv6 address not changing, to avoid disrupting traffic to instances or ENIs, you can enable a primary IPv6 address. Enable this option to automatically assign an IPv6 associated with the ENI attached to your instance to be the primary IPv6 address. When you enable an IPv6 address to be a primary IPv6, you cannot disable it. Traffic will be routed to the primary IPv6 address until the instance is terminated or the ENI is detached. If you have multiple IPv6 addresses associated with an ENI and you enable a primary IPv6 address, the first IPv6 address associated with the ENI becomes the primary IPv6 address.",
      "type" : "boolean"
    },
    "PrimaryIpv6Address" : {
      "description" : "The primary IPv6 address",
      "type" : "string"
    },
    "ConnectionTrackingSpecification" : {
      "$ref" : "#/definitions/ConnectionTrackingSpecification"
    },
    "Id" : {
      "description" : "Network interface id.",
      "type" : "string"
    },
    "Tags" : {
      "description" : "An arbitrary set of tags (key-value pairs) for this network interface.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "VpcId" : {
      "description" : "The ID of the VPC",
      "type" : "string"
    },
    "PublicIpDnsHostnameTypeSpecification" : {
      "description" : "Public IP DNS hostname type",
      "type" : "string",
      "enum" : [ "public-dual-stack-dns-name", "public-ipv4-dns-name", "public-ipv6-dns-name" ]
    },
    "PublicIpDnsNameOptions" : {
      "$ref" : "#/definitions/PublicIpDnsNameOptions"
    }
  },
  "definitions" : {
    "PrivateIpAddressSpecification" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "PrivateIpAddress" : {
          "type" : "string"
        },
        "Primary" : {
          "type" : "boolean"
        }
      },
      "required" : [ "PrivateIpAddress", "Primary" ]
    },
    "InstanceIpv6Address" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Ipv6Address" : {
          "type" : "string"
        }
      },
      "required" : [ "Ipv6Address" ]
    },
    "Ipv4PrefixSpecification" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Ipv4Prefix" : {
          "type" : "string"
        }
      },
      "required" : [ "Ipv4Prefix" ]
    },
    "Ipv6PrefixSpecification" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Ipv6Prefix" : {
          "type" : "string"
        }
      },
      "required" : [ "Ipv6Prefix" ]
    },
    "ConnectionTrackingSpecification" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "TcpEstablishedTimeout" : {
          "type" : "integer"
        },
        "UdpStreamTimeout" : {
          "type" : "integer"
        },
        "UdpTimeout" : {
          "type" : "integer"
        }
      }
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Value" : {
          "type" : "string"
        },
        "Key" : {
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    },
    "PublicIpDnsNameOptions" : {
      "description" : "Describes the public hostname type options, including public hostname type, IPv4-enabled public hostname, IPv6-enabled public hostname, and dual-stack public hostname.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "DnsHostnameType" : {
          "type" : "string"
        },
        "PublicIpv4DnsName" : {
          "type" : "string"
        },
        "PublicIpv6DnsName" : {
          "type" : "string"
        },
        "PublicDualStackDnsName" : {
          "type" : "string"
        }
      }
    }
  },
  "required" : [ "SubnetId" ],
  "createOnlyProperties" : [ "/properties/PrivateIpAddress", "/properties/InterfaceType", "/properties/SubnetId" ],
  "primaryIdentifier" : [ "/properties/Id" ],
  "readOnlyProperties" : [ "/properties/Id", "/properties/SecondaryPrivateIpAddresses", "/properties/PrimaryPrivateIpAddress", "/properties/PrimaryIpv6Address", "/properties/VpcId", "/properties/PublicIpDnsNameOptions" ],
  "conditionalCreateOnlyProperties" : [ "/properties/PrivateIpAddresses", "/properties/EnablePrimaryIpv6", "/properties/ConnectionTrackingSpecification" ],
  "writeOnlyProperties" : [ "/properties/PublicIpDnsHostnameTypeSpecification" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "ec2:CreateTags", "ec2:DeleteTags" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:CreateTags", "ec2:ModifyNetworkInterfaceAttribute", "ec2:ModifyPublicIpDnsNameOptions" ]
    },
    "delete" : {
      "permissions" : [ "ec2:DescribeNetworkInterfaces", "ec2:DeleteNetworkInterface" ]
    },
    "list" : {
      "permissions" : [ "ec2:DescribeNetworkInterfaces" ]
    },
    "read" : {
      "permissions" : [ "ec2:DescribeNetworkInterfaces" ]
    },
    "update" : {
      "permissions" : [ "ec2:DescribeNetworkInterfaces", "ec2:ModifyNetworkInterfaceAttribute", "ec2:UnassignIpv6Addresses", "ec2:AssignIpv6Addresses", "ec2:DeleteTags", "ec2:CreateTags", "ec2:UnassignPrivateIpAddresses", "ec2:AssignPrivateIpAddresses", "ec2:ModifyPublicIpDnsNameOptions" ]
    }
  }
}