# This file is automatically generated by botocraft.  Do not edit directly.
# pylint: disable=anomalous-backslash-in-string,unsubscriptable-object,line-too-long,arguments-differ,arguments-renamed
# mypy: disable-error-code="index, override, assignment"
from collections import OrderedDict
from datetime import datetime
from functools import cached_property
from typing import Any, ClassVar, Dict, List, Literal, Optional, Type, cast

from pydantic import Field

from botocraft.mixins.ec2 import (EC2TagsManagerMixin, SecurityGroupModelMixin,
                                  ec2_instance_only, ec2_instances_only)
from botocraft.mixins.tags import TagsDictMixin
from botocraft.services.common import Filter, Tag

from .abstract import (Boto3Model, Boto3ModelManager, PrimaryBoto3Model,
                       ReadonlyBoto3Model, ReadonlyBoto3ModelManager,
                       ReadonlyPrimaryBoto3Model)

# ===============
# Managers
# ===============


class VpcManager(ReadonlyBoto3ModelManager):
    service_name: str = "ec2"

    def get(self, VpcId: str, *, DryRun: bool = False) -> Optional["Vpc"]:
        """
        Describes one or more of your VPCs.

        Args:
            VpcId: The name of the VPC to describe.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            VpcIds=self.serialize([VpcId]), DryRun=self.serialize(DryRun)
        )
        _response = self.client.describe_vpcs(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeVpcsResult(**_response)

        if response.Vpcs:
            return response.Vpcs[0]
        return None

    def list(
        self,
        *,
        Filters: Optional[List[Filter]] = None,
        VpcIds: Optional[List[str]] = None,
        DryRun: Optional[bool] = None
    ) -> List["Vpc"]:
        """
        Describes one or more of your VPCs.

        Keyword Args:
            Filters: The filters.
            VpcIds: The IDs of the VPCs.
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        paginator = self.client.get_paginator("describe_vpcs")
        args: Dict[str, Any] = dict(
            Filters=self.serialize(Filters),
            VpcIds=self.serialize(VpcIds),
            DryRun=self.serialize(DryRun),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["Vpc"] = []
        for _response in response_iterator:
            response = DescribeVpcsResult(**_response)
            if response.Vpcs:
                results.extend(response.Vpcs)
            else:
                break
        return results

    def dns_hostnames(self, VpcId: str) -> bool:
        """
        Describes the specified attribute of the specified VPC. You can specify
        only one attribute at a time.

        Args:
            VpcId: The ID of the VPC.
        """
        args: Dict[str, Any] = dict(
            Attribute="enableDnsHostnames", VpcId=self.serialize(VpcId), DryRun=False
        )
        _response = self.client.describe_vpc_attribute(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeVpcAttributeResult(**_response)

        return response.EnableDnsHostnames["Value"]

    def dns_support(self, VpcId: str) -> bool:
        """
        Describes the specified attribute of the specified VPC. You can specify
        only one attribute at a time.

        Args:
            VpcId: The ID of the VPC.
        """
        args: Dict[str, Any] = dict(
            Attribute="enableDnsSupport", VpcId=self.serialize(VpcId), DryRun=False
        )
        _response = self.client.describe_vpc_attribute(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeVpcAttributeResult(**_response)

        return response.EnableDnsSupport["Value"]

    def network_address_usage_metrics(self, VpcId: str) -> bool:
        """
        Describes the specified attribute of the specified VPC. You can specify
        only one attribute at a time.

        Args:
            VpcId: The ID of the VPC.
        """
        args: Dict[str, Any] = dict(
            Attribute="enableNetworkAddressUsageMetrics",
            VpcId=self.serialize(VpcId),
            DryRun=False,
        )
        _response = self.client.describe_vpc_attribute(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeVpcAttributeResult(**_response)

        return response.EnableNetworkAddressUsageMetrics["Value"]


class SubnetManager(ReadonlyBoto3ModelManager):
    service_name: str = "ec2"

    def get(self, SubnetId: str, *, DryRun: bool = False) -> Optional["Subnet"]:
        """
        Describes one or more of your subnets.

        Args:
            SubnetId: The ID of the VPC subnet to describe.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            SubnetIds=self.serialize([SubnetId]), DryRun=self.serialize(DryRun)
        )
        _response = self.client.describe_subnets(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeSubnetsResult(**_response)

        if response.Subnets:
            return response.Subnets[0]
        return None

    def list(
        self,
        *,
        Filters: Optional[List[Filter]] = None,
        SubnetIds: Optional[List[str]] = None,
        DryRun: Optional[bool] = None
    ) -> List["Subnet"]:
        """
        Describes one or more of your subnets.

        Keyword Args:
            Filters: The filters.
            SubnetIds: The IDs of the subnets.
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        paginator = self.client.get_paginator("describe_subnets")
        args: Dict[str, Any] = dict(
            Filters=self.serialize(Filters),
            SubnetIds=self.serialize(SubnetIds),
            DryRun=self.serialize(DryRun),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["Subnet"] = []
        for _response in response_iterator:
            response = DescribeSubnetsResult(**_response)
            if response.Subnets:
                results.extend(response.Subnets)
            else:
                break
        return results


class SecurityGroupManager(EC2TagsManagerMixin, Boto3ModelManager):
    service_name: str = "ec2"

    def create(self, model: "SecurityGroup", DryRun: bool = False) -> str:
        """
        Creates a security group.

        Args:
            model: The :py:class:`SecurityGroup` to create.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            Description=data.get("Description"),
            GroupName=data.get("GroupName"),
            VpcId=data.get("VpcId"),
            TagSpecifications=self.serialize(
                self.serialize(self.convert_tags(model.Tags, "security-group"))
            ),
            DryRun=self.serialize(DryRun),
        )
        _response = self.client.create_security_group(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateSecurityGroupResult(**_response)

        return cast(str, response.GroupId)

    def delete(self, GroupId: str, *, DryRun: bool = False) -> None:
        """
        Deletes a security group.

        Args:
            GroupId: The ID of the security group.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            GroupId=self.serialize(GroupId), DryRun=self.serialize(DryRun)
        )
        self.client.delete_security_group(
            **{k: v for k, v in args.items() if v is not None}
        )

    def get(self, GroupId: str, *, DryRun: bool = False) -> Optional["SecurityGroup"]:
        """
        Describes the specified security groups or all of your security groups.

        Args:
            GroupId: The ID of the security group.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            GroupIds=self.serialize([GroupId]), DryRun=self.serialize(DryRun)
        )
        _response = self.client.describe_security_groups(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeSecurityGroupsResult(**_response)

        if response.SecurityGroups:
            return response.SecurityGroups[0]
        return None

    def list(
        self,
        *,
        Filters: Optional[List[Filter]] = None,
        GroupIds: Optional[List[str]] = None,
        GroupNames: Optional[List[str]] = None,
        DryRun: bool = False
    ) -> List["SecurityGroup"]:
        """
        Describes the specified security groups or all of your security groups.

        Keyword Args:
            Filters: The filters. If using multiple filters for rules, the results
                include security groups for which any combination of rules - not
                necessarily a single rule - match all filters.
            GroupIds: The IDs of the security groups. Required for security groups in a
                nondefault VPC.
            GroupNames: [Default VPC] The names of the security groups. You can specify
                either the security group name or the security group ID.
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        paginator = self.client.get_paginator("describe_security_groups")
        args: Dict[str, Any] = dict(
            Filters=self.serialize(Filters),
            GroupIds=self.serialize(GroupIds),
            GroupNames=self.serialize(GroupNames),
            DryRun=self.serialize(DryRun),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["SecurityGroup"] = []
        for _response in response_iterator:
            response = DescribeSecurityGroupsResult(**_response)
            if response.SecurityGroups:
                results.extend(response.SecurityGroups)
            else:
                break
        return results

    def revoke_ingress(
        self, GroupId: str, IpPermissions: List["IpPermission"], *, DryRun: bool = False
    ) -> Optional[bool]:
        """
        Removes the specified inbound (ingress) rules from a security group.

        Args:
            GroupId: The ID of the security group.
            IpPermissions: The sets of IP permissions. You can't specify a source
                security group and a CIDR IP address range in the same set of permissions.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            GroupId=self.serialize(GroupId),
            IpPermissions=self.serialize(IpPermissions),
            DryRun=self.serialize(DryRun),
        )
        _response = self.client.revoke_security_group_ingress(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = RevokeSecurityGroupIngressResult(**_response)

        return response.Return

    def authorize_ingress(
        self,
        GroupId: str,
        IpPermissions: List["IpPermission"],
        *,
        DryRun: bool = False,
        Tags: Optional[Optional[List["Tag"]]] = None
    ) -> Optional[bool]:
        """
        Adds the specified inbound (ingress) rules to a security group.

        Args:
            GroupId: The ID of the security group. You must specify either the security
                group ID or the security group name in the request. For security groups in
                a nondefault VPC, you must specify the security group ID.
            IpPermissions: The sets of IP permissions.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
            Tags: [VPC Only] The tags applied to the security group rule.
        """
        args: Dict[str, Any] = dict(
            GroupId=self.serialize(GroupId),
            IpPermissions=self.serialize(IpPermissions),
            DryRun=self.serialize(DryRun),
            TagSpecifications=self.serialize(
                self.serialize(self.convert_tags(Tags, "security-group-rule"))
            ),
        )
        _response = self.client.authorize_security_group_ingress(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = AuthorizeSecurityGroupIngressResult(**_response)

        return response.Return


class NetworkAclManager(EC2TagsManagerMixin, Boto3ModelManager):
    service_name: str = "ec2"

    def create(self, model: "NetworkAcl") -> "NetworkAcl":
        """
        Creates a network ACL in a VPC. Network ACLs provide an optional layer
        of security (in addition to security groups) for the instances in your
        VPC.

        Args:
            model: The :py:class:`NetworkAcl` to create.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            VpcId=data.get("VpcId"),
            DryRun=data.get("DryRun"),
            TagSpecifications=self.serialize(
                self.serialize(self.convert_tags(model.Tags, "network-acl"))
            ),
        )
        _response = self.client.create_network_acl(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateNetworkAclResult(**_response)

        return cast("NetworkAcl", response.NetworkAcl)

    def delete(self, NetworkAclId: str, *, DryRun: bool = False) -> None:
        """
        Deletes the specified network ACL. You can't delete the ACL if it's
        associated with any subnets. You can't delete the default network ACL.

        Args:
            NetworkAclId: The ID of the network ACL.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            NetworkAclId=self.serialize(NetworkAclId), DryRun=self.serialize(DryRun)
        )
        self.client.delete_network_acl(
            **{k: v for k, v in args.items() if v is not None}
        )

    def get(self, NetworkAclId: str, *, DryRun: bool = False) -> Optional["NetworkAcl"]:
        """
        Describes one or more of your network ACLs.

        Args:
            NetworkAclId: The ID of the network ACL.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            DryRun=self.serialize(DryRun), NetworkAclIds=self.serialize([NetworkAclId])
        )
        _response = self.client.describe_network_acls(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeNetworkAclsResult(**_response)

        if response.NetworkAcls:
            return response.NetworkAcls[0]
        return None

    def list(
        self,
        *,
        Filters: Optional[List[Filter]] = None,
        DryRun: bool = False,
        NetworkAclIds: Optional[List[str]] = None
    ) -> List["NetworkAcl"]:
        """
        Describes one or more of your network ACLs.

        Keyword Args:
            Filters: The filters.
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
            NetworkAclIds: The IDs of the network ACLs.
        """
        paginator = self.client.get_paginator("describe_network_acls")
        args: Dict[str, Any] = dict(
            Filters=self.serialize(Filters),
            DryRun=self.serialize(DryRun),
            NetworkAclIds=self.serialize(NetworkAclIds),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["NetworkAcl"] = []
        for _response in response_iterator:
            response = DescribeNetworkAclsResult(**_response)
            if response.NetworkAcls:
                results.extend(response.NetworkAcls)
            else:
                break
        return results


class InstanceManager(EC2TagsManagerMixin, Boto3ModelManager):
    service_name: str = "ec2"

    def create(
        self,
        model: "Instance",
        MaxCount: int,
        MinCount: int,
        DisableApiTermination: bool = False,
        DisableApiStop: bool = False,
        InstanceInitiatedShutdownBehavior: Literal["stop", "terminate"] = "terminate",
        Ipv6AddressCount: Optional[int] = None,
        Ipv6Addresses: Optional[List["InstanceIpv6Address"]] = None,
        SecurityGroupIds: Optional[List[str]] = None,
        UserData: Optional[str] = None,
        ElasticGpuSpecification: Optional[List["ElasticGpuSpecification"]] = None,
        ElasticInferenceAccelerators: Optional[
            List["ElasticInferenceAccelerator"]
        ] = None,
        LaunchTemplate: Optional["EC2LaunchTemplateSpecification"] = None,
        InstanceMarketOptions: Optional["InstanceMarketOptionsRequest"] = None,
        CreditSpecification: Optional["CreditSpecificationRequest"] = None,
        LicenseSpecifications: Optional[List["LicenseConfigurationRequest"]] = None,
        EnablePrimaryIpv6: Optional[bool] = None,
    ) -> "Instance":
        """
        Launches the specified number of instances using an AMI for which you
        have permissions.

        Args:
            model: The :py:class:`Instance` to create.
            MaxCount: The maximum number of instances to launch. If you specify more
                instances than Amazon EC2 can launch in the target Availability Zone,
                Amazon EC2 launches the largest possible number of instances above
                ``MinCount``.
            MinCount: The minimum number of instances to launch. If you specify a
                minimum that is more instances than Amazon EC2 can launch in the target
                Availability Zone, Amazon EC2 launches no instances.

        Keyword Args:
            DisableApiTermination: If you set this parameter to ``true``, you can't
                terminate the instance using the Amazon EC2 console, CLI, or API;
                otherwise, you can. To change this attribute after launch, use
                `ModifyInstanceAttribute <https://docs.aws.amazon.c
                om/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html>`_.
                Alternatively, if you set ``InstanceInitiatedShutdownBehavior`` to
                ``terminate``, you can terminate the instance by running the shutdown
                command from the instance.
            DisableApiStop: Indicates whether an instance is enabled for stop
                protection. For more information, see `Stop protection
                <https://docs.aws.amazon.com/AWSEC2/latest/Us
                erGuide/Stop_Start.html#Using_StopProtection>`_.
            InstanceInitiatedShutdownBehavior: Indicates whether an instance stops or
                terminates when you initiate shutdown from the instance (using the
                operating system command for system shutdown).
            Ipv6AddressCount: The number of IPv6 addresses to associate with the
                primary network interface. Amazon EC2 chooses the IPv6 addresses from the
                range of your subnet. You cannot specify this option and the option to
                assign specific IPv6 addresses in the same request. You can specify this
                option if you've specified a minimum number of instances to launch.
            Ipv6Addresses: The IPv6 addresses from the range of the subnet to associate
                with the primary network interface. You cannot specify this option and the
                option to assign a number of IPv6 addresses in the same request. You cannot
                specify this option if you've specified a minimum number of instances to
                launch.
            SecurityGroupIds: The IDs of the security groups. You can create a security
                group using `CreateSe curityGroup
                <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateS
                ecurityGroup.html>`_.
            UserData: The user data script to make available to the instance. For more
                information, see `Run commands on your Linux instance at launch
                <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html>`_ and
                `Run commands on your Windows instance at launch
                <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-windows- user-
                data.html>`_. If you are using a command line tool, base64-encoding is
                performed for you, and you can load the text from a file. Otherwise, you
                must provide base64-encoded text. User data is limited to 16 KB.
            ElasticGpuSpecification: An elastic GPU to associate with the instance. An
                Elastic GPU is a GPU resource that you can attach to your Windows instance
                to accelerate the graphics performance of your applications. For more
                information, see `Amazon EC2 Elastic GPUs
                <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-
                graphics.html>`_ in the *Amazon EC2 User Guide*.
            ElasticInferenceAccelerators: An elastic inference accelerator to associate
                with the instance. Elastic inference accelerators are a resource you can
                attach to your Amazon EC2 instances to accelerate your Deep Learning (DL)
                inference workloads.
            LaunchTemplate: The launch template to use to launch the instances. Any
                parameters that you specify in RunInstances override the same parameters in
                the launch template. You can specify either the name or ID of a launch
                template, but not both.
            InstanceMarketOptions: The market (purchasing) option for the instances.
            CreditSpecification: The credit option for CPU usage of the burstable
                performance instance. Valid values are ``standard`` and ``unlimited``. To
                change this attribute after launch, use  `ModifyInstanceCreditSpecification
                <https://docs.aws.amazon.com/AW
                SEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html>`_. For
                more information, see `Burstable performance instances
                <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-
                performance-instances.html>`_ in the *Amazon EC2 User Guide*.
            LicenseSpecifications: The license configurations.
            EnablePrimaryIpv6: If you’re launching an instance into a dual-stack or
                IPv6-only subnet, you can enable assigning a primary IPv6 address. A
                primary IPv6 address is an IPv6 GUA address associated with an ENI that you
                have enabled to use a primary IPv6 address. Use this option if an instance
                relies on its IPv6 address not changing. When you launch the instance,
                Amazon Web Services will automatically assign an IPv6 address associated
                with the ENI attached to your instance to be the primary IPv6 address. Once
                you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it.
                When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6
                GUA will be made the primary IPv6 address until the instance is terminated
                or the network interface is detached. If you have multiple IPv6 addresses
                associated with an ENI attached to your instance and you enable a primary
                IPv6 address, the first IPv6 GUA address associated with the ENI becomes
                the primary IPv6 address.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            MaxCount=self.serialize(MaxCount),
            MinCount=self.serialize(MinCount),
            BlockDeviceMappings=data.get("BlockDeviceMappings"),
            ImageId=data.get("ImageId"),
            InstanceType=data.get("InstanceType"),
            Ipv6AddressCount=self.serialize(Ipv6AddressCount),
            Ipv6Addresses=self.serialize(Ipv6Addresses),
            KernelId=data.get("KernelId"),
            KeyName=data.get("KeyName"),
            Monitoring=data.get("Monitoring"),
            Placement=data.get("Placement"),
            RamdiskId=data.get("RamdiskId"),
            SecurityGroupIds=self.serialize(SecurityGroupIds),
            SubnetId=data.get("SubnetId"),
            UserData=self.serialize(UserData),
            ClientToken=data.get("ClientToken"),
            DisableApiTermination=self.serialize(DisableApiTermination),
            DryRun=data.get("DryRun"),
            EbsOptimized=data.get("EbsOptimized"),
            IamInstanceProfile=data.get("IamInstanceProfile"),
            InstanceInitiatedShutdownBehavior=self.serialize(
                InstanceInitiatedShutdownBehavior
            ),
            NetworkInterfaces=data.get("NetworkInterfaces"),
            PrivateIpAddress=data.get("PrivateIpAddress"),
            ElasticGpuSpecification=self.serialize(ElasticGpuSpecification),
            ElasticInferenceAccelerators=self.serialize(ElasticInferenceAccelerators),
            TagSpecifications=self.serialize(
                self.serialize(self.convert_tags(model.Tags, "instance"))
            ),
            LaunchTemplate=self.serialize(LaunchTemplate),
            InstanceMarketOptions=self.serialize(InstanceMarketOptions),
            CreditSpecification=self.serialize(CreditSpecification),
            CpuOptions=data.get("CpuOptions"),
            CapacityReservationSpecification=data.get(
                "CapacityReservationSpecification"
            ),
            HibernationOptions=data.get("HibernationOptions"),
            LicenseSpecifications=self.serialize(LicenseSpecifications),
            MetadataOptions=data.get("MetadataOptions"),
            EnclaveOptions=data.get("EnclaveOptions"),
            PrivateDnsNameOptions=data.get("PrivateDnsNameOptions"),
            MaintenanceOptions=data.get("MaintenanceOptions"),
            DisableApiStop=self.serialize(DisableApiStop),
            EnablePrimaryIpv6=self.serialize(EnablePrimaryIpv6),
        )
        _response = self.client.run_instances(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = Reservation(**_response)

        return cast("Instance", response.Instances[0])

    @ec2_instance_only
    def get(self, InstanceId: str, *, DryRun: bool = False) -> Optional["Reservation"]:
        """
        Describes the specified instances or all instances.

        Args:
            InstanceId: The IDs of the instance.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            InstanceIds=self.serialize([InstanceId]), DryRun=self.serialize(DryRun)
        )
        _response = self.client.describe_instances(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeInstancesResult(**_response)

        if response.Reservations:
            return response.Reservations[0]
        return None

    @ec2_instances_only
    def list(
        self,
        *,
        Filters: Optional[List[Filter]] = None,
        InstanceIds: Optional[List[str]] = None,
        DryRun: bool = False
    ) -> List["Reservation"]:
        """
        Describes the specified instances or all instances.

        Keyword Args:
            Filters: The filters.
            InstanceIds: The instance IDs.
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        paginator = self.client.get_paginator("describe_instances")
        args: Dict[str, Any] = dict(
            Filters=self.serialize(Filters),
            InstanceIds=self.serialize(InstanceIds),
            DryRun=self.serialize(DryRun),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["Reservation"] = []
        for _response in response_iterator:
            response = DescribeInstancesResult(**_response)
            if response.Reservations:
                results.extend(response.Reservations)
            else:
                break
        return results


class LaunchTemplateManager(EC2TagsManagerMixin, Boto3ModelManager):
    service_name: str = "ec2"

    def create(
        self,
        model: "LaunchTemplate",
        LaunchTemplateData: "RequestLaunchTemplateData",
        ClientToken: Optional[str] = None,
        VersionDescription: Optional[str] = None,
    ) -> "LaunchTemplate":
        """
        Creates a launch template.

        Args:
            model: The :py:class:`LaunchTemplate` to create.
            LaunchTemplateData: The information for the launch template.

        Keyword Args:
            ClientToken: Unique, case-sensitive identifier you provide to ensure the
                idempotency of the request. For more information, see `Ensuring idempotency
                <https://docs.aws.amaz
                on.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html>`_.
            VersionDescription: A description for the first version of the launch
                template.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            LaunchTemplateName=data.get("LaunchTemplateName"),
            LaunchTemplateData=self.serialize(LaunchTemplateData),
            DryRun=data.get("DryRun"),
            ClientToken=self.serialize(ClientToken),
            VersionDescription=self.serialize(VersionDescription),
            TagSpecifications=self.serialize(
                self.serialize(self.convert_tags(model.Tags, "launch-template"))
            ),
        )
        _response = self.client.create_launch_template(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateLaunchTemplateResult(**_response)

        return cast("LaunchTemplate", response.LaunchTemplate)

    def delete(
        self,
        LaunchTemplateId: str,
        *,
        DryRun: bool = False,
        LaunchTemplateName: Optional[str] = None
    ) -> "LaunchTemplate":
        """
        Deletes a launch template. Deleting a launch template deletes all of
        its versions.

        Args:
            LaunchTemplateId: The ID of the launch template.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
            LaunchTemplateName: The name of the launch template.
        """
        args: Dict[str, Any] = dict(
            DryRun=self.serialize(DryRun),
            LaunchTemplateId=self.serialize(LaunchTemplateId),
            LaunchTemplateName=self.serialize(LaunchTemplateName),
        )
        _response = self.client.delete_launch_template(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DeleteLaunchTemplateResult(**_response)
        return cast(LaunchTemplate, response.LaunchTemplate)

    def get(
        self, LaunchTemplateId: str, *, DryRun: bool = False
    ) -> Optional["LaunchTemplate"]:
        """
        Describes one or more launch templates.

        Args:
            LaunchTemplateId: The ID of the launch template.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            DryRun=self.serialize(DryRun),
            LaunchTemplateIds=self.serialize([LaunchTemplateId]),
        )
        _response = self.client.describe_launch_templates(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeLaunchTemplatesResult(**_response)

        if response.LaunchTemplates:
            return response.LaunchTemplates[0]
        return None

    def list(
        self,
        *,
        DryRun: bool = False,
        LaunchTemplateIds: Optional[List[str]] = None,
        LaunchTemplateNames: Optional[List[str]] = None,
        Filters: Optional[List[Filter]] = None
    ) -> List["LaunchTemplate"]:
        """
        Describes one or more launch templates.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
            LaunchTemplateIds: One or more launch template IDs.
            LaunchTemplateNames: One or more launch template names.
            Filters: One or more filters.
        """
        paginator = self.client.get_paginator("describe_launch_templates")
        args: Dict[str, Any] = dict(
            DryRun=self.serialize(DryRun),
            LaunchTemplateIds=self.serialize(LaunchTemplateIds),
            LaunchTemplateNames=self.serialize(LaunchTemplateNames),
            Filters=self.serialize(Filters),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["LaunchTemplate"] = []
        for _response in response_iterator:
            response = DescribeLaunchTemplatesResult(**_response)
            if response.LaunchTemplates:
                results.extend(response.LaunchTemplates)
            else:
                break
        return results


class LaunchTemplateVersionManager(Boto3ModelManager):
    service_name: str = "ec2"

    def create(
        self,
        model: "LaunchTemplateVersion",
        ClientToken: Optional[str] = None,
        SourceVersion: Optional[str] = None,
        ResolveAlias: Optional[bool] = None,
    ) -> "LaunchTemplateVersion":
        """
        Creates a new version of a launch template. You can specify an existing
        version of launch template from which to base the new version.

        Args:
            model: The :py:class:`LaunchTemplateVersion` to create.

        Keyword Args:
            ClientToken: Unique, case-sensitive identifier you provide to ensure the
                idempotency of the request. For more information, see `Ensuring idempotency
                <https://docs.aws.amaz
                on.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html>`_.
            SourceVersion: The version number of the launch template version on which
                to base the new version. The new version inherits the same launch
                parameters as the source version, except for parameters that you specify in
                ``LaunchTemplateData``. Snapshots applied to the block device mapping are
                ignored when creating a new version unless they are explicitly included.
            ResolveAlias: If ``true``, and if a Systems Manager parameter is specified
                for ``ImageId``, the AMI ID is displayed in the response for ``imageID``.
                For more information, see `Use a Systems Manager parameter instead of an
                AMI ID <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-
                templates.html#use-an-ssm-parameter-instead-of-an-ami-id>`_ in the *Amazon
                Elastic Compute Cloud User Guide*.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            LaunchTemplateData=data.get("LaunchTemplateData"),
            DryRun=data.get("DryRun"),
            ClientToken=self.serialize(ClientToken),
            LaunchTemplateId=data.get("LaunchTemplateId"),
            LaunchTemplateName=data.get("LaunchTemplateName"),
            SourceVersion=self.serialize(SourceVersion),
            VersionDescription=data.get("VersionDescription"),
            ResolveAlias=self.serialize(ResolveAlias),
        )
        _response = self.client.create_launch_template_version(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateLaunchTemplateVersionResult(**_response)

        return cast("LaunchTemplateVersion", response.LaunchTemplateVersion)

    def delete(
        self, LaunchTemplateId: str, Version: str, *, DryRun: bool = False
    ) -> None:
        """
        Deletes one or more versions of a launch template.

        Args:
            LaunchTemplateId: The ID of the launch template.
            Version: The version number of the launch template version to delete.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
        """
        args: Dict[str, Any] = dict(
            Versions=self.serialize([Version]),
            DryRun=self.serialize(DryRun),
            LaunchTemplateId=self.serialize(LaunchTemplateId),
        )
        self.client.delete_launch_template_versions(
            **{k: v for k, v in args.items() if v is not None}
        )

    def get(
        self,
        LaunchTemplateId: str,
        Version: str,
        *,
        DryRun: bool = False,
        MinVersion: Optional[str] = None,
        MaxVersion: Optional[str] = None,
        Filters: Optional[List[Filter]] = None,
        ResolveAlias: Optional[bool] = None
    ) -> Optional["LaunchTemplateVersion"]:
        """
        Describes one or more versions of a specified launch template. You can
        describe all versions, individual versions, or a range of versions. You
        can also describe all the latest versions or all the default versions
        of all the launch templates in your account.

        Args:
            LaunchTemplateId: The ID of the launch template.
            Version: The version number of the launch template version.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
            MinVersion: The version number after which to describe launch template
                versions.
            MaxVersion: The version number up to which to describe launch template
                versions.
            Filters: One or more filters.
            ResolveAlias: If ``true``, and if a Systems Manager parameter is specified
                for ``ImageId``, the AMI ID is displayed in the response for ``imageId``.
        """
        args: Dict[str, Any] = dict(
            DryRun=self.serialize(DryRun),
            LaunchTemplateId=self.serialize(LaunchTemplateId),
            Versions=self.serialize([Version]),
            MinVersion=self.serialize(MinVersion),
            MaxVersion=self.serialize(MaxVersion),
            Filters=self.serialize(Filters),
            ResolveAlias=self.serialize(ResolveAlias),
        )
        _response = self.client.describe_launch_template_versions(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeLaunchTemplateVersionsResult(**_response)

        if response.LaunchTemplateVersions:
            return response.LaunchTemplateVersions[0]
        return None

    def list(
        self,
        *,
        DryRun: bool = False,
        LaunchTemplateId: Optional[str] = None,
        LaunchTemplateName: Optional[str] = None,
        Versions: Optional[List[str]] = None,
        MinVersion: Optional[str] = None,
        MaxVersion: Optional[str] = None,
        Filters: Optional[List[Filter]] = None,
        ResolveAlias: Optional[bool] = None
    ) -> List["LaunchTemplateVersion"]:
        """
        Describes one or more versions of a specified launch template. You can
        describe all versions, individual versions, or a range of versions. You
        can also describe all the latest versions or all the default versions
        of all the launch templates in your account.

        Keyword Args:
            DryRun: Checks whether you have the required permissions for the action,
                without actually making the request, and provides an error response. If you
                have the required permissions, the error response is ``DryRunOperation``.
                Otherwise, it is ``UnauthorizedOperation``.
            LaunchTemplateId: The ID of the launch template.
            LaunchTemplateName: The name of the launch template.
            Versions: One or more versions of the launch template. Valid values depend
                on whether you are describing a specified launch template (by ID or name)
                or all launch templates in your account.
            MinVersion: The version number after which to describe launch template
                versions.
            MaxVersion: The version number up to which to describe launch template
                versions.
            Filters: One or more filters.
            ResolveAlias: If ``true``, and if a Systems Manager parameter is specified
                for ``ImageId``, the AMI ID is displayed in the response for ``imageId``.
        """
        paginator = self.client.get_paginator("describe_launch_template_versions")
        args: Dict[str, Any] = dict(
            DryRun=self.serialize(DryRun),
            LaunchTemplateId=self.serialize(LaunchTemplateId),
            LaunchTemplateName=self.serialize(LaunchTemplateName),
            Versions=self.serialize(Versions),
            MinVersion=self.serialize(MinVersion),
            MaxVersion=self.serialize(MaxVersion),
            Filters=self.serialize(Filters),
            ResolveAlias=self.serialize(ResolveAlias),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["LaunchTemplateVersion"] = []
        for _response in response_iterator:
            response = DescribeLaunchTemplateVersionsResult(**_response)
            if response.LaunchTemplateVersions:
                results.extend(response.LaunchTemplateVersions)
            else:
                break
        return results


# ==============
# Service Models
# ==============


class VpcCidrBlockState(Boto3Model):
    """
    Information about the state of the CIDR block.
    """

    #: The state of the CIDR block.
    State: Optional[
        Literal[
            "associating",
            "associated",
            "disassociating",
            "disassociated",
            "failing",
            "failed",
        ]
    ] = None
    #: A message about the status of the CIDR block, if applicable.
    StatusMessage: Optional[str] = None


class VpcIpv6CidrBlockAssociation(Boto3Model):
    """
    Describes an IPv6 CIDR block associated with a VPC.
    """

    #: The association ID for the IPv6 CIDR block.
    AssociationId: Optional[str] = None
    #: The IPv6 CIDR block.
    Ipv6CidrBlock: Optional[str] = None
    #: Information about the state of the CIDR block.
    Ipv6CidrBlockState: Optional[VpcCidrBlockState] = None
    #: The name of the unique set of Availability Zones, Local Zones, or Wavelength
    #: Zones from which Amazon Web Services advertises IP addresses, for example,
    #: ``us-east-1-wl1-bos-wlz-1``.
    NetworkBorderGroup: Optional[str] = None
    #: The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.
    Ipv6Pool: Optional[str] = None


class VpcCidrBlockAssociation(Boto3Model):
    """
    Describes an IPv4 CIDR block associated with a VPC.
    """

    #: The association ID for the IPv4 CIDR block.
    AssociationId: Optional[str] = None
    #: The IPv4 CIDR block.
    CidrBlock: Optional[str] = None
    #: Information about the state of the CIDR block.
    CidrBlockState: Optional[VpcCidrBlockState] = None


class Vpc(TagsDictMixin, PrimaryBoto3Model):
    """
    Describes a VPC.
    """

    tag_class: ClassVar[Type] = Tag
    objects: ClassVar[Boto3ModelManager] = VpcManager()

    #: The primary IPv4 CIDR block for the VPC.
    CidrBlock: str
    #: Any tags assigned to the VPC.
    Tags: Optional[List[Tag]] = None
    #: The ID of the set of DHCP options you've associated with the VPC.
    DhcpOptionsId: str = Field(default=None, frozen=True)
    #: The current state of the VPC.
    State: Literal["pending", "available"] = Field(default=None, frozen=True)
    #: The ID of the VPC.
    VpcId: str = Field(default=None, frozen=True)
    #: The ID of the Amazon Web Services account that owns the VPC.
    OwnerId: str = Field(default=None, frozen=True)
    #: The allowed tenancy of instances launched into the VPC.
    InstanceTenancy: Optional[Literal["default", "dedicated", "host"]] = None
    #: Information about the IPv6 CIDR blocks associated with the VPC.
    Ipv6CidrBlockAssociationSet: List["VpcIpv6CidrBlockAssociation"] = Field(
        default=None, frozen=True
    )
    #: Information about the IPv4 CIDR blocks associated with the VPC.
    CidrBlockAssociationSet: List["VpcCidrBlockAssociation"] = Field(
        default=None, frozen=True
    )
    #: Indicates whether the VPC is the default VPC.
    IsDefault: bool = Field(default=None, frozen=True)

    @property
    def pk(self) -> Optional[str]:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`VpcId` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.VpcId

    @property
    def name(self) -> Optional[str]:
        """
        Return the name of the model.   This is the value of the
        :py:attr:`VpcId` attribute.

        Returns:
            The name of the model instance.
        """
        return self.VpcId


class SubnetCidrBlockState(Boto3Model):
    """
    The state of the CIDR block.
    """

    #: The state of a CIDR block.
    State: Optional[
        Literal[
            "associating",
            "associated",
            "disassociating",
            "disassociated",
            "failing",
            "failed",
        ]
    ] = None
    #: A message about the status of the CIDR block, if applicable.
    StatusMessage: Optional[str] = None


class SubnetIpv6CidrBlockAssociation(Boto3Model):
    """
    Describes an association between a subnet and an IPv6 CIDR block.
    """

    #: The ID of the association.
    AssociationId: Optional[str] = None
    #: The IPv6 CIDR block.
    Ipv6CidrBlock: Optional[str] = None
    #: The state of the CIDR block.
    Ipv6CidrBlockState: Optional[SubnetCidrBlockState] = None


class EC2PrivateDnsNameOptionsOnLaunch(Boto3Model):
    """
    The type of hostnames to assign to instances in the subnet at launch.

    An instance hostname is based on the IPv4 address or ID of the instance.
    """

    #: The type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS
    #: name must be based on the instance IPv4 address. For IPv6 only subnets, an
    #: instance DNS name must be based on the instance ID. For dual-stack subnets, you
    #: can specify whether DNS names use the instance IPv4 address or the instance ID.
    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS A
    #: records.
    EnableResourceNameDnsARecord: Optional[bool] = None
    #: Indicates whether to respond to DNS queries for instance hostname with DNS AAAA
    #: records.
    EnableResourceNameDnsAAAARecord: Optional[bool] = None


class Subnet(TagsDictMixin, PrimaryBoto3Model):
    """
    Describes a subnet.
    """

    tag_class: ClassVar[Type] = Tag
    objects: ClassVar[Boto3ModelManager] = SubnetManager()

    #: The ID of the VPC the subnet is in.
    VpcId: str
    #: The Availability Zone of the subnet.
    AvailabilityZone: str
    #: The IPv4 CIDR block assigned to the subnet.
    CidrBlock: str
    #: Indicates whether this is an IPv6 only subnet.
    Ipv6Native: Optional[bool] = False
    #: Any tags assigned to the subnet.
    Tags: Optional[List[Tag]] = None
    #: The AZ ID of the subnet.
    AvailabilityZoneId: Optional[str] = None
    #: The number of unused private IPv4 addresses in the subnet. The IPv4 addresses
    #: for any stopped instances are considered unavailable.
    AvailableIpAddressCount: int = Field(default=None, frozen=True)
    #: Indicates whether this is the default subnet for the Availability Zone.
    DefaultForAz: bool = Field(default=None, frozen=True)
    #: Indicates the device position for local network interfaces in this subnet. For
    #: example, ``1`` indicates local network interfaces in this subnet are the
    #: secondary network interface (eth1).
    EnableLniAtDeviceIndex: int = Field(default=None, frozen=True)
    #: Indicates whether instances launched in this subnet receive a public IPv4
    #: address.
    MapPublicIpOnLaunch: bool = Field(default=None, frozen=True)
    #: Indicates whether a network interface created in this subnet (including a
    #: network interface created by RunInstances) receives a customer-owned IPv4
    #: address.
    MapCustomerOwnedIpOnLaunch: bool = Field(default=None, frozen=True)
    #: The customer-owned IPv4 address pool associated with the subnet.
    CustomerOwnedIpv4Pool: str = Field(default=None, frozen=True)
    #: The current state of the subnet.
    State: Literal["pending", "available"] = Field(default=None, frozen=True)
    #: The ID of the subnet.
    SubnetId: str = Field(default=None, frozen=True)
    #: The ID of the Amazon Web Services account that owns the subnet.
    OwnerId: str = Field(default=None, frozen=True)
    #: Indicates whether a network interface created in this subnet (including a
    #: network interface created by RunInstances) receives an IPv6 address.
    AssignIpv6AddressOnCreation: bool = Field(default=None, frozen=True)
    #: Information about the IPv6 CIDR blocks associated with the subnet.
    Ipv6CidrBlockAssociationSet: List["SubnetIpv6CidrBlockAssociation"] = Field(
        default=None, frozen=True
    )
    #: The Amazon Resource Name (ARN) of the subnet.
    SubnetArn: str = Field(default=None, frozen=True)
    #: The Amazon Resource Name (ARN) of the Outpost.
    OutpostArn: Optional[str] = None
    #: Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this
    #: subnet should return synthetic IPv6 addresses for IPv4-only destinations.
    EnableDns64: bool = Field(default=None, frozen=True)
    #: The type of hostnames to assign to instances in the subnet at launch. An
    #: instance hostname is based on the IPv4 address or ID of the instance.
    PrivateDnsNameOptionsOnLaunch: EC2PrivateDnsNameOptionsOnLaunch = Field(
        default=None, frozen=True
    )

    @property
    def pk(self) -> Optional[str]:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`SubnetId` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.SubnetId

    @property
    def arn(self) -> Optional[str]:
        """
        Return the ARN of the model.   This is the value of the
        :py:attr:`SubnetArn` attribute.

        Returns:
            The ARN of the model instance.
        """
        return self.SubnetArn

    @property
    def name(self) -> Optional[str]:
        """
        Return the name of the model.   This is the value of the
        :py:attr:`SubnetId` attribute.

        Returns:
            The name of the model instance.
        """
        return self.SubnetId


class IpRange(Boto3Model):
    """
    Describes an IPv4 range.
    """

    #: The IPv4 CIDR range. You can either specify a CIDR range or a source security
    #: group, not both. To specify a single IPv4 address, use the /32 prefix length.
    CidrIp: Optional[str] = None
    #: A description for the security group rule that references this IPv4 address
    #: range.
    Description: Optional[str] = None


class Ipv6Range(Boto3Model):
    """
    Describes an IPv6 range.
    """

    #: The IPv6 CIDR range. You can either specify a CIDR range or a source security
    #: group, not both. To specify a single IPv6 address, use the /128 prefix length.
    CidrIpv6: Optional[str] = None
    #: A description for the security group rule that references this IPv6 address
    #: range.
    Description: Optional[str] = None


class PrefixListId(Boto3Model):
    """
    Describes a prefix list ID.
    """

    #: A description for the security group rule that references this prefix list ID.
    Description: Optional[str] = None
    #: The ID of the prefix.
    PrefixListId: Optional[str] = None


class UserIdGroupPair(Boto3Model):
    """
    Describes a security group and Amazon Web Services account ID pair.
    """

    #: A description for the security group rule that references this user ID group
    #: pair.
    Description: Optional[str] = None
    #: The ID of the security group.
    GroupId: Optional[str] = None
    #: [Default VPC] The name of the security group. For a security group in a
    #: nondefault VPC, use the security group ID.
    GroupName: Optional[str] = None
    #: The status of a VPC peering connection, if applicable.
    PeeringStatus: Optional[str] = None
    #: The ID of an Amazon Web Services account.
    UserId: Optional[str] = None
    #: The ID of the VPC for the referenced security group, if applicable.
    VpcId: Optional[str] = None
    #: The ID of the VPC peering connection, if applicable.
    VpcPeeringConnectionId: Optional[str] = None


class IpPermission(Boto3Model):
    """
    Describes a set of permissions for a security group rule.
    """

    #: If the protocol is TCP or UDP, this is the start of the port range. If the
    #: protocol is ICMP or ICMPv6, this is the type number. A value of -1 indicates
    #: all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify
    #: all ICMP/ICMPv6 codes.
    FromPort: Optional[int] = None
    #: The IP protocol name (``tcp``, ``udp``, ``icmp``, ``icmpv6``) or number (see
    #: `Protocol Numbers <http://www.iana.org/assignments/protocol-numbers/protocol-
    #: numbers.xhtml>`_).
    IpProtocol: Optional[str] = None
    #: The IPv4 ranges.
    IpRanges: Optional[List["IpRange"]] = None
    #: The IPv6 ranges.
    Ipv6Ranges: Optional[List["Ipv6Range"]] = None
    #: The prefix list IDs.
    PrefixListIds: Optional[List["PrefixListId"]] = None
    #: If the protocol is TCP or UDP, this is the end of the port range. If the
    #: protocol is ICMP or ICMPv6, this is the code. A value of -1 indicates all
    #: ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all
    #: ICMP/ICMPv6 codes.
    ToPort: Optional[int] = None
    #: The security group and Amazon Web Services account ID pairs.
    UserIdGroupPairs: Optional[List["UserIdGroupPair"]] = None


class SecurityGroup(TagsDictMixin, SecurityGroupModelMixin, PrimaryBoto3Model):
    """
    Describes a security group.
    """

    tag_class: ClassVar[Type] = Tag
    objects: ClassVar[Boto3ModelManager] = SecurityGroupManager()

    #: The ID of the VPC for the security group.
    VpcId: str
    #: The name of the security group.
    GroupName: str
    #: A description of the security group.
    Description: str
    #: The inbound rules associated with the security group.
    IpPermissions: Optional[List["IpPermission"]] = None
    #: The outbound rules associated with the security group.
    IpPermissionsEgress: Optional[List["IpPermission"]] = None
    #: Any tags assigned to the security group.
    Tags: Optional[List[Tag]] = None
    #: The Amazon Web Services account ID of the owner of the security group.
    OwnerId: str = Field(default=None, frozen=True)
    #: The ID of the security group.
    GroupId: str = Field(default=None, frozen=True)

    @property
    def pk(self) -> Optional[str]:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`GroupId` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.GroupId

    @property
    def name(self) -> Optional[str]:
        """
        Return the name of the model.   This is the value of the
        :py:attr:`GroupName` attribute.

        Returns:
            The name of the model instance.
        """
        return self.GroupName


class NetworkAclAssociation(Boto3Model):
    """
    Describes an association between a network ACL and a subnet.
    """

    #: The ID of the association between a network ACL and a subnet.
    NetworkAclAssociationId: Optional[str] = None
    #: The ID of the network ACL.
    NetworkAclId: Optional[str] = None
    #: The ID of the subnet.
    SubnetId: Optional[str] = None


class EC2IcmpTypeCode(Boto3Model):
    """ICMP protocol: The ICMP type and code."""

    #: The ICMP code. A value of -1 means all codes for the specified ICMP type.
    Code: Optional[int] = None
    #: The ICMP type. A value of -1 means all types.
    Type: Optional[int] = None


class NetworkAclPortRange(Boto3Model):
    """TCP or UDP protocols: The range of ports the rule applies to."""

    #: The first port in the range.
    From: Optional[int] = None
    #: The last port in the range.
    To: Optional[int] = None


class NetworkAclEntry(Boto3Model):
    """
    Describes an entry in a network ACL.
    """

    #: The IPv4 network range to allow or deny, in CIDR notation.
    CidrBlock: Optional[str] = None
    #: Indicates whether the rule is an egress rule (applied to traffic leaving the
    #: subnet).
    Egress: Optional[bool] = None
    #: ICMP protocol: The ICMP type and code.
    IcmpTypeCode: Optional[EC2IcmpTypeCode] = None
    #: The IPv6 network range to allow or deny, in CIDR notation.
    Ipv6CidrBlock: Optional[str] = None
    #: TCP or UDP protocols: The range of ports the rule applies to.
    PortRange: Optional[NetworkAclPortRange] = None
    #: The protocol number. A value of "-1" means all protocols.
    Protocol: Optional[str] = None
    #: Indicates whether to allow or deny the traffic that matches the rule.
    RuleAction: Optional[Literal["allow", "deny"]] = None
    #: The rule number for the entry. ACL entries are processed in ascending order by
    #: rule number.
    RuleNumber: Optional[int] = None


class NetworkAcl(TagsDictMixin, PrimaryBoto3Model):
    """
    Describes a network ACL.
    """

    tag_class: ClassVar[Type] = Tag
    objects: ClassVar[Boto3ModelManager] = NetworkAclManager()

    #: Any associations between the network ACL and one or more subnets
    Associations: List["NetworkAclAssociation"] = Field(default=None, frozen=True)
    #: The entries (rules) in the network ACL.
    Entries: List["NetworkAclEntry"] = Field(default=None, frozen=True)
    #: Indicates whether this is the default network ACL for the VPC.
    IsDefault: bool = Field(default=None, frozen=True)
    #: The ID of the network ACL.
    NetworkAclId: str = Field(default=None, frozen=True)
    #: Any tags assigned to the network ACL.
    Tags: List[Tag] = Field(default=None, frozen=True)
    #: The ID of the VPC for the network ACL.
    VpcId: Optional[str] = None
    #: The ID of the Amazon Web Services account that owns the network ACL.
    OwnerId: str = Field(default=None, frozen=True)

    @property
    def pk(self) -> Optional[str]:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`NetworkAclId` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.NetworkAclId

    @property
    def name(self) -> Optional[str]:
        """
        Return the name of the model.   This is the value of the
        :py:attr:`NetworkAclId` attribute.

        Returns:
            The name of the model instance.
        """
        return self.NetworkAclId


class EC2DetailedMonitoring(Boto3Model):
    """
    The monitoring for the instance.
    """

    #: Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring
    #: is enabled.
    State: Optional[Literal["disabled", "disabling", "enabled", "pending"]] = None


class EC2Placement(Boto3Model):
    """
    The location where the instance launched, if applicable.
    """

    #: The Availability Zone of the instance.
    AvailabilityZone: Optional[str] = None
    #: The affinity setting for the instance on the Dedicated Host.
    Affinity: Optional[str] = None
    #: The name of the placement group that the instance is in. If you specify
    #: ``GroupName``, you can't specify ``GroupId``.
    GroupName: Optional[str] = None
    #: The number of the partition that the instance is in. Valid only if the
    #: placement group strategy is set to ``partition``.
    PartitionNumber: Optional[int] = None
    #: The ID of the Dedicated Host on which the instance resides.
    HostId: Optional[str] = None
    #: The tenancy of the instance. An instance with a tenancy of ``dedicated`` runs
    #: on single-tenant hardware.
    Tenancy: Optional[Literal["default", "dedicated", "host"]] = None
    #: Reserved for future use.
    SpreadDomain: Optional[str] = None
    #: The ARN of the host resource group in which to launch the instances.
    HostResourceGroupArn: Optional[str] = None
    #: The ID of the placement group that the instance is in. If you specify
    #: ``GroupId``, you can't specify ``GroupName``.
    GroupId: Optional[str] = None


class ProductCode(Boto3Model):
    """
    Describes a product code.
    """

    #: The product code.
    ProductCodeId: Optional[str] = None
    #: The type of product code.
    ProductCodeType: Optional[Literal["devpay", "marketplace"]] = None


class InstanceState(Boto3Model):
    """
    The current state of the instance.
    """

    #: The state of the instance as a 16-bit unsigned integer.
    Code: Optional[int] = None
    #: The current state of the instance.
    Name: Optional[
        Literal[
            "pending", "running", "shutting-down", "terminated", "stopping", "stopped"
        ]
    ] = None


class EbsInstanceBlockDevice(Boto3Model):
    """
    Parameters used to automatically set up EBS volumes when the instance is
    launched.
    """

    #: The time stamp when the attachment initiated.
    AttachTime: Optional[datetime] = None
    #: Indicates whether the volume is deleted on instance termination.
    DeleteOnTermination: Optional[bool] = None
    #: The attachment state.
    Status: Optional[Literal["attaching", "attached", "detaching", "detached"]] = None
    #: The ID of the EBS volume.
    VolumeId: Optional[str] = None


class InstanceBlockDeviceMapping(Boto3Model):
    """
    Describes a block device mapping.
    """

    #: The device name (for example, ``/dev/sdh`` or ``xvdh``).
    DeviceName: Optional[str] = None
    #: Parameters used to automatically set up EBS volumes when the instance is
    #: launched.
    Ebs: Optional[EbsInstanceBlockDevice] = None


class EC2IamInstanceProfile(Boto3Model):
    """
    The IAM instance profile associated with the instance, if applicable.
    """

    #: The Amazon Resource Name (ARN) of the instance profile.
    Arn: Optional[str] = None
    #: The ID of the instance profile.
    Id: Optional[str] = None


class ElasticGpuAssociation(Boto3Model):
    """
    Describes the association between an instance and an Elastic Graphics
    accelerator.
    """

    #: The ID of the Elastic Graphics accelerator.
    ElasticGpuId: Optional[str] = None
    #: The ID of the association.
    ElasticGpuAssociationId: Optional[str] = None
    #: The state of the association between the instance and the Elastic Graphics
    #: accelerator.
    ElasticGpuAssociationState: Optional[str] = None
    #: The time the Elastic Graphics accelerator was associated with the instance.
    ElasticGpuAssociationTime: Optional[str] = None


class ElasticInferenceAcceleratorAssociation(Boto3Model):
    """
    Describes the association between an instance and an elastic inference
    accelerator.
    """

    #: The Amazon Resource Name (ARN) of the elastic inference accelerator.
    ElasticInferenceAcceleratorArn: Optional[str] = None
    #: The ID of the association.
    ElasticInferenceAcceleratorAssociationId: Optional[str] = None
    #: The state of the elastic inference accelerator.
    ElasticInferenceAcceleratorAssociationState: Optional[str] = None
    #: The time at which the elastic inference accelerator is associated with an
    #: instance.
    ElasticInferenceAcceleratorAssociationTime: Optional[datetime] = None


class InstanceNetworkInterfaceAssociation(Boto3Model):
    """
    The association information for an Elastic IPv4 associated with the network
    interface.
    """

    #: The carrier IP address associated with the network interface.
    CarrierIp: Optional[str] = None
    #: The customer-owned IP address associated with the network interface.
    CustomerOwnedIp: Optional[str] = None
    #: The ID of the owner of the Elastic IP address.
    IpOwnerId: Optional[str] = None
    #: The public DNS name.
    PublicDnsName: Optional[str] = None
    #: The public IP address or Elastic IP address bound to the network interface.
    PublicIp: Optional[str] = None


class InstanceAttachmentEnaSrdUdpSpecification(Boto3Model):
    """
    Configures ENA Express for UDP network traffic.
    """

    #: Indicates whether UDP traffic to and from the instance uses ENA Express. To
    #: specify this setting, you must first enable ENA Express.
    EnaSrdUdpEnabled: Optional[bool] = None


class InstanceAttachmentEnaSrdSpecification(Boto3Model):
    """
    Contains the ENA Express settings for the network interface that's attached
    to the instance.
    """

    #: Indicates whether ENA Express is enabled for the network interface.
    EnaSrdEnabled: Optional[bool] = None
    #: Configures ENA Express for UDP network traffic.
    EnaSrdUdpSpecification: Optional[InstanceAttachmentEnaSrdUdpSpecification] = None


class InstanceNetworkInterfaceAttachment(Boto3Model):
    """
    The network interface attachment.
    """

    #: The time stamp when the attachment initiated.
    AttachTime: Optional[datetime] = None
    #: The ID of the network interface attachment.
    AttachmentId: Optional[str] = None
    #: Indicates whether the network interface is deleted when the instance is
    #: terminated.
    DeleteOnTermination: Optional[bool] = None
    #: The index of the device on the instance for the network interface attachment.
    DeviceIndex: Optional[int] = None
    #: The attachment state.
    Status: Optional[Literal["attaching", "attached", "detaching", "detached"]] = None
    #: The index of the network card.
    NetworkCardIndex: Optional[int] = None
    #: Contains the ENA Express settings for the network interface that's attached to
    #: the instance.
    EnaSrdSpecification: Optional[InstanceAttachmentEnaSrdSpecification] = None


class GroupIdentifier(Boto3Model):
    """
    Describes a security group.
    """

    #: The name of the security group.
    GroupName: Optional[str] = None
    #: The ID of the security group.
    GroupId: Optional[str] = None


class InstanceIpv6Address(Boto3Model):
    """
    Describes an IPv6 address.
    """

    #: The IPv6 address.
    Ipv6Address: Optional[str] = None
    #: Determines if an IPv6 address associated with a network interface is the
    #: primary IPv6 address. When you enable an IPv6 GUA address to be a primary IPv6,
    #: the first IPv6 GUA will be made the primary IPv6 address until the instance is
    #: terminated or the network interface is detached. For more information, see `Run
    #: Instances <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstan
    #: ces.html>`_.
    IsPrimaryIpv6: Optional[bool] = None


class InstancePrivateIpAddress(Boto3Model):
    """
    Describes a private IPv4 address.
    """

    #: The association information for an Elastic IP address for the network
    #: interface.
    Association: Optional[InstanceNetworkInterfaceAssociation] = None
    #: Indicates whether this IPv4 address is the primary private IP address of the
    #: network interface.
    Primary: Optional[bool] = None
    #: The private IPv4 DNS name.
    PrivateDnsName: Optional[str] = None
    #: The private IPv4 address of the network interface.
    PrivateIpAddress: Optional[str] = None


class InstanceIpv4Prefix(Boto3Model):
    """
    Information about an IPv4 prefix.
    """

    #: One or more IPv4 prefixes assigned to the network interface.
    Ipv4Prefix: Optional[str] = None


class InstanceIpv6Prefix(Boto3Model):
    """
    Information about an IPv6 prefix.
    """

    #: One or more IPv6 prefixes assigned to the network interface.
    Ipv6Prefix: Optional[str] = None


class ConnectionTrackingSpecificationResponse(Boto3Model):
    """
    A security group connection tracking configuration that enables you to set
    the timeout for connection tracking on an Elastic network interface.

    For more
    information, see `Connection tracking
    timeouts <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon Elastic
    Compute Cloud User Guide*.
    """

    #: Timeout (in seconds) for idle TCP connections in an established state. Min: 60
    #: seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended:
    #: Less than 432000 seconds.
    TcpEstablishedTimeout: Optional[int] = None
    #: Timeout (in seconds) for idle UDP flows classified as streams which have seen
    #: more than one request-response transaction. Min: 60 seconds. Max: 180 seconds
    #: (3 minutes). Default: 180 seconds.
    UdpStreamTimeout: Optional[int] = None
    #: Timeout (in seconds) for idle UDP flows that have seen traffic only in a single
    #: direction or a single request-response transaction. Min: 30 seconds. Max: 60
    #: seconds. Default: 30 seconds.
    UdpTimeout: Optional[int] = None


class InstanceNetworkInterface(Boto3Model):
    """
    Describes a network interface.
    """

    #: The association information for an Elastic IPv4 associated with the network
    #: interface.
    Association: Optional[InstanceNetworkInterfaceAssociation] = None
    #: The network interface attachment.
    Attachment: Optional[InstanceNetworkInterfaceAttachment] = None
    #: The description.
    Description: Optional[str] = None
    #: The security groups.
    Groups: Optional[List["GroupIdentifier"]] = None
    #: The IPv6 addresses associated with the network interface.
    Ipv6Addresses: Optional[List["InstanceIpv6Address"]] = None
    #: The MAC address.
    MacAddress: Optional[str] = None
    #: The ID of the network interface.
    NetworkInterfaceId: Optional[str] = None
    #: The ID of the Amazon Web Services account that created the network interface.
    OwnerId: Optional[str] = None
    #: The private DNS name.
    PrivateDnsName: Optional[str] = None
    #: The IPv4 address of the network interface within the subnet.
    PrivateIpAddress: Optional[str] = None
    #: The private IPv4 addresses associated with the network interface.
    PrivateIpAddresses: Optional[List["InstancePrivateIpAddress"]] = None
    #: Indicates whether source/destination checking is enabled.
    SourceDestCheck: Optional[bool] = None
    #: The status of the network interface.
    Status: Optional[
        Literal["available", "associated", "attaching", "in-use", "detaching"]
    ] = None
    #: The ID of the subnet.
    SubnetId: Optional[str] = None
    #: The ID of the VPC.
    VpcId: Optional[str] = None
    #: The type of network interface.
    InterfaceType: Optional[str] = None
    #: The IPv4 delegated prefixes that are assigned to the network interface.
    Ipv4Prefixes: Optional[List["InstanceIpv4Prefix"]] = None
    #: The IPv6 delegated prefixes that are assigned to the network interface.
    Ipv6Prefixes: Optional[List["InstanceIpv6Prefix"]] = None
    #: A security group connection tracking configuration that enables you to set the
    #: timeout for connection tracking on an Elastic network interface. For more
    #: information, see `Connection tracking timeouts
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    #: connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon Elastic
    #: Compute Cloud User Guide*.
    ConnectionTrackingConfiguration: Optional[
        ConnectionTrackingSpecificationResponse
    ] = None


class EC2StateReason(Boto3Model):
    """
    The reason for the most recent state transition.
    """

    #: The reason code for the state change.
    Code: Optional[str] = None
    #: The message for the state change.
    Message: Optional[str] = None


class EC2CpuOptions(Boto3Model):
    """
    The CPU options for the instance.
    """

    #: The number of CPU cores for the instance.
    CoreCount: Optional[int] = None
    #: The number of threads per CPU core.
    ThreadsPerCore: Optional[int] = None
    #: Indicates whether the instance is enabled for AMD SEV-SNP. For more
    #: information, see `AMD SEV- SNP
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html>`_.
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = None


class CapacityReservationTargetResponse(Boto3Model):
    """
    Information about the targeted Capacity Reservation or Capacity Reservation
    group.
    """

    #: The ID of the targeted Capacity Reservation.
    CapacityReservationId: Optional[str] = None
    #: The ARN of the targeted Capacity Reservation group.
    CapacityReservationResourceGroupArn: Optional[str] = None


class CapacityReservationSpecificationResponse(Boto3Model):
    """
    Information about the Capacity Reservation targeting option.
    """

    #: Describes the instance's Capacity Reservation preferences. Possible preferences
    #: include:
    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    #: Information about the targeted Capacity Reservation or Capacity Reservation
    #: group.
    CapacityReservationTarget: Optional[CapacityReservationTargetResponse] = None


class EC2HibernationOptions(Boto3Model):
    """
    Indicates whether the instance is enabled for hibernation.
    """

    #: If ``true``, your instance is enabled for hibernation; otherwise, it is not
    #: enabled for hibernation.
    Configured: Optional[bool] = None


class LicenseConfiguration(Boto3Model):
    """
    Describes a license configuration.
    """

    #: The Amazon Resource Name (ARN) of the license configuration.
    LicenseConfigurationArn: Optional[str] = None


class InstanceMetadataOptionsResponse(Boto3Model):
    """
    The metadata options for the instance.
    """

    #: The state of the metadata option changes.
    State: Optional[Literal["pending", "applied"]] = None
    #: IMDSv2 uses token-backed sessions. Indicates whether the use of HTTP tokens is
    #: ``optional`` (in other words, indicates whether the use of IMDSv2 is
    #: ``optional``) or ``required`` (in other words, indicates whether the use of
    #: IMDSv2 is ``required``).
    HttpTokens: Optional[Literal["optional", "required"]] = None
    #: The desired HTTP PUT response hop limit for instance metadata requests. The
    #: larger the number, the further instance metadata requests can travel.
    HttpPutResponseHopLimit: Optional[int] = None
    #: Indicates whether the HTTP metadata endpoint on your instances is enabled or
    #: disabled.
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    #: Indicates whether the IPv6 endpoint for the instance metadata service is
    #: enabled or disabled.
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    #: Indicates whether access to instance tags from the instance metadata is enabled
    #: or disabled. For more information, see `Work with instance tags using the
    #: instance metadata <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Ta
    #: gs.html#work-with-tags-in-IMDS>`_.
    InstanceMetadataTags: Optional[Literal["disabled", "enabled"]] = None


class EC2EnclaveOptions(Boto3Model):
    """
    Indicates whether the instance is enabled for Amazon Web Services Nitro
    Enclaves.
    """

    #: If this parameter is set to ``true``, the instance is enabled for Amazon Web
    #: Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web Services
    #: Nitro Enclaves.
    Enabled: Optional[bool] = None


class PrivateDnsNameOptionsResponse(Boto3Model):
    """
    The options for the instance hostname.
    """

    #: The type of hostname to assign to an instance.
    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS A
    #: records.
    EnableResourceNameDnsARecord: Optional[bool] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS
    #: AAAA records.
    EnableResourceNameDnsAAAARecord: Optional[bool] = None


class InstanceMaintenanceOptions(Boto3Model):
    """
    Provides information on the recovery and maintenance options of your
    instance.
    """

    #: Provides information on the current automatic recovery behavior of your
    #: instance.
    AutoRecovery: Optional[Literal["disabled", "default"]] = None


class Instance(TagsDictMixin, PrimaryBoto3Model):
    """
    Describes an instance.
    """

    tag_class: ClassVar[Type] = Tag
    objects: ClassVar[Boto3ModelManager] = InstanceManager()

    #: Any tags assigned to the instance.
    Tags: Optional[List[Tag]] = None
    #: The AMI launch index, which can be used to find this instance in the launch
    #: group.
    AmiLaunchIndex: int = Field(default=None, frozen=True)
    #: The ID of the AMI used to launch the instance.
    ImageId: Optional[str] = None
    #: The ID of the instance.
    InstanceId: str = Field(default=None, frozen=True)
    #: The instance type.
    InstanceType: Optional[
        Literal[
            "a1.medium",
            "a1.large",
            "a1.xlarge",
            "a1.2xlarge",
            "a1.4xlarge",
            "a1.metal",
            "c1.medium",
            "c1.xlarge",
            "c3.large",
            "c3.xlarge",
            "c3.2xlarge",
            "c3.4xlarge",
            "c3.8xlarge",
            "c4.large",
            "c4.xlarge",
            "c4.2xlarge",
            "c4.4xlarge",
            "c4.8xlarge",
            "c5.large",
            "c5.xlarge",
            "c5.2xlarge",
            "c5.4xlarge",
            "c5.9xlarge",
            "c5.12xlarge",
            "c5.18xlarge",
            "c5.24xlarge",
            "c5.metal",
            "c5a.large",
            "c5a.xlarge",
            "c5a.2xlarge",
            "c5a.4xlarge",
            "c5a.8xlarge",
            "c5a.12xlarge",
            "c5a.16xlarge",
            "c5a.24xlarge",
            "c5ad.large",
            "c5ad.xlarge",
            "c5ad.2xlarge",
            "c5ad.4xlarge",
            "c5ad.8xlarge",
            "c5ad.12xlarge",
            "c5ad.16xlarge",
            "c5ad.24xlarge",
            "c5d.large",
            "c5d.xlarge",
            "c5d.2xlarge",
            "c5d.4xlarge",
            "c5d.9xlarge",
            "c5d.12xlarge",
            "c5d.18xlarge",
            "c5d.24xlarge",
            "c5d.metal",
            "c5n.large",
            "c5n.xlarge",
            "c5n.2xlarge",
            "c5n.4xlarge",
            "c5n.9xlarge",
            "c5n.18xlarge",
            "c5n.metal",
            "c6g.medium",
            "c6g.large",
            "c6g.xlarge",
            "c6g.2xlarge",
            "c6g.4xlarge",
            "c6g.8xlarge",
            "c6g.12xlarge",
            "c6g.16xlarge",
            "c6g.metal",
            "c6gd.medium",
            "c6gd.large",
            "c6gd.xlarge",
            "c6gd.2xlarge",
            "c6gd.4xlarge",
            "c6gd.8xlarge",
            "c6gd.12xlarge",
            "c6gd.16xlarge",
            "c6gd.metal",
            "c6gn.medium",
            "c6gn.large",
            "c6gn.xlarge",
            "c6gn.2xlarge",
            "c6gn.4xlarge",
            "c6gn.8xlarge",
            "c6gn.12xlarge",
            "c6gn.16xlarge",
            "c6i.large",
            "c6i.xlarge",
            "c6i.2xlarge",
            "c6i.4xlarge",
            "c6i.8xlarge",
            "c6i.12xlarge",
            "c6i.16xlarge",
            "c6i.24xlarge",
            "c6i.32xlarge",
            "c6i.metal",
            "cc1.4xlarge",
            "cc2.8xlarge",
            "cg1.4xlarge",
            "cr1.8xlarge",
            "d2.xlarge",
            "d2.2xlarge",
            "d2.4xlarge",
            "d2.8xlarge",
            "d3.xlarge",
            "d3.2xlarge",
            "d3.4xlarge",
            "d3.8xlarge",
            "d3en.xlarge",
            "d3en.2xlarge",
            "d3en.4xlarge",
            "d3en.6xlarge",
            "d3en.8xlarge",
            "d3en.12xlarge",
            "dl1.24xlarge",
            "f1.2xlarge",
            "f1.4xlarge",
            "f1.16xlarge",
            "g2.2xlarge",
            "g2.8xlarge",
            "g3.4xlarge",
            "g3.8xlarge",
            "g3.16xlarge",
            "g3s.xlarge",
            "g4ad.xlarge",
            "g4ad.2xlarge",
            "g4ad.4xlarge",
            "g4ad.8xlarge",
            "g4ad.16xlarge",
            "g4dn.xlarge",
            "g4dn.2xlarge",
            "g4dn.4xlarge",
            "g4dn.8xlarge",
            "g4dn.12xlarge",
            "g4dn.16xlarge",
            "g4dn.metal",
            "g5.xlarge",
            "g5.2xlarge",
            "g5.4xlarge",
            "g5.8xlarge",
            "g5.12xlarge",
            "g5.16xlarge",
            "g5.24xlarge",
            "g5.48xlarge",
            "g5g.xlarge",
            "g5g.2xlarge",
            "g5g.4xlarge",
            "g5g.8xlarge",
            "g5g.16xlarge",
            "g5g.metal",
            "hi1.4xlarge",
            "hpc6a.48xlarge",
            "hs1.8xlarge",
            "h1.2xlarge",
            "h1.4xlarge",
            "h1.8xlarge",
            "h1.16xlarge",
            "i2.xlarge",
            "i2.2xlarge",
            "i2.4xlarge",
            "i2.8xlarge",
            "i3.large",
            "i3.xlarge",
            "i3.2xlarge",
            "i3.4xlarge",
            "i3.8xlarge",
            "i3.16xlarge",
            "i3.metal",
            "i3en.large",
            "i3en.xlarge",
            "i3en.2xlarge",
            "i3en.3xlarge",
            "i3en.6xlarge",
            "i3en.12xlarge",
            "i3en.24xlarge",
            "i3en.metal",
            "im4gn.large",
            "im4gn.xlarge",
            "im4gn.2xlarge",
            "im4gn.4xlarge",
            "im4gn.8xlarge",
            "im4gn.16xlarge",
            "inf1.xlarge",
            "inf1.2xlarge",
            "inf1.6xlarge",
            "inf1.24xlarge",
            "is4gen.medium",
            "is4gen.large",
            "is4gen.xlarge",
            "is4gen.2xlarge",
            "is4gen.4xlarge",
            "is4gen.8xlarge",
            "m1.small",
            "m1.medium",
            "m1.large",
            "m1.xlarge",
            "m2.xlarge",
            "m2.2xlarge",
            "m2.4xlarge",
            "m3.medium",
            "m3.large",
            "m3.xlarge",
            "m3.2xlarge",
            "m4.large",
            "m4.xlarge",
            "m4.2xlarge",
            "m4.4xlarge",
            "m4.10xlarge",
            "m4.16xlarge",
            "m5.large",
            "m5.xlarge",
            "m5.2xlarge",
            "m5.4xlarge",
            "m5.8xlarge",
            "m5.12xlarge",
            "m5.16xlarge",
            "m5.24xlarge",
            "m5.metal",
            "m5a.large",
            "m5a.xlarge",
            "m5a.2xlarge",
            "m5a.4xlarge",
            "m5a.8xlarge",
            "m5a.12xlarge",
            "m5a.16xlarge",
            "m5a.24xlarge",
            "m5ad.large",
            "m5ad.xlarge",
            "m5ad.2xlarge",
            "m5ad.4xlarge",
            "m5ad.8xlarge",
            "m5ad.12xlarge",
            "m5ad.16xlarge",
            "m5ad.24xlarge",
            "m5d.large",
            "m5d.xlarge",
            "m5d.2xlarge",
            "m5d.4xlarge",
            "m5d.8xlarge",
            "m5d.12xlarge",
            "m5d.16xlarge",
            "m5d.24xlarge",
            "m5d.metal",
            "m5dn.large",
            "m5dn.xlarge",
            "m5dn.2xlarge",
            "m5dn.4xlarge",
            "m5dn.8xlarge",
            "m5dn.12xlarge",
            "m5dn.16xlarge",
            "m5dn.24xlarge",
            "m5dn.metal",
            "m5n.large",
            "m5n.xlarge",
            "m5n.2xlarge",
            "m5n.4xlarge",
            "m5n.8xlarge",
            "m5n.12xlarge",
            "m5n.16xlarge",
            "m5n.24xlarge",
            "m5n.metal",
            "m5zn.large",
            "m5zn.xlarge",
            "m5zn.2xlarge",
            "m5zn.3xlarge",
            "m5zn.6xlarge",
            "m5zn.12xlarge",
            "m5zn.metal",
            "m6a.large",
            "m6a.xlarge",
            "m6a.2xlarge",
            "m6a.4xlarge",
            "m6a.8xlarge",
            "m6a.12xlarge",
            "m6a.16xlarge",
            "m6a.24xlarge",
            "m6a.32xlarge",
            "m6a.48xlarge",
            "m6g.metal",
            "m6g.medium",
            "m6g.large",
            "m6g.xlarge",
            "m6g.2xlarge",
            "m6g.4xlarge",
            "m6g.8xlarge",
            "m6g.12xlarge",
            "m6g.16xlarge",
            "m6gd.metal",
            "m6gd.medium",
            "m6gd.large",
            "m6gd.xlarge",
            "m6gd.2xlarge",
            "m6gd.4xlarge",
            "m6gd.8xlarge",
            "m6gd.12xlarge",
            "m6gd.16xlarge",
            "m6i.large",
            "m6i.xlarge",
            "m6i.2xlarge",
            "m6i.4xlarge",
            "m6i.8xlarge",
            "m6i.12xlarge",
            "m6i.16xlarge",
            "m6i.24xlarge",
            "m6i.32xlarge",
            "m6i.metal",
            "mac1.metal",
            "p2.xlarge",
            "p2.8xlarge",
            "p2.16xlarge",
            "p3.2xlarge",
            "p3.8xlarge",
            "p3.16xlarge",
            "p3dn.24xlarge",
            "p4d.24xlarge",
            "r3.large",
            "r3.xlarge",
            "r3.2xlarge",
            "r3.4xlarge",
            "r3.8xlarge",
            "r4.large",
            "r4.xlarge",
            "r4.2xlarge",
            "r4.4xlarge",
            "r4.8xlarge",
            "r4.16xlarge",
            "r5.large",
            "r5.xlarge",
            "r5.2xlarge",
            "r5.4xlarge",
            "r5.8xlarge",
            "r5.12xlarge",
            "r5.16xlarge",
            "r5.24xlarge",
            "r5.metal",
            "r5a.large",
            "r5a.xlarge",
            "r5a.2xlarge",
            "r5a.4xlarge",
            "r5a.8xlarge",
            "r5a.12xlarge",
            "r5a.16xlarge",
            "r5a.24xlarge",
            "r5ad.large",
            "r5ad.xlarge",
            "r5ad.2xlarge",
            "r5ad.4xlarge",
            "r5ad.8xlarge",
            "r5ad.12xlarge",
            "r5ad.16xlarge",
            "r5ad.24xlarge",
            "r5b.large",
            "r5b.xlarge",
            "r5b.2xlarge",
            "r5b.4xlarge",
            "r5b.8xlarge",
            "r5b.12xlarge",
            "r5b.16xlarge",
            "r5b.24xlarge",
            "r5b.metal",
            "r5d.large",
            "r5d.xlarge",
            "r5d.2xlarge",
            "r5d.4xlarge",
            "r5d.8xlarge",
            "r5d.12xlarge",
            "r5d.16xlarge",
            "r5d.24xlarge",
            "r5d.metal",
            "r5dn.large",
            "r5dn.xlarge",
            "r5dn.2xlarge",
            "r5dn.4xlarge",
            "r5dn.8xlarge",
            "r5dn.12xlarge",
            "r5dn.16xlarge",
            "r5dn.24xlarge",
            "r5dn.metal",
            "r5n.large",
            "r5n.xlarge",
            "r5n.2xlarge",
            "r5n.4xlarge",
            "r5n.8xlarge",
            "r5n.12xlarge",
            "r5n.16xlarge",
            "r5n.24xlarge",
            "r5n.metal",
            "r6g.medium",
            "r6g.large",
            "r6g.xlarge",
            "r6g.2xlarge",
            "r6g.4xlarge",
            "r6g.8xlarge",
            "r6g.12xlarge",
            "r6g.16xlarge",
            "r6g.metal",
            "r6gd.medium",
            "r6gd.large",
            "r6gd.xlarge",
            "r6gd.2xlarge",
            "r6gd.4xlarge",
            "r6gd.8xlarge",
            "r6gd.12xlarge",
            "r6gd.16xlarge",
            "r6gd.metal",
            "r6i.large",
            "r6i.xlarge",
            "r6i.2xlarge",
            "r6i.4xlarge",
            "r6i.8xlarge",
            "r6i.12xlarge",
            "r6i.16xlarge",
            "r6i.24xlarge",
            "r6i.32xlarge",
            "r6i.metal",
            "t1.micro",
            "t2.nano",
            "t2.micro",
            "t2.small",
            "t2.medium",
            "t2.large",
            "t2.xlarge",
            "t2.2xlarge",
            "t3.nano",
            "t3.micro",
            "t3.small",
            "t3.medium",
            "t3.large",
            "t3.xlarge",
            "t3.2xlarge",
            "t3a.nano",
            "t3a.micro",
            "t3a.small",
            "t3a.medium",
            "t3a.large",
            "t3a.xlarge",
            "t3a.2xlarge",
            "t4g.nano",
            "t4g.micro",
            "t4g.small",
            "t4g.medium",
            "t4g.large",
            "t4g.xlarge",
            "t4g.2xlarge",
            "u-6tb1.56xlarge",
            "u-6tb1.112xlarge",
            "u-9tb1.112xlarge",
            "u-12tb1.112xlarge",
            "u-6tb1.metal",
            "u-9tb1.metal",
            "u-12tb1.metal",
            "u-18tb1.metal",
            "u-24tb1.metal",
            "vt1.3xlarge",
            "vt1.6xlarge",
            "vt1.24xlarge",
            "x1.16xlarge",
            "x1.32xlarge",
            "x1e.xlarge",
            "x1e.2xlarge",
            "x1e.4xlarge",
            "x1e.8xlarge",
            "x1e.16xlarge",
            "x1e.32xlarge",
            "x2iezn.2xlarge",
            "x2iezn.4xlarge",
            "x2iezn.6xlarge",
            "x2iezn.8xlarge",
            "x2iezn.12xlarge",
            "x2iezn.metal",
            "x2gd.medium",
            "x2gd.large",
            "x2gd.xlarge",
            "x2gd.2xlarge",
            "x2gd.4xlarge",
            "x2gd.8xlarge",
            "x2gd.12xlarge",
            "x2gd.16xlarge",
            "x2gd.metal",
            "z1d.large",
            "z1d.xlarge",
            "z1d.2xlarge",
            "z1d.3xlarge",
            "z1d.6xlarge",
            "z1d.12xlarge",
            "z1d.metal",
            "x2idn.16xlarge",
            "x2idn.24xlarge",
            "x2idn.32xlarge",
            "x2iedn.xlarge",
            "x2iedn.2xlarge",
            "x2iedn.4xlarge",
            "x2iedn.8xlarge",
            "x2iedn.16xlarge",
            "x2iedn.24xlarge",
            "x2iedn.32xlarge",
            "c6a.large",
            "c6a.xlarge",
            "c6a.2xlarge",
            "c6a.4xlarge",
            "c6a.8xlarge",
            "c6a.12xlarge",
            "c6a.16xlarge",
            "c6a.24xlarge",
            "c6a.32xlarge",
            "c6a.48xlarge",
            "c6a.metal",
            "m6a.metal",
            "i4i.large",
            "i4i.xlarge",
            "i4i.2xlarge",
            "i4i.4xlarge",
            "i4i.8xlarge",
            "i4i.16xlarge",
            "i4i.32xlarge",
            "i4i.metal",
            "x2idn.metal",
            "x2iedn.metal",
            "c7g.medium",
            "c7g.large",
            "c7g.xlarge",
            "c7g.2xlarge",
            "c7g.4xlarge",
            "c7g.8xlarge",
            "c7g.12xlarge",
            "c7g.16xlarge",
            "mac2.metal",
            "c6id.large",
            "c6id.xlarge",
            "c6id.2xlarge",
            "c6id.4xlarge",
            "c6id.8xlarge",
            "c6id.12xlarge",
            "c6id.16xlarge",
            "c6id.24xlarge",
            "c6id.32xlarge",
            "c6id.metal",
            "m6id.large",
            "m6id.xlarge",
            "m6id.2xlarge",
            "m6id.4xlarge",
            "m6id.8xlarge",
            "m6id.12xlarge",
            "m6id.16xlarge",
            "m6id.24xlarge",
            "m6id.32xlarge",
            "m6id.metal",
            "r6id.large",
            "r6id.xlarge",
            "r6id.2xlarge",
            "r6id.4xlarge",
            "r6id.8xlarge",
            "r6id.12xlarge",
            "r6id.16xlarge",
            "r6id.24xlarge",
            "r6id.32xlarge",
            "r6id.metal",
            "r6a.large",
            "r6a.xlarge",
            "r6a.2xlarge",
            "r6a.4xlarge",
            "r6a.8xlarge",
            "r6a.12xlarge",
            "r6a.16xlarge",
            "r6a.24xlarge",
            "r6a.32xlarge",
            "r6a.48xlarge",
            "r6a.metal",
            "p4de.24xlarge",
            "u-3tb1.56xlarge",
            "u-18tb1.112xlarge",
            "u-24tb1.112xlarge",
            "trn1.2xlarge",
            "trn1.32xlarge",
            "hpc6id.32xlarge",
            "c6in.large",
            "c6in.xlarge",
            "c6in.2xlarge",
            "c6in.4xlarge",
            "c6in.8xlarge",
            "c6in.12xlarge",
            "c6in.16xlarge",
            "c6in.24xlarge",
            "c6in.32xlarge",
            "m6in.large",
            "m6in.xlarge",
            "m6in.2xlarge",
            "m6in.4xlarge",
            "m6in.8xlarge",
            "m6in.12xlarge",
            "m6in.16xlarge",
            "m6in.24xlarge",
            "m6in.32xlarge",
            "m6idn.large",
            "m6idn.xlarge",
            "m6idn.2xlarge",
            "m6idn.4xlarge",
            "m6idn.8xlarge",
            "m6idn.12xlarge",
            "m6idn.16xlarge",
            "m6idn.24xlarge",
            "m6idn.32xlarge",
            "r6in.large",
            "r6in.xlarge",
            "r6in.2xlarge",
            "r6in.4xlarge",
            "r6in.8xlarge",
            "r6in.12xlarge",
            "r6in.16xlarge",
            "r6in.24xlarge",
            "r6in.32xlarge",
            "r6idn.large",
            "r6idn.xlarge",
            "r6idn.2xlarge",
            "r6idn.4xlarge",
            "r6idn.8xlarge",
            "r6idn.12xlarge",
            "r6idn.16xlarge",
            "r6idn.24xlarge",
            "r6idn.32xlarge",
            "c7g.metal",
            "m7g.medium",
            "m7g.large",
            "m7g.xlarge",
            "m7g.2xlarge",
            "m7g.4xlarge",
            "m7g.8xlarge",
            "m7g.12xlarge",
            "m7g.16xlarge",
            "m7g.metal",
            "r7g.medium",
            "r7g.large",
            "r7g.xlarge",
            "r7g.2xlarge",
            "r7g.4xlarge",
            "r7g.8xlarge",
            "r7g.12xlarge",
            "r7g.16xlarge",
            "r7g.metal",
            "c6in.metal",
            "m6in.metal",
            "m6idn.metal",
            "r6in.metal",
            "r6idn.metal",
            "inf2.xlarge",
            "inf2.8xlarge",
            "inf2.24xlarge",
            "inf2.48xlarge",
            "trn1n.32xlarge",
            "i4g.large",
            "i4g.xlarge",
            "i4g.2xlarge",
            "i4g.4xlarge",
            "i4g.8xlarge",
            "i4g.16xlarge",
            "hpc7g.4xlarge",
            "hpc7g.8xlarge",
            "hpc7g.16xlarge",
            "c7gn.medium",
            "c7gn.large",
            "c7gn.xlarge",
            "c7gn.2xlarge",
            "c7gn.4xlarge",
            "c7gn.8xlarge",
            "c7gn.12xlarge",
            "c7gn.16xlarge",
            "p5.48xlarge",
            "m7i.large",
            "m7i.xlarge",
            "m7i.2xlarge",
            "m7i.4xlarge",
            "m7i.8xlarge",
            "m7i.12xlarge",
            "m7i.16xlarge",
            "m7i.24xlarge",
            "m7i.48xlarge",
            "m7i-flex.large",
            "m7i-flex.xlarge",
            "m7i-flex.2xlarge",
            "m7i-flex.4xlarge",
            "m7i-flex.8xlarge",
            "m7a.medium",
            "m7a.large",
            "m7a.xlarge",
            "m7a.2xlarge",
            "m7a.4xlarge",
            "m7a.8xlarge",
            "m7a.12xlarge",
            "m7a.16xlarge",
            "m7a.24xlarge",
            "m7a.32xlarge",
            "m7a.48xlarge",
            "m7a.metal-48xl",
            "hpc7a.12xlarge",
            "hpc7a.24xlarge",
            "hpc7a.48xlarge",
            "hpc7a.96xlarge",
            "c7gd.medium",
            "c7gd.large",
            "c7gd.xlarge",
            "c7gd.2xlarge",
            "c7gd.4xlarge",
            "c7gd.8xlarge",
            "c7gd.12xlarge",
            "c7gd.16xlarge",
            "m7gd.medium",
            "m7gd.large",
            "m7gd.xlarge",
            "m7gd.2xlarge",
            "m7gd.4xlarge",
            "m7gd.8xlarge",
            "m7gd.12xlarge",
            "m7gd.16xlarge",
            "r7gd.medium",
            "r7gd.large",
            "r7gd.xlarge",
            "r7gd.2xlarge",
            "r7gd.4xlarge",
            "r7gd.8xlarge",
            "r7gd.12xlarge",
            "r7gd.16xlarge",
            "r7a.medium",
            "r7a.large",
            "r7a.xlarge",
            "r7a.2xlarge",
            "r7a.4xlarge",
            "r7a.8xlarge",
            "r7a.12xlarge",
            "r7a.16xlarge",
            "r7a.24xlarge",
            "r7a.32xlarge",
            "r7a.48xlarge",
            "c7i.large",
            "c7i.xlarge",
            "c7i.2xlarge",
            "c7i.4xlarge",
            "c7i.8xlarge",
            "c7i.12xlarge",
            "c7i.16xlarge",
            "c7i.24xlarge",
            "c7i.48xlarge",
            "mac2-m2pro.metal",
            "r7iz.large",
            "r7iz.xlarge",
            "r7iz.2xlarge",
            "r7iz.4xlarge",
            "r7iz.8xlarge",
            "r7iz.12xlarge",
            "r7iz.16xlarge",
            "r7iz.32xlarge",
            "c7a.medium",
            "c7a.large",
            "c7a.xlarge",
            "c7a.2xlarge",
            "c7a.4xlarge",
            "c7a.8xlarge",
            "c7a.12xlarge",
            "c7a.16xlarge",
            "c7a.24xlarge",
            "c7a.32xlarge",
            "c7a.48xlarge",
            "c7a.metal-48xl",
            "r7a.metal-48xl",
            "r7i.large",
            "r7i.xlarge",
            "r7i.2xlarge",
            "r7i.4xlarge",
            "r7i.8xlarge",
            "r7i.12xlarge",
            "r7i.16xlarge",
            "r7i.24xlarge",
            "r7i.48xlarge",
            "dl2q.24xlarge",
            "mac2-m2.metal",
            "i4i.12xlarge",
            "i4i.24xlarge",
            "c7i.metal-24xl",
            "c7i.metal-48xl",
            "m7i.metal-24xl",
            "m7i.metal-48xl",
            "r7i.metal-24xl",
            "r7i.metal-48xl",
        ]
    ] = None
    #: The kernel associated with this instance, if applicable.
    KernelId: Optional[str] = None
    #: The name of the key pair, if this instance was launched with an associated key
    #: pair.
    KeyName: Optional[str] = None
    #: The time the instance was launched.
    LaunchTime: datetime = Field(default=None, frozen=True)
    #: The monitoring for the instance.
    Monitoring: Optional[EC2DetailedMonitoring] = None
    #: The location where the instance launched, if applicable.
    Placement: Optional[EC2Placement] = None
    #: The platform. This value is ``windows`` for Windows instances; otherwise, it is
    #: empty.
    Platform: Literal["Windows"] = Field(default=None, frozen=True)
    #: [IPv4 only] The private DNS hostname name assigned to the instance. This DNS
    #: hostname can only be used inside the Amazon EC2 network. This name is not
    #: available until the instance enters the ``running`` state.
    PrivateDnsName: str = Field(default=None, frozen=True)
    #: The private IPv4 address assigned to the instance.
    PrivateIpAddress: Optional[str] = None
    #: The product codes attached to this instance, if applicable.
    ProductCodes: List["ProductCode"] = Field(default=None, frozen=True)
    #: [IPv4 only] The public DNS name assigned to the instance. This name is not
    #: available until the instance enters the ``running`` state. This name is only
    #: available if you've enabled DNS hostnames for your VPC.
    PublicDnsName: str = Field(default=None, frozen=True)
    #: The public IPv4 address, or the Carrier IP address assigned to the instance, if
    #: applicable.
    PublicIpAddress: str = Field(default=None, frozen=True)
    #: The RAM disk associated with this instance, if applicable.
    RamdiskId: Optional[str] = None
    #: The current state of the instance.
    State: InstanceState = Field(default=None, frozen=True)
    #: The reason for the most recent state transition. This might be an empty string.
    StateTransitionReason: str = Field(default=None, frozen=True)
    #: The ID of the subnet in which the instance is running.
    SubnetId: Optional[str] = None
    #: The ID of the VPC in which the instance is running.
    VpcId: str = Field(default=None, frozen=True)
    #: The architecture of the image.
    Architecture: Literal["i386", "x86_64", "arm64", "x86_64_mac", "arm64_mac"] = Field(
        default=None, frozen=True
    )
    #: Any block device mapping entries for the instance.
    BlockDeviceMappings: Optional[List["InstanceBlockDeviceMapping"]] = None
    #: The idempotency token you provided when you launched the instance, if
    #: applicable.
    ClientToken: Optional[str] = None
    #: Indicates whether the instance is optimized for Amazon EBS I/O. This
    #: optimization provides dedicated throughput to Amazon EBS and an optimized
    #: configuration stack to provide optimal I/O performance. This optimization isn't
    #: available with all instance types. Additional usage charges apply when using an
    #: EBS Optimized instance.
    EbsOptimized: Optional[bool] = None
    #: Specifies whether enhanced networking with ENA is enabled.
    EnaSupport: bool = Field(default=None, frozen=True)
    #: The hypervisor type of the instance. The value ``xen`` is used for both Xen and
    #: Nitro hypervisors.
    Hypervisor: Literal["ovm", "xen"] = Field(default=None, frozen=True)
    #: The IAM instance profile associated with the instance, if applicable.
    IamInstanceProfile: Optional[EC2IamInstanceProfile] = None
    #: Indicates whether this is a Spot Instance or a Scheduled Instance.
    InstanceLifecycle: Literal["spot", "scheduled", "capacity-block"] = Field(
        default=None, frozen=True
    )
    #: The Elastic GPU associated with the instance.
    ElasticGpuAssociations: List["ElasticGpuAssociation"] = Field(
        default=None, frozen=True
    )
    #: The elastic inference accelerator associated with the instance.
    ElasticInferenceAcceleratorAssociations: List[
        "ElasticInferenceAcceleratorAssociation"
    ] = Field(default=None, frozen=True)
    #: The network interfaces for the instance.
    NetworkInterfaces: Optional[List["InstanceNetworkInterface"]] = None
    #: The Amazon Resource Name (ARN) of the Outpost.
    OutpostArn: str = Field(default=None, frozen=True)
    #: The device name of the root device volume (for example, ``/dev/sda1``).
    RootDeviceName: str = Field(default=None, frozen=True)
    #: The root device type used by the AMI. The AMI can use an EBS volume or an
    #: instance store volume.
    RootDeviceType: Literal["ebs", "instance-store"] = Field(default=None, frozen=True)
    #: The security groups for the instance.
    SecurityGroups: Optional[List["GroupIdentifier"]] = None
    #: Indicates whether source/destination checking is enabled.
    SourceDestCheck: bool = Field(default=None, frozen=True)
    #: If the request is a Spot Instance request, the ID of the request.
    SpotInstanceRequestId: str = Field(default=None, frozen=True)
    #: Specifies whether enhanced networking with the Intel 82599 Virtual Function
    #: interface is enabled.
    SriovNetSupport: str = Field(default=None, frozen=True)
    #: The reason for the most recent state transition.
    StateReason: EC2StateReason = Field(default=None, frozen=True)
    #: The virtualization type of the instance.
    VirtualizationType: Literal["hvm", "paravirtual"] = Field(default=None, frozen=True)
    #: The CPU options for the instance.
    CpuOptions: Optional[EC2CpuOptions] = None
    #: The ID of the Capacity Reservation.
    CapacityReservationId: str = Field(default=None, frozen=True)
    #: Information about the Capacity Reservation targeting option.
    CapacityReservationSpecification: Optional[
        CapacityReservationSpecificationResponse
    ] = None
    #: Indicates whether the instance is enabled for hibernation.
    HibernationOptions: Optional[EC2HibernationOptions] = None
    #: The license configurations for the instance.
    Licenses: List["LicenseConfiguration"] = Field(default=None, frozen=True)
    #: The metadata options for the instance.
    MetadataOptions: Optional[InstanceMetadataOptionsResponse] = None
    #: Indicates whether the instance is enabled for Amazon Web Services Nitro
    #: Enclaves.
    EnclaveOptions: Optional[EC2EnclaveOptions] = None
    #: The boot mode that was specified by the AMI. If the value is ``uefi-
    #: preferred``, the AMI supports both UEFI and Legacy BIOS. The
    #: ``currentInstanceBootMode`` parameter is the boot mode that is used to boot the
    #: instance at launch or start.
    BootMode: Literal["legacy-bios", "uefi", "uefi-preferred"] = Field(
        default=None, frozen=True
    )
    #: The platform details value for the instance. For more information, see `AMI
    #: billing information fields
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-
    #: fields.html>`_ in the *Amazon EC2 User Guide*.
    PlatformDetails: str = Field(default=None, frozen=True)
    #: The usage operation value for the instance. For more information, see `AMI
    #: billing information fields
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-
    #: fields.html>`_ in the *Amazon EC2 User Guide*.
    UsageOperation: str = Field(default=None, frozen=True)
    #: The time that the usage operation was last updated.
    UsageOperationUpdateTime: datetime = Field(default=None, frozen=True)
    #: The options for the instance hostname.
    PrivateDnsNameOptions: Optional[PrivateDnsNameOptionsResponse] = None
    #: The IPv6 address assigned to the instance.
    Ipv6Address: str = Field(default=None, frozen=True)
    #: If the instance is configured for NitroTPM support, the value is ``v2.0``. For
    #: more information, see `NitroTPM
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html>`_ in the
    #: *Amazon EC2 User Guide*.
    TpmSupport: str = Field(default=None, frozen=True)
    #: Provides information on the recovery and maintenance options of your instance.
    MaintenanceOptions: Optional[InstanceMaintenanceOptions] = None
    #: The boot mode that is used to boot the instance at launch or start. For more
    #: information, see `Boot modes
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html>`_ in the
    #: *Amazon EC2 User Guide*.
    CurrentInstanceBootMode: Literal["legacy-bios", "uefi"] = Field(
        default=None, frozen=True
    )

    @property
    def pk(self) -> Optional[str]:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`InstanceId` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.InstanceId


class LaunchTemplate(TagsDictMixin, PrimaryBoto3Model):
    """
    Describes a launch template.
    """

    tag_class: ClassVar[Type] = Tag
    objects: ClassVar[Boto3ModelManager] = LaunchTemplateManager()

    #: The name of the launch template.
    LaunchTemplateName: str
    #: The ID of the launch template.
    LaunchTemplateId: str = Field(default=None, frozen=True)
    #: The time launch template was created.
    CreateTime: datetime = Field(default=None, frozen=True)
    #: The principal that created the launch template.
    CreatedBy: str = Field(default=None, frozen=True)
    #: The version number of the default version of the launch template.
    DefaultVersionNumber: int = Field(default=None, frozen=True)
    #: The version number of the latest version of the launch template.
    LatestVersionNumber: int = Field(default=None, frozen=True)
    #: The tags for the launch template.
    Tags: List[Tag] = Field(default=None, frozen=True)

    @property
    def pk(self) -> Optional[str]:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`LaunchTemplateId` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.LaunchTemplateId

    @property
    def name(self) -> Optional[str]:
        """
        Return the name of the model.   This is the value of the
        :py:attr:`LaunchTemplateName` attribute.

        Returns:
            The name of the model instance.
        """
        return self.LaunchTemplateName

    @cached_property
    def versions(self) -> Optional[List["LaunchTemplateVersion"]]:
        """
        Return the :py:class:`LaunchTemplateVersion` objects that belong to
        this template, if any.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                }
            )
        except AttributeError:
            return []
        return LaunchTemplateVersion.objects.list(**pk)

    @cached_property
    def default_version(self) -> Optional["LaunchTemplateVersion"]:
        """
        Return the :py:class:`LaunchTemplateVersion` object that is the default
        version of this template, if any.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                    "Version": self.DefaultVersionNumber,
                }
            )
        except AttributeError:
            return None
        return LaunchTemplateVersion.objects.get(**pk)

    @cached_property
    def latest_version(self) -> Optional["LaunchTemplateVersion"]:
        """
        Return the :py:class:`LaunchTemplateVersion` object that is the latest
        version of this template, if any.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                    "Version": self.LatestVersionNumber,
                }
            )
        except AttributeError:
            return None
        return LaunchTemplateVersion.objects.get(**pk)


class LaunchTemplateIamInstanceProfileSpecification(Boto3Model):
    """
    The IAM instance profile.
    """

    #: The Amazon Resource Name (ARN) of the instance profile.
    Arn: Optional[str] = None
    #: The name of the instance profile.
    Name: Optional[str] = None


class LaunchTemplateEbsBlockDevice(Boto3Model):
    """
    Information about the block device for an EBS volume.
    """

    #: Indicates whether the EBS volume is encrypted.
    Encrypted: Optional[bool] = None
    #: Indicates whether the EBS volume is deleted on instance termination.
    DeleteOnTermination: Optional[bool] = None
    #: The number of I/O operations per second (IOPS) that the volume supports.
    Iops: Optional[int] = None
    #: The ARN of the Key Management Service (KMS) CMK used for encryption.
    KmsKeyId: Optional[str] = None
    #: The ID of the snapshot.
    SnapshotId: Optional[str] = None
    #: The size of the volume, in GiB.
    VolumeSize: Optional[int] = None
    #: The volume type.
    VolumeType: Optional[
        Literal["standard", "io1", "io2", "gp2", "sc1", "st1", "gp3"]
    ] = None
    #: The throughput that the volume supports, in MiB/s.
    Throughput: Optional[int] = None


class LaunchTemplateBlockDeviceMapping(Boto3Model):
    """
    Describes a block device mapping.
    """

    #: The device name.
    DeviceName: Optional[str] = None
    #: The virtual device name (ephemeralN).
    VirtualName: Optional[str] = None
    #: Information about the block device for an EBS volume.
    Ebs: Optional[LaunchTemplateEbsBlockDevice] = None
    #: To omit the device from the block device mapping, specify an empty string.
    NoDevice: Optional[str] = None


class PrivateIpAddressSpecification(Boto3Model):
    """
    Describes a secondary private IPv4 address for a network interface.
    """

    #: Indicates whether the private IPv4 address is the primary private IPv4 address.
    #: Only one IPv4 address can be designated as primary.
    Primary: Optional[bool] = None
    #: The private IPv4 address.
    PrivateIpAddress: Optional[str] = None


class Ipv4PrefixSpecificationResponse(Boto3Model):
    """
    Information about the IPv4 delegated prefixes assigned to a network
    interface.
    """

    #: The IPv4 delegated prefixes assigned to the network interface.
    Ipv4Prefix: Optional[str] = None


class Ipv6PrefixSpecificationResponse(Boto3Model):
    """
    Information about the IPv6 delegated prefixes assigned to a network
    interface.
    """

    #: The IPv6 delegated prefixes assigned to the network interface.
    Ipv6Prefix: Optional[str] = None


class LaunchTemplateEnaSrdUdpSpecification(Boto3Model):
    """
    Configures ENA Express for UDP network traffic.
    """

    #: Indicates whether UDP traffic to and from the instance uses ENA Express. To
    #: specify this setting, you must first enable ENA Express.
    EnaSrdUdpEnabled: Optional[bool] = None


class LaunchTemplateEnaSrdSpecification(Boto3Model):
    """
    Contains the ENA Express settings for instances launched from your launch
    template.
    """

    #: Indicates whether ENA Express is enabled for the network interface.
    EnaSrdEnabled: Optional[bool] = None
    #: Configures ENA Express for UDP network traffic.
    EnaSrdUdpSpecification: Optional[LaunchTemplateEnaSrdUdpSpecification] = None


class EC2ConnectionTrackingSpecification(Boto3Model):
    """
    A security group connection tracking specification that enables you to set
    the timeout for connection tracking on an Elastic network interface.

    For more
    information, see `Connection tracking
    timeouts <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon Elastic
    Compute Cloud User Guide*.
    """

    #: Timeout (in seconds) for idle TCP connections in an established state. Min: 60
    #: seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended:
    #: Less than 432000 seconds.
    TcpEstablishedTimeout: Optional[int] = None
    #: Timeout (in seconds) for idle UDP flows that have seen traffic only in a single
    #: direction or a single request-response transaction. Min: 30 seconds. Max: 60
    #: seconds. Default: 30 seconds.
    UdpTimeout: Optional[int] = None
    #: Timeout (in seconds) for idle UDP flows classified as streams which have seen
    #: more than one request-response transaction. Min: 60 seconds. Max: 180 seconds
    #: (3 minutes). Default: 180 seconds.
    UdpStreamTimeout: Optional[int] = None


class LaunchTemplateInstanceNetworkInterfaceSpecification(Boto3Model):
    """
    Describes a network interface.
    """

    #: Indicates whether to associate a Carrier IP address with eth0 for a new network
    #: interface.
    AssociateCarrierIpAddress: Optional[bool] = None
    #: Indicates whether to associate a public IPv4 address with eth0 for a new
    #: network interface.
    AssociatePublicIpAddress: Optional[bool] = None
    #: Indicates whether the network interface is deleted when the instance is
    #: terminated.
    DeleteOnTermination: Optional[bool] = None
    #: A description for the network interface.
    Description: Optional[str] = None
    #: The device index for the network interface attachment.
    DeviceIndex: Optional[int] = None
    #: The IDs of one or more security groups.
    Groups: Optional[List[str]] = None
    #: The type of network interface.
    InterfaceType: Optional[str] = None
    #: The number of IPv6 addresses for the network interface.
    Ipv6AddressCount: Optional[int] = None
    #: The IPv6 addresses for the network interface.
    Ipv6Addresses: Optional[List["InstanceIpv6Address"]] = None
    #: The ID of the network interface.
    NetworkInterfaceId: Optional[str] = None
    #: The primary private IPv4 address of the network interface.
    PrivateIpAddress: Optional[str] = None
    #: One or more private IPv4 addresses.
    PrivateIpAddresses: Optional[List["PrivateIpAddressSpecification"]] = None
    #: The number of secondary private IPv4 addresses for the network interface.
    SecondaryPrivateIpAddressCount: Optional[int] = None
    #: The ID of the subnet for the network interface.
    SubnetId: Optional[str] = None
    #: The index of the network card.
    NetworkCardIndex: Optional[int] = None
    #: One or more IPv4 prefixes assigned to the network interface.
    Ipv4Prefixes: Optional[List["Ipv4PrefixSpecificationResponse"]] = None
    #: The number of IPv4 prefixes that Amazon Web Services automatically assigned to
    #: the network interface.
    Ipv4PrefixCount: Optional[int] = None
    #: One or more IPv6 prefixes assigned to the network interface.
    Ipv6Prefixes: Optional[List["Ipv6PrefixSpecificationResponse"]] = None
    #: The number of IPv6 prefixes that Amazon Web Services automatically assigned to
    #: the network interface.
    Ipv6PrefixCount: Optional[int] = None
    #: The primary IPv6 address of the network interface. When you enable an IPv6 GUA
    #: address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6
    #: address until the instance is terminated or the network interface is detached.
    #: For more information about primary IPv6 addresses, see `RunInstances <https://d
    #: ocs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html>`_.
    PrimaryIpv6: Optional[bool] = None
    #: Contains the ENA Express settings for instances launched from your launch
    #: template.
    EnaSrdSpecification: Optional[LaunchTemplateEnaSrdSpecification] = None
    #: A security group connection tracking specification that enables you to set the
    #: timeout for connection tracking on an Elastic network interface. For more
    #: information, see `Connection tracking timeouts
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    #: connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon Elastic
    #: Compute Cloud User Guide*.
    ConnectionTrackingSpecification: Optional[EC2ConnectionTrackingSpecification] = None


class LaunchTemplatesMonitoring(Boto3Model):
    """
    The monitoring for the instance.
    """

    #: Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring
    #: is enabled.
    Enabled: Optional[bool] = None


class LaunchTemplatePlacement(Boto3Model):
    """
    The placement of the instance.
    """

    #: The Availability Zone of the instance.
    AvailabilityZone: Optional[str] = None
    #: The affinity setting for the instance on the Dedicated Host.
    Affinity: Optional[str] = None
    #: The name of the placement group for the instance.
    GroupName: Optional[str] = None
    #: The ID of the Dedicated Host for the instance.
    HostId: Optional[str] = None
    #: The tenancy of the instance. An instance with a tenancy of ``dedicated`` runs
    #: on single-tenant hardware.
    Tenancy: Optional[Literal["default", "dedicated", "host"]] = None
    #: Reserved for future use.
    SpreadDomain: Optional[str] = None
    #: The ARN of the host resource group in which to launch the instances.
    HostResourceGroupArn: Optional[str] = None
    #: The number of the partition the instance should launch in. Valid only if the
    #: placement group strategy is set to ``partition``.
    PartitionNumber: Optional[int] = None
    #: The Group ID of the placement group. You must specify the Placement Group
    #: **Group ID** to launch an instance in a shared placement group.
    GroupId: Optional[str] = None


class LaunchTemplateTagSpecification(TagsDictMixin, Boto3Model):
    """
    The tags specification for the launch template.
    """

    tag_class: ClassVar[Type] = Tag
    #: The type of resource to tag.
    ResourceType: Optional[
        Literal[
            "capacity-reservation",
            "client-vpn-endpoint",
            "customer-gateway",
            "carrier-gateway",
            "coip-pool",
            "dedicated-host",
            "dhcp-options",
            "egress-only-internet-gateway",
            "elastic-ip",
            "elastic-gpu",
            "export-image-task",
            "export-instance-task",
            "fleet",
            "fpga-image",
            "host-reservation",
            "image",
            "import-image-task",
            "import-snapshot-task",
            "instance",
            "instance-event-window",
            "internet-gateway",
            "ipam",
            "ipam-pool",
            "ipam-scope",
            "ipv4pool-ec2",
            "ipv6pool-ec2",
            "key-pair",
            "launch-template",
            "local-gateway",
            "local-gateway-route-table",
            "local-gateway-virtual-interface",
            "local-gateway-virtual-interface-group",
            "local-gateway-route-table-vpc-association",
            "local-gateway-route-table-virtual-interface-group-association",
            "natgateway",
            "network-acl",
            "network-interface",
            "network-insights-analysis",
            "network-insights-path",
            "network-insights-access-scope",
            "network-insights-access-scope-analysis",
            "placement-group",
            "prefix-list",
            "replace-root-volume-task",
            "reserved-instances",
            "route-table",
            "security-group",
            "security-group-rule",
            "snapshot",
            "spot-fleet-request",
            "spot-instances-request",
            "subnet",
            "subnet-cidr-reservation",
            "traffic-mirror-filter",
            "traffic-mirror-session",
            "traffic-mirror-target",
            "transit-gateway",
            "transit-gateway-attachment",
            "transit-gateway-connect-peer",
            "transit-gateway-multicast-domain",
            "transit-gateway-policy-table",
            "transit-gateway-route-table",
            "transit-gateway-route-table-announcement",
            "volume",
            "vpc",
            "vpc-endpoint",
            "vpc-endpoint-connection",
            "vpc-endpoint-service",
            "vpc-endpoint-service-permission",
            "vpc-peering-connection",
            "vpn-connection",
            "vpn-gateway",
            "vpc-flow-log",
            "capacity-reservation-fleet",
            "traffic-mirror-filter-rule",
            "vpc-endpoint-connection-device-type",
            "verified-access-instance",
            "verified-access-group",
            "verified-access-endpoint",
            "verified-access-policy",
            "verified-access-trust-provider",
            "vpn-connection-device-type",
            "vpc-block-public-access-exclusion",
            "ipam-resource-discovery",
            "ipam-resource-discovery-association",
            "instance-connect-endpoint",
        ]
    ] = None
    #: The tags for the resource.
    Tags: Optional[List[Tag]] = None


class ElasticGpuSpecificationResponse(Boto3Model):
    """
    Describes an elastic GPU.
    """

    #: The elastic GPU type.
    Type: Optional[str] = None


class LaunchTemplateElasticInferenceAcceleratorResponse(Boto3Model):
    """
    Describes an elastic inference accelerator.
    """

    #: The type of elastic inference accelerator. The possible values are
    #: eia1.medium, eia1.large, and eia1.xlarge.
    Type: Optional[str] = None
    #: The number of elastic inference accelerators to attach to the instance.
    Count: Optional[int] = None


class LaunchTemplateSpotMarketOptions(Boto3Model):
    """
    The options for Spot Instances.
    """

    #: The maximum hourly price you're willing to pay for the Spot Instances. We do
    #: not recommend using this parameter because it can lead to increased
    #: interruptions. If you do not specify this parameter, you will pay the current
    #: Spot price.
    MaxPrice: Optional[str] = None
    #: The Spot Instance request type.
    SpotInstanceType: Optional[Literal["one-time", "persistent"]] = None
    #: The required duration for the Spot Instances (also known as Spot blocks), in
    #: minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
    BlockDurationMinutes: Optional[int] = None
    #: The end date of the request. For a one-time request, the request remains active
    #: until all instances launch, the request is canceled, or this date is reached.
    #: If the request is persistent, it remains active until it is canceled or this
    #: date and time is reached.
    ValidUntil: Optional[datetime] = None
    #: The behavior when a Spot Instance is interrupted.
    InstanceInterruptionBehavior: Optional[
        Literal["hibernate", "stop", "terminate"]
    ] = None


class LaunchTemplateInstanceMarketOptions(Boto3Model):
    """
    The market (purchasing) option for the instances.
    """

    #: The market type.
    MarketType: Optional[Literal["spot", "capacity-block"]] = None
    #: The options for Spot Instances.
    SpotOptions: Optional[LaunchTemplateSpotMarketOptions] = None


class InstanceCreditSpecification(Boto3Model):
    """
    The credit option for CPU usage of the instance.
    """

    #: The ID of the instance.
    InstanceId: Optional[str] = None
    #: The credit option for CPU usage of the instance.
    CpuCredits: Optional[str] = None


class LaunchTemplateCpuOptions(Boto3Model):
    """
    The CPU options for the instance.

    For more information, see
    `Optimizing CPU options <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-
    cpu.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    """

    #: The number of CPU cores for the instance.
    CoreCount: Optional[int] = None
    #: The number of threads per CPU core.
    ThreadsPerCore: Optional[int] = None
    #: Indicates whether the instance is enabled for AMD SEV-SNP. For more
    #: information, see `AMD SEV- SNP
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html>`_.
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = None


class LaunchTemplateCapacityReservationSpecificationResponse(Boto3Model):
    """
    Information about the Capacity Reservation targeting option.
    """

    #: Indicates the instance's Capacity Reservation preferences. Possible preferences
    #: include:
    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    #: Information about the target Capacity Reservation or Capacity Reservation
    #: group.
    CapacityReservationTarget: Optional[CapacityReservationTargetResponse] = None


class LaunchTemplateLicenseConfiguration(Boto3Model):
    """
    Describes a license configuration.
    """

    #: The Amazon Resource Name (ARN) of the license configuration.
    LicenseConfigurationArn: Optional[str] = None


class LaunchTemplateHibernationOptions(Boto3Model):
    """
    Indicates whether an instance is configured for hibernation.

    For more information, see
    `Hibernate your instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_
    in the *Amazon Elastic Compute Cloud User Guide*.
    """

    #: If this parameter is set to ``true``, the instance is enabled for hibernation;
    #: otherwise, it is not enabled for hibernation.
    Configured: Optional[bool] = None


class LaunchTemplateInstanceMetadataOptions(Boto3Model):
    """
    The metadata options for the instance.

    For more information, see
    `Instance metadata and user data <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    metadata.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    """

    #: The state of the metadata option changes.
    State: Optional[Literal["pending", "applied"]] = None
    #: Indicates whether IMDSv2 is required.
    HttpTokens: Optional[Literal["optional", "required"]] = None
    #: The desired HTTP PUT response hop limit for instance metadata requests. The
    #: larger the number, the further instance metadata requests can travel.
    HttpPutResponseHopLimit: Optional[int] = None
    #: Enables or disables the HTTP metadata endpoint on your instances. If the
    #: parameter is not specified, the default state is ``enabled``.
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    #: Enables or disables the IPv6 endpoint for the instance metadata service.
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    #: Set to ``enabled`` to allow access to instance tags from the instance metadata.
    #: Set to ``disabled`` to turn off access to instance tags from the instance
    #: metadata. For more information, see `Work with instance tags using the instance
    #: metadata <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#w
    #: ork-with-tags-in-IMDS>`_.
    InstanceMetadataTags: Optional[Literal["disabled", "enabled"]] = None


class LaunchTemplateEnclaveOptions(Boto3Model):
    """
    Indicates whether the instance is enabled for Amazon Web Services Nitro
    Enclaves.
    """

    #: If this parameter is set to ``true``, the instance is enabled for Amazon Web
    #: Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web Services
    #: Nitro Enclaves.
    Enabled: Optional[bool] = None


class VCpuCountRange(Boto3Model):
    """
    The minimum and maximum number of vCPUs.
    """

    #: The minimum number of vCPUs. If the value is ``0``, there is no minimum limit.
    Min: Optional[int] = None
    #: The maximum number of vCPUs. If this parameter is not specified, there is no
    #: maximum limit.
    Max: Optional[int] = None


class InstanceMemoryMiB(Boto3Model):
    """
    The minimum and maximum amount of memory, in MiB.
    """

    #: The minimum amount of memory, in MiB. If this parameter is not specified, there
    #: is no minimum limit.
    Min: Optional[int] = None
    #: The maximum amount of memory, in MiB. If this parameter is not specified, there
    #: is no maximum limit.
    Max: Optional[int] = None


class InstanceMemoryGiBPerVCpu(Boto3Model):
    """
    The minimum and maximum amount of memory per vCPU, in GiB.

    Default: No minimum or maximum limits
    """

    #: The minimum amount of memory per vCPU, in GiB. If this parameter is not
    #: specified, there is no minimum limit.
    Min: Optional[float] = None
    #: The maximum amount of memory per vCPU, in GiB. If this parameter is not
    #: specified, there is no maximum limit.
    Max: Optional[float] = None


class InstanceNetworkInterfaceCount(Boto3Model):
    """
    The minimum and maximum number of network interfaces.

    Default: No minimum or maximum limits
    """

    #: The minimum number of network interfaces. If this parameter is not specified,
    #: there is no minimum limit.
    Min: Optional[int] = None
    #: The maximum number of network interfaces. If this parameter is not specified,
    #: there is no maximum limit.
    Max: Optional[int] = None


class InstanceTotalLocalStorageGB(Boto3Model):
    """
    The minimum and maximum amount of total local storage, in GB.

    Default: No minimum or maximum limits
    """

    #: The minimum amount of total local storage, in GB. If this parameter is not
    #: specified, there is no minimum limit.
    Min: Optional[float] = None
    #: The maximum amount of total local storage, in GB. If this parameter is not
    #: specified, there is no maximum limit.
    Max: Optional[float] = None


class InstanceBaselineEbsBandwidthMbps(Boto3Model):
    """The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more
    information, see `Amazon EBS–optimized
    instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-
    optimized.html>`_ in the *Amazon EC2 User Guide*.

    Default: No minimum or maximum limits
    """

    #: The minimum baseline bandwidth, in Mbps. If this parameter is not specified,
    #: there is no minimum limit.
    Min: Optional[int] = None
    #: The maximum baseline bandwidth, in Mbps. If this parameter is not specified,
    #: there is no maximum limit.
    Max: Optional[int] = None


class InstanceAcceleratorCount(Boto3Model):
    """
    The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web
    Services Inferentia chips) on an instance.

    To exclude accelerator-enabled instance types, set ``Max`` to ``0``.

    Default: No minimum or maximum limits
    """

    #: The minimum number of accelerators. If this parameter is not specified, there
    #: is no minimum limit.
    Min: Optional[int] = None
    #: The maximum number of accelerators. If this parameter is not specified, there
    #: is no maximum limit.
    Max: Optional[int] = None


class InstanceAcceleratorTotalMemoryMiB(Boto3Model):
    """
    The minimum and maximum amount of total accelerator memory, in MiB.

    Default: No minimum or maximum limits
    """

    #: The minimum amount of accelerator memory, in MiB. If this parameter is not
    #: specified, there is no minimum limit.
    Min: Optional[int] = None
    #: The maximum amount of accelerator memory, in MiB. If this parameter is not
    #: specified, there is no maximum limit.
    Max: Optional[int] = None


class InstanceNetworkBandwidthGbps(Boto3Model):
    """
    The minimum and maximum amount of network bandwidth, in gigabits per second
    (Gbps).

    Default: No minimum or maximum limits
    """

    #: The minimum amount of network bandwidth, in Gbps. If this parameter is not
    #: specified, there is no minimum limit.
    Min: Optional[float] = None
    #: The maximum amount of network bandwidth, in Gbps. If this parameter is not
    #: specified, there is no maximum limit.
    Max: Optional[float] = None


class LaunchTemplateInstanceRequirements(Boto3Model):
    """
    The attributes for the instance types. When you specify instance
    attributes, Amazon EC2 will identify instance types with these attributes.

    If you specify ``InstanceRequirements``, you can't specify ``InstanceTypes``.
    """

    #: The minimum and maximum number of vCPUs.
    VCpuCount: Optional[VCpuCountRange] = None
    #: The minimum and maximum amount of memory, in MiB.
    MemoryMiB: Optional[InstanceMemoryMiB] = None
    #: The CPU manufacturers to include.
    CpuManufacturers: Optional[
        List[Literal["intel", "amd", "amazon-web-services"]]
    ] = None
    #: The minimum and maximum amount of memory per vCPU, in GiB.
    MemoryGiBPerVCpu: Optional[InstanceMemoryGiBPerVCpu] = None
    #: The instance types to exclude.
    ExcludedInstanceTypes: Optional[List[str]] = None
    #: Indicates whether current or previous generation instance types are included.
    #: The current generation instance types are recommended for use. Current
    #: generation instance types are typically the latest two to three generations in
    #: each instance family. For more information, see `Instance types
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>`_ in
    #: the *Amazon EC2 User Guide*.
    InstanceGenerations: Optional[List[Literal["current", "previous"]]] = None
    #: The price protection threshold for Spot Instances. This is the maximum you’ll
    #: pay for a Spot Instance, expressed as a percentage above the least expensive
    #: current generation M, C, or R instance type with your specified attributes.
    #: When Amazon EC2 selects instance types with your attributes, it excludes
    #: instance types priced above your threshold.
    SpotMaxPricePercentageOverLowestPrice: Optional[int] = None
    #: The price protection threshold for On-Demand Instances. This is the maximum
    #: you’ll pay for an On-Demand Instance, expressed as a percentage above the least
    #: expensive current generation M, C, or R instance type with your specified
    #: attributes. When Amazon EC2 selects instance types with your attributes, it
    #: excludes instance types priced above your threshold.
    OnDemandMaxPricePercentageOverLowestPrice: Optional[int] = None
    #: Indicates whether bare metal instance types must be included, excluded, or
    #: required.
    BareMetal: Optional[Literal["included", "required", "excluded"]] = None
    #: Indicates whether burstable performance T instance types are included,
    #: excluded, or required. For more information, see `Burstable performance
    #: instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-
    #: performance-instances.html>`_.
    BurstablePerformance: Optional[Literal["included", "required", "excluded"]] = None
    #: Indicates whether instance types must support hibernation for On-Demand
    #: Instances.
    RequireHibernateSupport: Optional[bool] = None
    #: The minimum and maximum number of network interfaces.
    NetworkInterfaceCount: Optional[InstanceNetworkInterfaceCount] = None
    #: Indicates whether instance types with instance store volumes are included,
    #: excluded, or required. For more information, `Amazon EC2 instance store <https:
    #: //docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html>`_ in the
    #: *Amazon EC2 User Guide*.
    LocalStorage: Optional[Literal["included", "required", "excluded"]] = None
    #: The type of local storage that is required.
    LocalStorageTypes: Optional[List[Literal["hdd", "ssd"]]] = None
    #: The minimum and maximum amount of total local storage, in GB.
    TotalLocalStorageGB: Optional[InstanceTotalLocalStorageGB] = None
    #: The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more
    #: information, see `Amazon EBS–optimized instances
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs- optimized.html>`_ in
    #: the *Amazon EC2 User Guide*.
    BaselineEbsBandwidthMbps: Optional[InstanceBaselineEbsBandwidthMbps] = None
    #: The accelerator types that must be on the instance type.
    AcceleratorTypes: Optional[List[Literal["gpu", "fpga", "inference"]]] = None
    #: The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web
    #: Services Inferentia chips) on an instance.
    AcceleratorCount: Optional[InstanceAcceleratorCount] = None
    #: Indicates whether instance types must have accelerators by specific
    #: manufacturers.
    AcceleratorManufacturers: Optional[
        List[Literal["amazon-web-services", "amd", "nvidia", "xilinx", "habana"]]
    ] = None
    #: The accelerators that must be on the instance type.
    AcceleratorNames: Optional[
        List[
            Literal[
                "a100",
                "inferentia",
                "k520",
                "k80",
                "m60",
                "radeon-pro-v520",
                "t4",
                "vu9p",
                "v100",
                "a10g",
                "h100",
                "t4g",
            ]
        ]
    ] = None
    #: The minimum and maximum amount of total accelerator memory, in MiB.
    AcceleratorTotalMemoryMiB: Optional[InstanceAcceleratorTotalMemoryMiB] = None
    #: The minimum and maximum amount of network bandwidth, in gigabits per second
    #: (Gbps).
    NetworkBandwidthGbps: Optional[InstanceNetworkBandwidthGbps] = None
    #: The instance types to apply your specified attributes against. All other
    #: instance types are ignored, even if they match your specified attributes.
    AllowedInstanceTypes: Optional[List[str]] = None


class LaunchTemplatePrivateDnsNameOptions(Boto3Model):
    """
    The options for the instance hostname.
    """

    #: The type of hostname to assign to an instance.
    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS A
    #: records.
    EnableResourceNameDnsARecord: Optional[bool] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS
    #: AAAA records.
    EnableResourceNameDnsAAAARecord: Optional[bool] = None


class LaunchTemplateInstanceMaintenanceOptions(Boto3Model):
    """
    The maintenance options for your instance.
    """

    #: Disables the automatic recovery behavior of your instance or sets it to
    #: default.
    AutoRecovery: Optional[Literal["default", "disabled"]] = None


class ResponseLaunchTemplateData(Boto3Model):
    """
    Information about the launch template.
    """

    #: The ID of the kernel, if applicable.
    KernelId: Optional[str] = None
    #: Indicates whether the instance is optimized for Amazon EBS I/O.
    EbsOptimized: Optional[bool] = None
    #: The IAM instance profile.
    IamInstanceProfile: Optional[LaunchTemplateIamInstanceProfileSpecification] = None
    #: The block device mappings.
    BlockDeviceMappings: Optional[List["LaunchTemplateBlockDeviceMapping"]] = None
    #: The network interfaces.
    NetworkInterfaces: Optional[
        List["LaunchTemplateInstanceNetworkInterfaceSpecification"]
    ] = None
    #: The ID of the AMI or a Systems Manager parameter. The Systems Manager parameter
    #: will resolve to the ID of the AMI at instance launch.
    ImageId: Optional[str] = None
    #: The instance type.
    InstanceType: Optional[
        Literal[
            "a1.medium",
            "a1.large",
            "a1.xlarge",
            "a1.2xlarge",
            "a1.4xlarge",
            "a1.metal",
            "c1.medium",
            "c1.xlarge",
            "c3.large",
            "c3.xlarge",
            "c3.2xlarge",
            "c3.4xlarge",
            "c3.8xlarge",
            "c4.large",
            "c4.xlarge",
            "c4.2xlarge",
            "c4.4xlarge",
            "c4.8xlarge",
            "c5.large",
            "c5.xlarge",
            "c5.2xlarge",
            "c5.4xlarge",
            "c5.9xlarge",
            "c5.12xlarge",
            "c5.18xlarge",
            "c5.24xlarge",
            "c5.metal",
            "c5a.large",
            "c5a.xlarge",
            "c5a.2xlarge",
            "c5a.4xlarge",
            "c5a.8xlarge",
            "c5a.12xlarge",
            "c5a.16xlarge",
            "c5a.24xlarge",
            "c5ad.large",
            "c5ad.xlarge",
            "c5ad.2xlarge",
            "c5ad.4xlarge",
            "c5ad.8xlarge",
            "c5ad.12xlarge",
            "c5ad.16xlarge",
            "c5ad.24xlarge",
            "c5d.large",
            "c5d.xlarge",
            "c5d.2xlarge",
            "c5d.4xlarge",
            "c5d.9xlarge",
            "c5d.12xlarge",
            "c5d.18xlarge",
            "c5d.24xlarge",
            "c5d.metal",
            "c5n.large",
            "c5n.xlarge",
            "c5n.2xlarge",
            "c5n.4xlarge",
            "c5n.9xlarge",
            "c5n.18xlarge",
            "c5n.metal",
            "c6g.medium",
            "c6g.large",
            "c6g.xlarge",
            "c6g.2xlarge",
            "c6g.4xlarge",
            "c6g.8xlarge",
            "c6g.12xlarge",
            "c6g.16xlarge",
            "c6g.metal",
            "c6gd.medium",
            "c6gd.large",
            "c6gd.xlarge",
            "c6gd.2xlarge",
            "c6gd.4xlarge",
            "c6gd.8xlarge",
            "c6gd.12xlarge",
            "c6gd.16xlarge",
            "c6gd.metal",
            "c6gn.medium",
            "c6gn.large",
            "c6gn.xlarge",
            "c6gn.2xlarge",
            "c6gn.4xlarge",
            "c6gn.8xlarge",
            "c6gn.12xlarge",
            "c6gn.16xlarge",
            "c6i.large",
            "c6i.xlarge",
            "c6i.2xlarge",
            "c6i.4xlarge",
            "c6i.8xlarge",
            "c6i.12xlarge",
            "c6i.16xlarge",
            "c6i.24xlarge",
            "c6i.32xlarge",
            "c6i.metal",
            "cc1.4xlarge",
            "cc2.8xlarge",
            "cg1.4xlarge",
            "cr1.8xlarge",
            "d2.xlarge",
            "d2.2xlarge",
            "d2.4xlarge",
            "d2.8xlarge",
            "d3.xlarge",
            "d3.2xlarge",
            "d3.4xlarge",
            "d3.8xlarge",
            "d3en.xlarge",
            "d3en.2xlarge",
            "d3en.4xlarge",
            "d3en.6xlarge",
            "d3en.8xlarge",
            "d3en.12xlarge",
            "dl1.24xlarge",
            "f1.2xlarge",
            "f1.4xlarge",
            "f1.16xlarge",
            "g2.2xlarge",
            "g2.8xlarge",
            "g3.4xlarge",
            "g3.8xlarge",
            "g3.16xlarge",
            "g3s.xlarge",
            "g4ad.xlarge",
            "g4ad.2xlarge",
            "g4ad.4xlarge",
            "g4ad.8xlarge",
            "g4ad.16xlarge",
            "g4dn.xlarge",
            "g4dn.2xlarge",
            "g4dn.4xlarge",
            "g4dn.8xlarge",
            "g4dn.12xlarge",
            "g4dn.16xlarge",
            "g4dn.metal",
            "g5.xlarge",
            "g5.2xlarge",
            "g5.4xlarge",
            "g5.8xlarge",
            "g5.12xlarge",
            "g5.16xlarge",
            "g5.24xlarge",
            "g5.48xlarge",
            "g5g.xlarge",
            "g5g.2xlarge",
            "g5g.4xlarge",
            "g5g.8xlarge",
            "g5g.16xlarge",
            "g5g.metal",
            "hi1.4xlarge",
            "hpc6a.48xlarge",
            "hs1.8xlarge",
            "h1.2xlarge",
            "h1.4xlarge",
            "h1.8xlarge",
            "h1.16xlarge",
            "i2.xlarge",
            "i2.2xlarge",
            "i2.4xlarge",
            "i2.8xlarge",
            "i3.large",
            "i3.xlarge",
            "i3.2xlarge",
            "i3.4xlarge",
            "i3.8xlarge",
            "i3.16xlarge",
            "i3.metal",
            "i3en.large",
            "i3en.xlarge",
            "i3en.2xlarge",
            "i3en.3xlarge",
            "i3en.6xlarge",
            "i3en.12xlarge",
            "i3en.24xlarge",
            "i3en.metal",
            "im4gn.large",
            "im4gn.xlarge",
            "im4gn.2xlarge",
            "im4gn.4xlarge",
            "im4gn.8xlarge",
            "im4gn.16xlarge",
            "inf1.xlarge",
            "inf1.2xlarge",
            "inf1.6xlarge",
            "inf1.24xlarge",
            "is4gen.medium",
            "is4gen.large",
            "is4gen.xlarge",
            "is4gen.2xlarge",
            "is4gen.4xlarge",
            "is4gen.8xlarge",
            "m1.small",
            "m1.medium",
            "m1.large",
            "m1.xlarge",
            "m2.xlarge",
            "m2.2xlarge",
            "m2.4xlarge",
            "m3.medium",
            "m3.large",
            "m3.xlarge",
            "m3.2xlarge",
            "m4.large",
            "m4.xlarge",
            "m4.2xlarge",
            "m4.4xlarge",
            "m4.10xlarge",
            "m4.16xlarge",
            "m5.large",
            "m5.xlarge",
            "m5.2xlarge",
            "m5.4xlarge",
            "m5.8xlarge",
            "m5.12xlarge",
            "m5.16xlarge",
            "m5.24xlarge",
            "m5.metal",
            "m5a.large",
            "m5a.xlarge",
            "m5a.2xlarge",
            "m5a.4xlarge",
            "m5a.8xlarge",
            "m5a.12xlarge",
            "m5a.16xlarge",
            "m5a.24xlarge",
            "m5ad.large",
            "m5ad.xlarge",
            "m5ad.2xlarge",
            "m5ad.4xlarge",
            "m5ad.8xlarge",
            "m5ad.12xlarge",
            "m5ad.16xlarge",
            "m5ad.24xlarge",
            "m5d.large",
            "m5d.xlarge",
            "m5d.2xlarge",
            "m5d.4xlarge",
            "m5d.8xlarge",
            "m5d.12xlarge",
            "m5d.16xlarge",
            "m5d.24xlarge",
            "m5d.metal",
            "m5dn.large",
            "m5dn.xlarge",
            "m5dn.2xlarge",
            "m5dn.4xlarge",
            "m5dn.8xlarge",
            "m5dn.12xlarge",
            "m5dn.16xlarge",
            "m5dn.24xlarge",
            "m5dn.metal",
            "m5n.large",
            "m5n.xlarge",
            "m5n.2xlarge",
            "m5n.4xlarge",
            "m5n.8xlarge",
            "m5n.12xlarge",
            "m5n.16xlarge",
            "m5n.24xlarge",
            "m5n.metal",
            "m5zn.large",
            "m5zn.xlarge",
            "m5zn.2xlarge",
            "m5zn.3xlarge",
            "m5zn.6xlarge",
            "m5zn.12xlarge",
            "m5zn.metal",
            "m6a.large",
            "m6a.xlarge",
            "m6a.2xlarge",
            "m6a.4xlarge",
            "m6a.8xlarge",
            "m6a.12xlarge",
            "m6a.16xlarge",
            "m6a.24xlarge",
            "m6a.32xlarge",
            "m6a.48xlarge",
            "m6g.metal",
            "m6g.medium",
            "m6g.large",
            "m6g.xlarge",
            "m6g.2xlarge",
            "m6g.4xlarge",
            "m6g.8xlarge",
            "m6g.12xlarge",
            "m6g.16xlarge",
            "m6gd.metal",
            "m6gd.medium",
            "m6gd.large",
            "m6gd.xlarge",
            "m6gd.2xlarge",
            "m6gd.4xlarge",
            "m6gd.8xlarge",
            "m6gd.12xlarge",
            "m6gd.16xlarge",
            "m6i.large",
            "m6i.xlarge",
            "m6i.2xlarge",
            "m6i.4xlarge",
            "m6i.8xlarge",
            "m6i.12xlarge",
            "m6i.16xlarge",
            "m6i.24xlarge",
            "m6i.32xlarge",
            "m6i.metal",
            "mac1.metal",
            "p2.xlarge",
            "p2.8xlarge",
            "p2.16xlarge",
            "p3.2xlarge",
            "p3.8xlarge",
            "p3.16xlarge",
            "p3dn.24xlarge",
            "p4d.24xlarge",
            "r3.large",
            "r3.xlarge",
            "r3.2xlarge",
            "r3.4xlarge",
            "r3.8xlarge",
            "r4.large",
            "r4.xlarge",
            "r4.2xlarge",
            "r4.4xlarge",
            "r4.8xlarge",
            "r4.16xlarge",
            "r5.large",
            "r5.xlarge",
            "r5.2xlarge",
            "r5.4xlarge",
            "r5.8xlarge",
            "r5.12xlarge",
            "r5.16xlarge",
            "r5.24xlarge",
            "r5.metal",
            "r5a.large",
            "r5a.xlarge",
            "r5a.2xlarge",
            "r5a.4xlarge",
            "r5a.8xlarge",
            "r5a.12xlarge",
            "r5a.16xlarge",
            "r5a.24xlarge",
            "r5ad.large",
            "r5ad.xlarge",
            "r5ad.2xlarge",
            "r5ad.4xlarge",
            "r5ad.8xlarge",
            "r5ad.12xlarge",
            "r5ad.16xlarge",
            "r5ad.24xlarge",
            "r5b.large",
            "r5b.xlarge",
            "r5b.2xlarge",
            "r5b.4xlarge",
            "r5b.8xlarge",
            "r5b.12xlarge",
            "r5b.16xlarge",
            "r5b.24xlarge",
            "r5b.metal",
            "r5d.large",
            "r5d.xlarge",
            "r5d.2xlarge",
            "r5d.4xlarge",
            "r5d.8xlarge",
            "r5d.12xlarge",
            "r5d.16xlarge",
            "r5d.24xlarge",
            "r5d.metal",
            "r5dn.large",
            "r5dn.xlarge",
            "r5dn.2xlarge",
            "r5dn.4xlarge",
            "r5dn.8xlarge",
            "r5dn.12xlarge",
            "r5dn.16xlarge",
            "r5dn.24xlarge",
            "r5dn.metal",
            "r5n.large",
            "r5n.xlarge",
            "r5n.2xlarge",
            "r5n.4xlarge",
            "r5n.8xlarge",
            "r5n.12xlarge",
            "r5n.16xlarge",
            "r5n.24xlarge",
            "r5n.metal",
            "r6g.medium",
            "r6g.large",
            "r6g.xlarge",
            "r6g.2xlarge",
            "r6g.4xlarge",
            "r6g.8xlarge",
            "r6g.12xlarge",
            "r6g.16xlarge",
            "r6g.metal",
            "r6gd.medium",
            "r6gd.large",
            "r6gd.xlarge",
            "r6gd.2xlarge",
            "r6gd.4xlarge",
            "r6gd.8xlarge",
            "r6gd.12xlarge",
            "r6gd.16xlarge",
            "r6gd.metal",
            "r6i.large",
            "r6i.xlarge",
            "r6i.2xlarge",
            "r6i.4xlarge",
            "r6i.8xlarge",
            "r6i.12xlarge",
            "r6i.16xlarge",
            "r6i.24xlarge",
            "r6i.32xlarge",
            "r6i.metal",
            "t1.micro",
            "t2.nano",
            "t2.micro",
            "t2.small",
            "t2.medium",
            "t2.large",
            "t2.xlarge",
            "t2.2xlarge",
            "t3.nano",
            "t3.micro",
            "t3.small",
            "t3.medium",
            "t3.large",
            "t3.xlarge",
            "t3.2xlarge",
            "t3a.nano",
            "t3a.micro",
            "t3a.small",
            "t3a.medium",
            "t3a.large",
            "t3a.xlarge",
            "t3a.2xlarge",
            "t4g.nano",
            "t4g.micro",
            "t4g.small",
            "t4g.medium",
            "t4g.large",
            "t4g.xlarge",
            "t4g.2xlarge",
            "u-6tb1.56xlarge",
            "u-6tb1.112xlarge",
            "u-9tb1.112xlarge",
            "u-12tb1.112xlarge",
            "u-6tb1.metal",
            "u-9tb1.metal",
            "u-12tb1.metal",
            "u-18tb1.metal",
            "u-24tb1.metal",
            "vt1.3xlarge",
            "vt1.6xlarge",
            "vt1.24xlarge",
            "x1.16xlarge",
            "x1.32xlarge",
            "x1e.xlarge",
            "x1e.2xlarge",
            "x1e.4xlarge",
            "x1e.8xlarge",
            "x1e.16xlarge",
            "x1e.32xlarge",
            "x2iezn.2xlarge",
            "x2iezn.4xlarge",
            "x2iezn.6xlarge",
            "x2iezn.8xlarge",
            "x2iezn.12xlarge",
            "x2iezn.metal",
            "x2gd.medium",
            "x2gd.large",
            "x2gd.xlarge",
            "x2gd.2xlarge",
            "x2gd.4xlarge",
            "x2gd.8xlarge",
            "x2gd.12xlarge",
            "x2gd.16xlarge",
            "x2gd.metal",
            "z1d.large",
            "z1d.xlarge",
            "z1d.2xlarge",
            "z1d.3xlarge",
            "z1d.6xlarge",
            "z1d.12xlarge",
            "z1d.metal",
            "x2idn.16xlarge",
            "x2idn.24xlarge",
            "x2idn.32xlarge",
            "x2iedn.xlarge",
            "x2iedn.2xlarge",
            "x2iedn.4xlarge",
            "x2iedn.8xlarge",
            "x2iedn.16xlarge",
            "x2iedn.24xlarge",
            "x2iedn.32xlarge",
            "c6a.large",
            "c6a.xlarge",
            "c6a.2xlarge",
            "c6a.4xlarge",
            "c6a.8xlarge",
            "c6a.12xlarge",
            "c6a.16xlarge",
            "c6a.24xlarge",
            "c6a.32xlarge",
            "c6a.48xlarge",
            "c6a.metal",
            "m6a.metal",
            "i4i.large",
            "i4i.xlarge",
            "i4i.2xlarge",
            "i4i.4xlarge",
            "i4i.8xlarge",
            "i4i.16xlarge",
            "i4i.32xlarge",
            "i4i.metal",
            "x2idn.metal",
            "x2iedn.metal",
            "c7g.medium",
            "c7g.large",
            "c7g.xlarge",
            "c7g.2xlarge",
            "c7g.4xlarge",
            "c7g.8xlarge",
            "c7g.12xlarge",
            "c7g.16xlarge",
            "mac2.metal",
            "c6id.large",
            "c6id.xlarge",
            "c6id.2xlarge",
            "c6id.4xlarge",
            "c6id.8xlarge",
            "c6id.12xlarge",
            "c6id.16xlarge",
            "c6id.24xlarge",
            "c6id.32xlarge",
            "c6id.metal",
            "m6id.large",
            "m6id.xlarge",
            "m6id.2xlarge",
            "m6id.4xlarge",
            "m6id.8xlarge",
            "m6id.12xlarge",
            "m6id.16xlarge",
            "m6id.24xlarge",
            "m6id.32xlarge",
            "m6id.metal",
            "r6id.large",
            "r6id.xlarge",
            "r6id.2xlarge",
            "r6id.4xlarge",
            "r6id.8xlarge",
            "r6id.12xlarge",
            "r6id.16xlarge",
            "r6id.24xlarge",
            "r6id.32xlarge",
            "r6id.metal",
            "r6a.large",
            "r6a.xlarge",
            "r6a.2xlarge",
            "r6a.4xlarge",
            "r6a.8xlarge",
            "r6a.12xlarge",
            "r6a.16xlarge",
            "r6a.24xlarge",
            "r6a.32xlarge",
            "r6a.48xlarge",
            "r6a.metal",
            "p4de.24xlarge",
            "u-3tb1.56xlarge",
            "u-18tb1.112xlarge",
            "u-24tb1.112xlarge",
            "trn1.2xlarge",
            "trn1.32xlarge",
            "hpc6id.32xlarge",
            "c6in.large",
            "c6in.xlarge",
            "c6in.2xlarge",
            "c6in.4xlarge",
            "c6in.8xlarge",
            "c6in.12xlarge",
            "c6in.16xlarge",
            "c6in.24xlarge",
            "c6in.32xlarge",
            "m6in.large",
            "m6in.xlarge",
            "m6in.2xlarge",
            "m6in.4xlarge",
            "m6in.8xlarge",
            "m6in.12xlarge",
            "m6in.16xlarge",
            "m6in.24xlarge",
            "m6in.32xlarge",
            "m6idn.large",
            "m6idn.xlarge",
            "m6idn.2xlarge",
            "m6idn.4xlarge",
            "m6idn.8xlarge",
            "m6idn.12xlarge",
            "m6idn.16xlarge",
            "m6idn.24xlarge",
            "m6idn.32xlarge",
            "r6in.large",
            "r6in.xlarge",
            "r6in.2xlarge",
            "r6in.4xlarge",
            "r6in.8xlarge",
            "r6in.12xlarge",
            "r6in.16xlarge",
            "r6in.24xlarge",
            "r6in.32xlarge",
            "r6idn.large",
            "r6idn.xlarge",
            "r6idn.2xlarge",
            "r6idn.4xlarge",
            "r6idn.8xlarge",
            "r6idn.12xlarge",
            "r6idn.16xlarge",
            "r6idn.24xlarge",
            "r6idn.32xlarge",
            "c7g.metal",
            "m7g.medium",
            "m7g.large",
            "m7g.xlarge",
            "m7g.2xlarge",
            "m7g.4xlarge",
            "m7g.8xlarge",
            "m7g.12xlarge",
            "m7g.16xlarge",
            "m7g.metal",
            "r7g.medium",
            "r7g.large",
            "r7g.xlarge",
            "r7g.2xlarge",
            "r7g.4xlarge",
            "r7g.8xlarge",
            "r7g.12xlarge",
            "r7g.16xlarge",
            "r7g.metal",
            "c6in.metal",
            "m6in.metal",
            "m6idn.metal",
            "r6in.metal",
            "r6idn.metal",
            "inf2.xlarge",
            "inf2.8xlarge",
            "inf2.24xlarge",
            "inf2.48xlarge",
            "trn1n.32xlarge",
            "i4g.large",
            "i4g.xlarge",
            "i4g.2xlarge",
            "i4g.4xlarge",
            "i4g.8xlarge",
            "i4g.16xlarge",
            "hpc7g.4xlarge",
            "hpc7g.8xlarge",
            "hpc7g.16xlarge",
            "c7gn.medium",
            "c7gn.large",
            "c7gn.xlarge",
            "c7gn.2xlarge",
            "c7gn.4xlarge",
            "c7gn.8xlarge",
            "c7gn.12xlarge",
            "c7gn.16xlarge",
            "p5.48xlarge",
            "m7i.large",
            "m7i.xlarge",
            "m7i.2xlarge",
            "m7i.4xlarge",
            "m7i.8xlarge",
            "m7i.12xlarge",
            "m7i.16xlarge",
            "m7i.24xlarge",
            "m7i.48xlarge",
            "m7i-flex.large",
            "m7i-flex.xlarge",
            "m7i-flex.2xlarge",
            "m7i-flex.4xlarge",
            "m7i-flex.8xlarge",
            "m7a.medium",
            "m7a.large",
            "m7a.xlarge",
            "m7a.2xlarge",
            "m7a.4xlarge",
            "m7a.8xlarge",
            "m7a.12xlarge",
            "m7a.16xlarge",
            "m7a.24xlarge",
            "m7a.32xlarge",
            "m7a.48xlarge",
            "m7a.metal-48xl",
            "hpc7a.12xlarge",
            "hpc7a.24xlarge",
            "hpc7a.48xlarge",
            "hpc7a.96xlarge",
            "c7gd.medium",
            "c7gd.large",
            "c7gd.xlarge",
            "c7gd.2xlarge",
            "c7gd.4xlarge",
            "c7gd.8xlarge",
            "c7gd.12xlarge",
            "c7gd.16xlarge",
            "m7gd.medium",
            "m7gd.large",
            "m7gd.xlarge",
            "m7gd.2xlarge",
            "m7gd.4xlarge",
            "m7gd.8xlarge",
            "m7gd.12xlarge",
            "m7gd.16xlarge",
            "r7gd.medium",
            "r7gd.large",
            "r7gd.xlarge",
            "r7gd.2xlarge",
            "r7gd.4xlarge",
            "r7gd.8xlarge",
            "r7gd.12xlarge",
            "r7gd.16xlarge",
            "r7a.medium",
            "r7a.large",
            "r7a.xlarge",
            "r7a.2xlarge",
            "r7a.4xlarge",
            "r7a.8xlarge",
            "r7a.12xlarge",
            "r7a.16xlarge",
            "r7a.24xlarge",
            "r7a.32xlarge",
            "r7a.48xlarge",
            "c7i.large",
            "c7i.xlarge",
            "c7i.2xlarge",
            "c7i.4xlarge",
            "c7i.8xlarge",
            "c7i.12xlarge",
            "c7i.16xlarge",
            "c7i.24xlarge",
            "c7i.48xlarge",
            "mac2-m2pro.metal",
            "r7iz.large",
            "r7iz.xlarge",
            "r7iz.2xlarge",
            "r7iz.4xlarge",
            "r7iz.8xlarge",
            "r7iz.12xlarge",
            "r7iz.16xlarge",
            "r7iz.32xlarge",
            "c7a.medium",
            "c7a.large",
            "c7a.xlarge",
            "c7a.2xlarge",
            "c7a.4xlarge",
            "c7a.8xlarge",
            "c7a.12xlarge",
            "c7a.16xlarge",
            "c7a.24xlarge",
            "c7a.32xlarge",
            "c7a.48xlarge",
            "c7a.metal-48xl",
            "r7a.metal-48xl",
            "r7i.large",
            "r7i.xlarge",
            "r7i.2xlarge",
            "r7i.4xlarge",
            "r7i.8xlarge",
            "r7i.12xlarge",
            "r7i.16xlarge",
            "r7i.24xlarge",
            "r7i.48xlarge",
            "dl2q.24xlarge",
            "mac2-m2.metal",
            "i4i.12xlarge",
            "i4i.24xlarge",
            "c7i.metal-24xl",
            "c7i.metal-48xl",
            "m7i.metal-24xl",
            "m7i.metal-48xl",
            "r7i.metal-24xl",
            "r7i.metal-48xl",
        ]
    ] = None
    #: The name of the key pair.
    KeyName: Optional[str] = None
    #: The monitoring for the instance.
    Monitoring: Optional[LaunchTemplatesMonitoring] = None
    #: The placement of the instance.
    Placement: Optional[LaunchTemplatePlacement] = None
    #: The ID of the RAM disk, if applicable.
    RamDiskId: Optional[str] = None
    #: If set to ``true``, indicates that the instance cannot be terminated using the
    #: Amazon EC2 console, command line tool, or API.
    DisableApiTermination: Optional[bool] = None
    #: Indicates whether an instance stops or terminates when you initiate shutdown
    #: from the instance (using the operating system command for system shutdown).
    InstanceInitiatedShutdownBehavior: Optional[Literal["stop", "terminate"]] = None
    #: The user data for the instance.
    UserData: Optional[str] = None
    #: The tags that are applied to the resources that are created during instance
    #: launch.
    TagSpecifications: Optional[List["LaunchTemplateTagSpecification"]] = None
    #: The elastic GPU specification.
    ElasticGpuSpecifications: Optional[List["ElasticGpuSpecificationResponse"]] = None
    #: An elastic inference accelerator to associate with the instance. Elastic
    #: inference accelerators are a resource you can attach to your Amazon EC2
    #: instances to accelerate your Deep Learning (DL) inference workloads.
    ElasticInferenceAccelerators: Optional[
        List["LaunchTemplateElasticInferenceAcceleratorResponse"]
    ] = None
    #: The security group IDs.
    SecurityGroupIds: Optional[List[str]] = None
    #: The security group names.
    SecurityGroups: Optional[List[str]] = None
    #: The market (purchasing) option for the instances.
    InstanceMarketOptions: Optional[LaunchTemplateInstanceMarketOptions] = None
    #: The credit option for CPU usage of the instance.
    CreditSpecification: Optional[InstanceCreditSpecification] = None
    #: The CPU options for the instance. For more information, see `Optimizing CPU
    #: options <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-
    #: cpu.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    CpuOptions: Optional[LaunchTemplateCpuOptions] = None
    #: Information about the Capacity Reservation targeting option.
    CapacityReservationSpecification: Optional[
        LaunchTemplateCapacityReservationSpecificationResponse
    ] = None
    #: The license configurations.
    LicenseSpecifications: Optional[List["LaunchTemplateLicenseConfiguration"]] = None
    #: Indicates whether an instance is configured for hibernation. For more
    #: information, see `Hibernate your instance
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_ in the
    #: *Amazon Elastic Compute Cloud User Guide*.
    HibernationOptions: Optional[LaunchTemplateHibernationOptions] = None
    #: The metadata options for the instance. For more information, see `Instance
    #: metadata and user data
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    #: metadata.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    MetadataOptions: Optional[LaunchTemplateInstanceMetadataOptions] = None
    #: Indicates whether the instance is enabled for Amazon Web Services Nitro
    #: Enclaves.
    EnclaveOptions: Optional[LaunchTemplateEnclaveOptions] = None
    #: The attributes for the instance types. When you specify instance attributes,
    #: Amazon EC2 will identify instance types with these attributes.
    InstanceRequirements: Optional[LaunchTemplateInstanceRequirements] = None
    #: The options for the instance hostname.
    PrivateDnsNameOptions: Optional[LaunchTemplatePrivateDnsNameOptions] = None
    #: The maintenance options for your instance.
    MaintenanceOptions: Optional[LaunchTemplateInstanceMaintenanceOptions] = None
    #: Indicates whether the instance is enabled for stop protection. For more
    #: information, see `Stop protection <https://docs.aws.amazon.com/AWSEC2/latest/Us
    #: erGuide/Stop_Start.html#Using_StopProtection>`_ in the *Amazon Elastic Compute
    #: Cloud User Guide*.
    DisableApiStop: Optional[bool] = None


class LaunchTemplateVersion(PrimaryBoto3Model):
    """
    Describes a launch template version.
    """

    objects: ClassVar[Boto3ModelManager] = LaunchTemplateVersionManager()

    #: The ID of the launch template.
    LaunchTemplateId: Optional[str] = None
    #: The name of the launch template.
    LaunchTemplateName: Optional[str] = None
    #: The version number.
    VersionNumber: int = Field(default=None, frozen=True)
    #: The description for the version.
    VersionDescription: Optional[str] = None
    #: The time the version was created.
    CreateTime: datetime = Field(default=None, frozen=True)
    #: The principal that created the version.
    CreatedBy: str = Field(default=None, frozen=True)
    #: Indicates whether the version is the default version.
    DefaultVersion: bool = Field(default=None, frozen=True)
    #: Information about the launch template.
    LaunchTemplateData: Optional[ResponseLaunchTemplateData] = None

    @property
    def name(self) -> Optional[str]:
        """
        Return the name of the model.   This is the value of the
        :py:attr:`LaunchTemplateName` attribute.

        Returns:
            The name of the model instance.
        """
        return self.LaunchTemplateName

    @property
    def pk(self) -> OrderedDict[str, Any]:
        return OrderedDict(
            {
                "LaunchTemplateId": self.LaunchTemplateId,
                "Version": self.VersionNumber,
            }
        )

    @cached_property
    def launch_template(self) -> Optional["LaunchTemplate"]:
        """
        Return the :py:class:`LaunchTemplate` object that this version belongs
        to, if any.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                }
            )
        except AttributeError:
            return None
        return LaunchTemplate.objects.get(**pk)


# =======================
# Request/Response Models
# =======================


class DescribeVpcsResult(Boto3Model):
    #: Information about one or more VPCs.
    Vpcs: Optional[List["Vpc"]] = None
    #: The token to include in another request to get the next page of items. This
    #: value is ``null`` when there are no more items to return.
    NextToken: Optional[str] = None


class AttributeBooleanValue(Boto3Model):
    """
    Indicates whether the instances launched in the VPC get DNS hostnames.

    If this
    attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they
    do not.
    """

    #: The attribute value. The valid values are ``true`` or ``false``.
    Value: Optional[bool] = None


class DescribeVpcAttributeResult(Boto3Model):
    #: The ID of the VPC.
    VpcId: Optional[str] = None
    #: Indicates whether the instances launched in the VPC get DNS hostnames. If this
    #: attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they
    #: do not.
    EnableDnsHostnames: Optional[AttributeBooleanValue] = None
    #: Indicates whether DNS resolution is enabled for the VPC. If this attribute is
    #: ``true``, the Amazon DNS server resolves DNS hostnames for your instances to
    #: their corresponding IP addresses; otherwise, it does not.
    EnableDnsSupport: Optional[AttributeBooleanValue] = None
    #: Indicates whether Network Address Usage metrics are enabled for your VPC.
    EnableNetworkAddressUsageMetrics: Optional[AttributeBooleanValue] = None


class DescribeSubnetsResult(Boto3Model):
    #: Information about one or more subnets.
    Subnets: Optional[List["Subnet"]] = None
    #: The token to include in another request to get the next page of items. This
    #: value is ``null`` when there are no more items to return.
    NextToken: Optional[str] = None


class TagSpecification(TagsDictMixin, Boto3Model):
    """
    The tags to apply to a resource when the resource is being created. When
    you specify a tag, you must specify the resource type to tag, otherwise the
    request will fail.

    The ``Valid Values`` lists all the resource types that can be tagged. However,
    the action you're using might not support tagging all of these resource types.
    If you try to tag a resource type that is unsupported for the action you're
    using, you'll get an error.
    """

    tag_class: ClassVar[Type] = Tag
    #: The type of resource to tag on creation.
    ResourceType: Optional[
        Literal[
            "capacity-reservation",
            "client-vpn-endpoint",
            "customer-gateway",
            "carrier-gateway",
            "coip-pool",
            "dedicated-host",
            "dhcp-options",
            "egress-only-internet-gateway",
            "elastic-ip",
            "elastic-gpu",
            "export-image-task",
            "export-instance-task",
            "fleet",
            "fpga-image",
            "host-reservation",
            "image",
            "import-image-task",
            "import-snapshot-task",
            "instance",
            "instance-event-window",
            "internet-gateway",
            "ipam",
            "ipam-pool",
            "ipam-scope",
            "ipv4pool-ec2",
            "ipv6pool-ec2",
            "key-pair",
            "launch-template",
            "local-gateway",
            "local-gateway-route-table",
            "local-gateway-virtual-interface",
            "local-gateway-virtual-interface-group",
            "local-gateway-route-table-vpc-association",
            "local-gateway-route-table-virtual-interface-group-association",
            "natgateway",
            "network-acl",
            "network-interface",
            "network-insights-analysis",
            "network-insights-path",
            "network-insights-access-scope",
            "network-insights-access-scope-analysis",
            "placement-group",
            "prefix-list",
            "replace-root-volume-task",
            "reserved-instances",
            "route-table",
            "security-group",
            "security-group-rule",
            "snapshot",
            "spot-fleet-request",
            "spot-instances-request",
            "subnet",
            "subnet-cidr-reservation",
            "traffic-mirror-filter",
            "traffic-mirror-session",
            "traffic-mirror-target",
            "transit-gateway",
            "transit-gateway-attachment",
            "transit-gateway-connect-peer",
            "transit-gateway-multicast-domain",
            "transit-gateway-policy-table",
            "transit-gateway-route-table",
            "transit-gateway-route-table-announcement",
            "volume",
            "vpc",
            "vpc-endpoint",
            "vpc-endpoint-connection",
            "vpc-endpoint-service",
            "vpc-endpoint-service-permission",
            "vpc-peering-connection",
            "vpn-connection",
            "vpn-gateway",
            "vpc-flow-log",
            "capacity-reservation-fleet",
            "traffic-mirror-filter-rule",
            "vpc-endpoint-connection-device-type",
            "verified-access-instance",
            "verified-access-group",
            "verified-access-endpoint",
            "verified-access-policy",
            "verified-access-trust-provider",
            "vpn-connection-device-type",
            "vpc-block-public-access-exclusion",
            "ipam-resource-discovery",
            "ipam-resource-discovery-association",
            "instance-connect-endpoint",
        ]
    ] = None
    #: The tags to apply to the resource.
    Tags: Optional[List[Tag]] = None


class CreateSecurityGroupResult(TagsDictMixin, Boto3Model):
    tag_class: ClassVar[Type] = Tag
    #: The ID of the security group.
    GroupId: Optional[str] = None
    #: The tags assigned to the security group.
    Tags: Optional[List[Tag]] = None


class DescribeSecurityGroupsResult(Boto3Model):
    #: Information about the security groups.
    SecurityGroups: Optional[List["SecurityGroup"]] = None
    #: The token to include in another request to get the next page of items. This
    #: value is ``null`` when there are no more items to return.
    NextToken: Optional[str] = None


class RevokeSecurityGroupIngressResult(Boto3Model):
    #: Returns ``true`` if the request succeeds; otherwise, returns an error.
    Return: Optional[bool] = None
    #: The inbound rules that were unknown to the service. In some cases,
    #: ``unknownIpPermissionSet`` might be in a different format from the request
    #: parameter.
    UnknownIpPermissions: Optional[List["IpPermission"]] = None


class ReferencedSecurityGroup(Boto3Model):
    """
    Describes the security group that is referenced in the rule.
    """

    #: The ID of the security group.
    GroupId: Optional[str] = None
    #: The status of a VPC peering connection, if applicable.
    PeeringStatus: Optional[str] = None
    #: The Amazon Web Services account ID.
    UserId: Optional[str] = None
    #: The ID of the VPC.
    VpcId: Optional[str] = None
    #: The ID of the VPC peering connection (if applicable).
    VpcPeeringConnectionId: Optional[str] = None


class SecurityGroupRule(TagsDictMixin, Boto3Model):
    """
    Describes a security group rule.
    """

    tag_class: ClassVar[Type] = Tag
    #: The ID of the security group rule.
    SecurityGroupRuleId: Optional[str] = None
    #: The ID of the security group.
    GroupId: Optional[str] = None
    #: The ID of the Amazon Web Services account that owns the security group.
    GroupOwnerId: Optional[str] = None
    #: Indicates whether the security group rule is an outbound rule.
    IsEgress: Optional[bool] = None
    #: The IP protocol name (``tcp``, ``udp``, ``icmp``, ``icmpv6``) or number (see
    #: `Protocol Numbers <http://www.iana.org/assignments/protocol-numbers/protocol-
    #: numbers.xhtml>`_).
    IpProtocol: Optional[str] = None
    #: If the protocol is TCP or UDP, this is the start of the port range. If the
    #: protocol is ICMP or ICMPv6, this is the type number. A value of -1 indicates
    #: all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify
    #: all ICMP/ICMPv6 codes.
    FromPort: Optional[int] = None
    #: If the protocol is TCP or UDP, this is the end of the port range. If the
    #: protocol is ICMP or ICMPv6, this is the type number. A value of -1 indicates
    #: all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify
    #: all ICMP/ICMPv6 codes.
    ToPort: Optional[int] = None
    #: The IPv4 CIDR range.
    CidrIpv4: Optional[str] = None
    #: The IPv6 CIDR range.
    CidrIpv6: Optional[str] = None
    #: The ID of the prefix list.
    PrefixListId: Optional[str] = None
    #: Describes the security group that is referenced in the rule.
    ReferencedGroupInfo: Optional[ReferencedSecurityGroup] = None
    #: The security group rule description.
    Description: Optional[str] = None
    #: The tags applied to the security group rule.
    Tags: Optional[List[Tag]] = None


class AuthorizeSecurityGroupIngressResult(Boto3Model):
    #: Returns ``true`` if the request succeeds; otherwise, returns an error.
    Return: Optional[bool] = None
    #: Information about the inbound (ingress) security group rules that were added.
    SecurityGroupRules: Optional[List["SecurityGroupRule"]] = None


class CreateNetworkAclResult(Boto3Model):
    #: Information about the network ACL.
    NetworkAclInstance: NetworkAcl = Field(
        default=None, serialization_alias="NetworkAcl"
    )


class DescribeNetworkAclsResult(Boto3Model):
    #: Information about one or more network ACLs.
    NetworkAcls: Optional[List["NetworkAcl"]] = None
    #: The token to include in another request to get the next page of items. This
    #: value is ``null`` when there are no more items to return.
    NextToken: Optional[str] = None


class ElasticGpuSpecification(Boto3Model):
    """
    A specification for an Elastic Graphics accelerator.
    """

    #: The type of Elastic Graphics accelerator. For more information about the values
    #: to specify for ``Type``, see `Elastic Graphics Basics
    #: <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-
    #: graphics.html#elastic-graphics-basics>`_, specifically the Elastic Graphics
    #: accelerator column, in the *Amazon Elastic Compute Cloud User Guide for Windows
    #: Instances*.
    Type: str


class ElasticInferenceAccelerator(Boto3Model):
    """
    Describes an elastic inference accelerator.
    """

    #: The type of elastic inference accelerator. The possible values are
    #: ``eia1.medium``, ``eia1.large``, ``eia1.xlarge``, ``eia2.medium``,
    #: ``eia2.large``, and ``eia2.xlarge``.
    Type: str
    #: The number of elastic inference accelerators to attach to the instance.
    Count: Optional[int] = None


class EC2LaunchTemplateSpecification(Boto3Model):
    """
    The launch template to use to launch the instances.

    Any parameters that you specify in RunInstances override the same
    parameters in the launch template. You can specify either the name or ID of
    a launch template, but not both.
    """

    #: The ID of the launch template.
    LaunchTemplateId: Optional[str] = None
    #: The name of the launch template.
    LaunchTemplateName: Optional[str] = None
    #: The launch template version number, ``$Latest``, or ``$Default``.
    Version: Optional[str] = None


class SpotMarketOptions(Boto3Model):
    """
    The options for Spot Instances.
    """

    #: The maximum hourly price that you're willing to pay for a Spot Instance. We do
    #: not recommend using this parameter because it can lead to increased
    #: interruptions. If you do not specify this parameter, you will pay the current
    #: Spot price.
    MaxPrice: Optional[str] = None
    #: The Spot Instance request type. For `RunInstances <https://docs.aws.amazon.com/
    #: AWSEC2/latest/APIReference/API_RunInstances>`_, persistent Spot Instance
    #: requests are only supported when the instance interruption behavior is either
    #: ``hibernate`` or ``stop``.
    SpotInstanceType: Optional[Literal["one-time", "persistent"]] = None
    #: Deprecated.
    BlockDurationMinutes: Optional[int] = None
    #: The end date of the request, in UTC format (*YYYY*-*MM*-*DD*T*HH*:*MM*:*SS*Z).
    #: Supported only for persistent requests.
    ValidUntil: Optional[datetime] = None
    #: The behavior when a Spot Instance is interrupted.
    InstanceInterruptionBehavior: Optional[
        Literal["hibernate", "stop", "terminate"]
    ] = None


class InstanceMarketOptionsRequest(Boto3Model):
    """
    The market (purchasing) option for the instances.

    For RunInstances, persistent Spot Instance requests are only supported when
    **InstanceInterruptionBehavior** is set to either ``hibernate`` or ``stop``.
    """

    #: The market type.
    MarketType: Optional[Literal["spot", "capacity-block"]] = None
    #: The options for Spot Instances.
    SpotOptions: Optional[SpotMarketOptions] = None


class CreditSpecificationRequest(Boto3Model):
    """The credit option for CPU usage of the burstable performance instance. Valid
    values are ``standard`` and ``unlimited``. To change this attribute after
    launch, use  `ModifyInstanceCreditSpecification <https://docs.aws.amazon.com/AW
    SEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html>`_. For more
    information, see `Burstable performance
    instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-
    performance-instances.html>`_ in the *Amazon EC2 User Guide*.

    Default: ``standard`` (T2 instances) or ``unlimited`` (T3/T3a/T4g instances)

    For T3 instances with ``host`` tenancy, only ``standard`` is supported.
    """

    #: The credit option for CPU usage of a T instance.
    CpuCredits: str


class LicenseConfigurationRequest(Boto3Model):
    """
    Describes a license configuration.
    """

    #: The Amazon Resource Name (ARN) of the license configuration.
    LicenseConfigurationArn: Optional[str] = None


class EbsBlockDevice(Boto3Model):
    """
    Parameters used to automatically set up EBS volumes when the instance is
    launched.
    """

    #: Indicates whether the EBS volume is deleted on instance termination. For more
    #: information, see `Preserving Amazon EBS volumes on instance termination
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-
    #: instances.html#preserving-volumes-on-termination>`_ in the *Amazon EC2 User
    #: Guide*.
    DeleteOnTermination: Optional[bool] = None
    #: The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and
    #: ``io2`` volumes, this represents the number of IOPS that are provisioned for
    #: the volume. For ``gp2`` volumes, this represents the baseline performance of
    #: the volume and the rate at which the volume accumulates I/O credits for
    #: bursting.
    Iops: Optional[int] = None
    #: The ID of the snapshot.
    SnapshotId: Optional[str] = None
    #: The size of the volume, in GiBs. You must specify either a snapshot ID or a
    #: volume size. If you specify a snapshot, the default is the snapshot size. You
    #: can specify a volume size that is equal to or larger than the snapshot size.
    VolumeSize: Optional[int] = None
    #: The volume type. For more information, see `Amazon EBS volume types
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html>`_ in
    #: the *Amazon EC2 User Guide*.
    VolumeType: Optional[
        Literal["standard", "io1", "io2", "gp2", "sc1", "st1", "gp3"]
    ] = None
    #: Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK
    #: under which the EBS volume is encrypted.
    KmsKeyId: Optional[str] = None
    #: The throughput that the volume supports, in MiB/s.
    Throughput: Optional[int] = None
    #: The ARN of the Outpost on which the snapshot is stored.
    OutpostArn: Optional[str] = None
    #: Indicates whether the encryption state of an EBS volume is changed while being
    #: restored from a backing snapshot. The effect of setting the encryption state to
    #: ``true`` depends on the volume origin (new or from a snapshot), starting
    #: encryption state, ownership, and whether encryption by default is enabled. For
    #: more information, see `Amazon EBS encryption <https://docs.aws.amazon.com/AWSEC
    #: 2/latest/UserGuide/EBSEncryption.html#encryption-parameters>`_ in the *Amazon
    #: EC2 User Guide*.
    Encrypted: Optional[bool] = None


class EC2BlockDeviceMapping(Boto3Model):
    """
    Describes a block device mapping, which defines the EBS volumes and
    instance store volumes to attach to an instance at launch.
    """

    #: The device name (for example, ``/dev/sdh`` or ``xvdh``).
    DeviceName: Optional[str] = None
    #: The virtual device name (``ephemeral``N). Instance store volumes are numbered
    #: starting from 0. An instance type with 2 available instance store volumes can
    #: specify mappings for ``ephemeral0`` and ``ephemeral1``. The number of available
    #: instance store volumes depends on the instance type. After you connect to the
    #: instance, you must mount the volume.
    VirtualName: Optional[str] = None
    #: Parameters used to automatically set up EBS volumes when the instance is
    #: launched.
    Ebs: Optional[EbsBlockDevice] = None
    #: To omit the device from the block device mapping, specify an empty string. When
    #: this property is specified, the device is removed from the block device mapping
    #: regardless of the assigned value.
    NoDevice: Optional[str] = None


class RunInstancesMonitoringEnabled(Boto3Model):
    """
    Specifies whether detailed monitoring is enabled for the instance.
    """

    #: Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring
    #: is enabled.
    Enabled: bool


class IamInstanceProfileSpecification(Boto3Model):
    """
    The name or Amazon Resource Name (ARN) of an IAM instance profile.
    """

    #: The Amazon Resource Name (ARN) of the instance profile.
    Arn: Optional[str] = None
    #: The name of the instance profile.
    Name: Optional[str] = None


class Ipv4PrefixSpecificationRequest(Boto3Model):
    """
    Describes the IPv4 prefix option for a network interface.
    """

    #: The IPv4 prefix. For information, see  `Assigning prefixes to Amazon EC2
    #: network interfaces
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix- eni.html>`_ in
    #: the *Amazon Elastic Compute Cloud User Guide*.
    Ipv4Prefix: Optional[str] = None


class Ipv6PrefixSpecificationRequest(Boto3Model):
    """
    Describes the IPv4 prefix option for a network interface.
    """

    #: The IPv6 prefix.
    Ipv6Prefix: Optional[str] = None


class EnaSrdUdpSpecificationRequest(Boto3Model):
    """
    Contains ENA Express settings for UDP network traffic in your launch
    template.
    """

    #: Indicates whether UDP traffic uses ENA Express for your instance. To ensure
    #: that UDP traffic can use ENA Express when you launch an instance, you must also
    #: set **EnaSrdEnabled** in the **EnaSrdSpecificationRequest** to ``true`` in your
    #: launch template.
    EnaSrdUdpEnabled: Optional[bool] = None


class EnaSrdSpecificationRequest(Boto3Model):
    """
    Specifies the ENA Express settings for the network interface that's
    attached to the instance.
    """

    #: Specifies whether ENA Express is enabled for the network interface when you
    #: launch an instance from your launch template.
    EnaSrdEnabled: Optional[bool] = None
    #: Contains ENA Express settings for UDP network traffic in your launch template.
    EnaSrdUdpSpecification: Optional[EnaSrdUdpSpecificationRequest] = None


class ConnectionTrackingSpecificationRequest(Boto3Model):
    """
    A security group connection tracking specification that enables you to set
    the timeout for connection tracking on an Elastic network interface.

    For more
    information, see `Connection tracking
    timeouts <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon Elastic
    Compute Cloud User Guide*.
    """

    #: Timeout (in seconds) for idle TCP connections in an established state. Min: 60
    #: seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended:
    #: Less than 432000 seconds.
    TcpEstablishedTimeout: Optional[int] = None
    #: Timeout (in seconds) for idle UDP flows classified as streams which have seen
    #: more than one request-response transaction. Min: 60 seconds. Max: 180 seconds
    #: (3 minutes). Default: 180 seconds.
    UdpStreamTimeout: Optional[int] = None
    #: Timeout (in seconds) for idle UDP flows that have seen traffic only in a single
    #: direction or a single request-response transaction. Min: 30 seconds. Max: 60
    #: seconds. Default: 30 seconds.
    UdpTimeout: Optional[int] = None


class InstanceNetworkInterfaceSpecification(Boto3Model):
    """
    Describes a network interface.
    """

    #: Indicates whether to assign a public IPv4 address to an instance you launch in
    #: a VPC. The public IP address can only be assigned to a network interface for
    #: eth0, and can only be assigned to a new network interface, not an existing one.
    #: You cannot specify more than one network interface in the request. If launching
    #: into a default subnet, the default value is ``true``.
    AssociatePublicIpAddress: Optional[bool] = None
    #: If set to ``true``, the interface is deleted when the instance is terminated.
    #: You can specify ``true`` only if creating a new network interface when
    #: launching an instance.
    DeleteOnTermination: Optional[bool] = None
    #: The description of the network interface. Applies only if creating a network
    #: interface when launching an instance.
    Description: Optional[str] = None
    #: The position of the network interface in the attachment order. A primary
    #: network interface has a device index of 0.
    DeviceIndex: Optional[int] = None
    #: The IDs of the security groups for the network interface. Applies only if
    #: creating a network interface when launching an instance.
    Groups: Optional[List[str]] = None
    #: A number of IPv6 addresses to assign to the network interface. Amazon EC2
    #: chooses the IPv6 addresses from the range of the subnet. You cannot specify
    #: this option and the option to assign specific IPv6 addresses in the same
    #: request. You can specify this option if you've specified a minimum number of
    #: instances to launch.
    Ipv6AddressCount: Optional[int] = None
    #: The IPv6 addresses to assign to the network interface. You cannot specify this
    #: option and the option to assign a number of IPv6 addresses in the same request.
    #: You cannot specify this option if you've specified a minimum number of
    #: instances to launch.
    Ipv6Addresses: Optional[List["InstanceIpv6Address"]] = None
    #: The ID of the network interface.
    NetworkInterfaceId: Optional[str] = None
    #: The private IPv4 address of the network interface. Applies only if creating a
    #: network interface when launching an instance. You cannot specify this option if
    #: you're launching more than one instance in a `RunInstances <https://docs.aws.am
    #: azon.com/AWSEC2/latest/APIReference/API_RunInstances.html>`_ request.
    PrivateIpAddress: Optional[str] = None
    #: The private IPv4 addresses to assign to the network interface. Only one private
    #: IPv4 address can be designated as primary. You cannot specify this option if
    #: you're launching more than one instance in a `RunInstances <https://docs.aws.am
    #: azon.com/AWSEC2/latest/APIReference/API_RunInstances.html>`_ request.
    PrivateIpAddresses: Optional[List["PrivateIpAddressSpecification"]] = None
    #: The number of secondary private IPv4 addresses. You can't specify this option
    #: and specify more than one private IP address using the private IP addresses
    #: option. You cannot specify this option if you're launching more than one
    #: instance in a `RunInstances <https://docs.aws.amazon.com/AWSEC2/latest/APIRefer
    #: ence/API_RunInstances.html>`_ request.
    SecondaryPrivateIpAddressCount: Optional[int] = None
    #: The ID of the subnet associated with the network interface. Applies only if
    #: creating a network interface when launching an instance.
    SubnetId: Optional[str] = None
    #: Indicates whether to assign a carrier IP address to the network interface.
    AssociateCarrierIpAddress: Optional[bool] = None
    #: The type of network interface.
    InterfaceType: Optional[str] = None
    #: The index of the network card. Some instance types support multiple network
    #: cards. The primary network interface must be assigned to network card index 0.
    #: The default is network card index 0.
    NetworkCardIndex: Optional[int] = None
    #: The IPv4 delegated prefixes to be assigned to the network interface. You cannot
    #: use this option if you use the ``Ipv4PrefixCount`` option.
    Ipv4Prefixes: Optional[List["Ipv4PrefixSpecificationRequest"]] = None
    #: The number of IPv4 delegated prefixes to be automatically assigned to the
    #: network interface. You cannot use this option if you use the ``Ipv4Prefix``
    #: option.
    Ipv4PrefixCount: Optional[int] = None
    #: The IPv6 delegated prefixes to be assigned to the network interface. You cannot
    #: use this option if you use the ``Ipv6PrefixCount`` option.
    Ipv6Prefixes: Optional[List["Ipv6PrefixSpecificationRequest"]] = None
    #: The number of IPv6 delegated prefixes to be automatically assigned to the
    #: network interface. You cannot use this option if you use the ``Ipv6Prefix``
    #: option.
    Ipv6PrefixCount: Optional[int] = None
    #: The primary IPv6 address of the network interface. When you enable an IPv6 GUA
    #: address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6
    #: address until the instance is terminated or the network interface is detached.
    #: For more information about primary IPv6 addresses, see `RunInstances <https://d
    #: ocs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html>`_.
    PrimaryIpv6: Optional[bool] = None
    #: Specifies the ENA Express settings for the network interface that's attached to
    #: the instance.
    EnaSrdSpecification: Optional[EnaSrdSpecificationRequest] = None
    #: A security group connection tracking specification that enables you to set the
    #: timeout for connection tracking on an Elastic network interface. For more
    #: information, see `Connection tracking timeouts
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    #: connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon Elastic
    #: Compute Cloud User Guide*.
    ConnectionTrackingSpecification: Optional[
        ConnectionTrackingSpecificationRequest
    ] = None


class CpuOptionsRequest(Boto3Model):
    """
    The CPU options for the instance.

    For more information, see
    `Optimize CPU options <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-
    cpu.html>`_ in the *Amazon EC2 User Guide*.
    """

    #: The number of CPU cores for the instance.
    CoreCount: Optional[int] = None
    #: The number of threads per CPU core. To disable multithreading for the instance,
    #: specify a value of ``1``. Otherwise, specify the default value of ``2``.
    ThreadsPerCore: Optional[int] = None
    #: Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is
    #: supported with M6a, R6a, and C6a instance types only. For more information, see
    #: `AMD SEV-SNP <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-
    #: snp.html>`_.
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = None


class EC2CapacityReservationTarget(Boto3Model):
    """
    Information about the target Capacity Reservation or Capacity Reservation
    group.
    """

    #: The ID of the Capacity Reservation in which to run the instance.
    CapacityReservationId: Optional[str] = None
    #: The ARN of the Capacity Reservation resource group in which to run the
    #: instance.
    CapacityReservationResourceGroupArn: Optional[str] = None


class CapacityReservationSpecification(Boto3Model):
    """
    Information about the Capacity Reservation targeting option.

    If you do not
    specify this parameter, the instance's Capacity Reservation preference defaults
    to ``open``, which enables it to run in any open Capacity Reservation that has
    matching attributes (instance type, platform, Availability Zone).
    """

    #: Indicates the instance's Capacity Reservation preferences. Possible preferences
    #: include:
    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    #: Information about the target Capacity Reservation or Capacity Reservation
    #: group.
    CapacityReservationTarget: Optional[EC2CapacityReservationTarget] = None


class HibernationOptionsRequest(Boto3Model):
    """Indicates whether an instance is enabled for hibernation. This parameter is
    valid only if the instance meets the `hibernation
    prerequisites <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-
    prerequisites.html>`_. For more information, see `Hibernate your
    instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_
    in the *Amazon EC2 User Guide*.

    You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same
    instance.
    """

    #: Set to ``true`` to enable your instance for hibernation.
    Configured: Optional[bool] = None


class InstanceMetadataOptionsRequest(Boto3Model):
    """
    The metadata options for the instance.

    For more information, see
    `Instance metadata and user data <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    metadata.html>`_.
    """

    #: IMDSv2 uses token-backed sessions. Set the use of HTTP tokens to ``optional``
    #: (in other words, set the use of IMDSv2 to ``optional``) or ``required`` (in
    #: other words, set the use of IMDSv2 to ``required``).
    HttpTokens: Optional[Literal["optional", "required"]] = None
    #: The desired HTTP PUT response hop limit for instance metadata requests. The
    #: larger the number, the further instance metadata requests can travel.
    HttpPutResponseHopLimit: Optional[int] = None
    #: Enables or disables the HTTP metadata endpoint on your instances.
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    #: Enables or disables the IPv6 endpoint for the instance metadata service.
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    #: Set to ``enabled`` to allow access to instance tags from the instance metadata.
    #: Set to ``disabled`` to turn off access to instance tags from the instance
    #: metadata. For more information, see `Work with instance tags using the instance
    #: metadata <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#w
    #: ork-with-tags-in-IMDS>`_.
    InstanceMetadataTags: Optional[Literal["disabled", "enabled"]] = None


class EnclaveOptionsRequest(Boto3Model):
    """Indicates whether the instance is enabled for Amazon Web Services Nitro
    Enclaves. For more information, see `What is Amazon Web Services Nitro
    Enclaves? <https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html>`_
    in the *Amazon Web Services Nitro Enclaves User Guide*.

    You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same
    instance.
    """

    #: To enable the instance for Amazon Web Services Nitro Enclaves, set this
    #: parameter to ``true``.
    Enabled: Optional[bool] = None


class PrivateDnsNameOptionsRequest(Boto3Model):
    """
    The options for the instance hostname.

    The default values are inherited from the subnet. Applies only if creating
    a network interface, not attaching an existing one.
    """

    #: The type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS
    #: name must be based on the instance IPv4 address. For IPv6 only subnets, an
    #: instance DNS name must be based on the instance ID. For dual-stack subnets, you
    #: can specify whether DNS names use the instance IPv4 address or the instance ID.
    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS A
    #: records.
    EnableResourceNameDnsARecord: Optional[bool] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS
    #: AAAA records.
    EnableResourceNameDnsAAAARecord: Optional[bool] = None


class InstanceMaintenanceOptionsRequest(Boto3Model):
    """
    The maintenance and recovery options for the instance.
    """

    #: Disables the automatic recovery behavior of your instance or sets it to
    #: default. For more information, see `Simplified automatic recovery
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    #: recover.html#instance-configuration-recovery>`_.
    AutoRecovery: Optional[Literal["disabled", "default"]] = None


class Reservation(Boto3Model):
    """
    Describes a launch request for one or more instances, and includes owner,
    requester, and security group information that applies to all instances in
    the launch request.
    """

    #: Not supported.
    Groups: Optional[List["GroupIdentifier"]] = None
    #: The instances.
    Instances: Optional[List["Instance"]] = None
    #: The ID of the Amazon Web Services account that owns the reservation.
    OwnerId: Optional[str] = None
    #: The ID of the requester that launched the instances on your behalf (for
    #: example, Amazon Web Services Management Console or Auto Scaling).
    RequesterId: Optional[str] = None
    #: The ID of the reservation.
    ReservationId: Optional[str] = None


class DescribeInstancesResult(Boto3Model):
    #: Information about the reservations.
    Reservations: Optional[List["Reservation"]] = None
    #: The token to include in another request to get the next page of items. This
    #: value is ``null`` when there are no more items to return.
    NextToken: Optional[str] = None


class LaunchTemplateIamInstanceProfileSpecificationRequest(Boto3Model):
    """
    The name or Amazon Resource Name (ARN) of an IAM instance profile.
    """

    #: The Amazon Resource Name (ARN) of the instance profile.
    Arn: Optional[str] = None
    #: The name of the instance profile.
    Name: Optional[str] = None


class LaunchTemplateEbsBlockDeviceRequest(Boto3Model):
    """
    Parameters used to automatically set up EBS volumes when the instance is
    launched.
    """

    #: Indicates whether the EBS volume is encrypted. Encrypted volumes can only be
    #: attached to instances that support Amazon EBS encryption. If you are creating a
    #: volume from a snapshot, you can't specify an encryption value.
    Encrypted: Optional[bool] = None
    #: Indicates whether the EBS volume is deleted on instance termination.
    DeleteOnTermination: Optional[bool] = None
    #: The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and
    #: ``io2`` volumes, this represents the number of IOPS that are provisioned for
    #: the volume. For ``gp2`` volumes, this represents the baseline performance of
    #: the volume and the rate at which the volume accumulates I/O credits for
    #: bursting.
    Iops: Optional[int] = None
    #: The ARN of the symmetric Key Management Service (KMS) CMK used for encryption.
    KmsKeyId: Optional[str] = None
    #: The ID of the snapshot.
    SnapshotId: Optional[str] = None
    #: The size of the volume, in GiBs. You must specify either a snapshot ID or a
    #: volume size. The following are the supported volumes sizes for each volume
    #: type:
    VolumeSize: Optional[int] = None
    #: The volume type. For more information, see `Amazon EBS volume types
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html>`_ in
    #: the *Amazon Elastic Compute Cloud User Guide*.
    VolumeType: Optional[
        Literal["standard", "io1", "io2", "gp2", "sc1", "st1", "gp3"]
    ] = None
    #: The throughput to provision for a ``gp3`` volume, with a maximum of 1,000
    #: MiB/s.
    Throughput: Optional[int] = None


class LaunchTemplateBlockDeviceMappingRequest(Boto3Model):
    """
    Describes a block device mapping.
    """

    #: The device name (for example, /dev/sdh or xvdh).
    DeviceName: Optional[str] = None
    #: The virtual device name (ephemeralN). Instance store volumes are numbered
    #: starting from 0. An instance type with 2 available instance store volumes can
    #: specify mappings for ephemeral0 and ephemeral1. The number of available
    #: instance store volumes depends on the instance type. After you connect to the
    #: instance, you must mount the volume.
    VirtualName: Optional[str] = None
    #: Parameters used to automatically set up EBS volumes when the instance is
    #: launched.
    Ebs: Optional[LaunchTemplateEbsBlockDeviceRequest] = None
    #: To omit the device from the block device mapping, specify an empty string.
    NoDevice: Optional[str] = None


class InstanceIpv6AddressRequest(Boto3Model):
    """
    Describes an IPv6 address.
    """

    #: The IPv6 address.
    Ipv6Address: Optional[str] = None


class LaunchTemplateInstanceNetworkInterfaceSpecificationRequest(Boto3Model):
    """
    The parameters for a network interface.
    """

    #: Associates a Carrier IP address with eth0 for a new network interface.
    AssociateCarrierIpAddress: Optional[bool] = None
    #: Associates a public IPv4 address with eth0 for a new network interface.
    AssociatePublicIpAddress: Optional[bool] = None
    #: Indicates whether the network interface is deleted when the instance is
    #: terminated.
    DeleteOnTermination: Optional[bool] = None
    #: A description for the network interface.
    Description: Optional[str] = None
    #: The device index for the network interface attachment.
    DeviceIndex: Optional[int] = None
    #: The IDs of one or more security groups.
    Groups: Optional[List[str]] = None
    #: The type of network interface. To create an Elastic Fabric Adapter (EFA),
    #: specify ``efa``. For more information, see `Elastic Fabric Adapter
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html>`_ in the *Amazon
    #: Elastic Compute Cloud User Guide*.
    InterfaceType: Optional[str] = None
    #: The number of IPv6 addresses to assign to a network interface. Amazon EC2
    #: automatically selects the IPv6 addresses from the subnet range. You can't use
    #: this option if specifying specific IPv6 addresses.
    Ipv6AddressCount: Optional[int] = None
    #: One or more specific IPv6 addresses from the IPv6 CIDR block range of your
    #: subnet. You can't use this option if you're specifying a number of IPv6
    #: addresses.
    Ipv6Addresses: Optional[List["InstanceIpv6AddressRequest"]] = None
    #: The ID of the network interface.
    NetworkInterfaceId: Optional[str] = None
    #: The primary private IPv4 address of the network interface.
    PrivateIpAddress: Optional[str] = None
    #: One or more private IPv4 addresses.
    PrivateIpAddresses: Optional[List["PrivateIpAddressSpecification"]] = None
    #: The number of secondary private IPv4 addresses to assign to a network
    #: interface.
    SecondaryPrivateIpAddressCount: Optional[int] = None
    #: The ID of the subnet for the network interface.
    SubnetId: Optional[str] = None
    #: The index of the network card. Some instance types support multiple network
    #: cards. The primary network interface must be assigned to network card index 0.
    #: The default is network card index 0.
    NetworkCardIndex: Optional[int] = None
    #: One or more IPv4 prefixes to be assigned to the network interface. You cannot
    #: use this option if you use the ``Ipv4PrefixCount`` option.
    Ipv4Prefixes: Optional[List["Ipv4PrefixSpecificationRequest"]] = None
    #: The number of IPv4 prefixes to be automatically assigned to the network
    #: interface. You cannot use this option if you use the ``Ipv4Prefix`` option.
    Ipv4PrefixCount: Optional[int] = None
    #: One or more IPv6 prefixes to be assigned to the network interface. You cannot
    #: use this option if you use the ``Ipv6PrefixCount`` option.
    Ipv6Prefixes: Optional[List["Ipv6PrefixSpecificationRequest"]] = None
    #: The number of IPv6 prefixes to be automatically assigned to the network
    #: interface. You cannot use this option if you use the ``Ipv6Prefix`` option.
    Ipv6PrefixCount: Optional[int] = None
    #: The primary IPv6 address of the network interface. When you enable an IPv6 GUA
    #: address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6
    #: address until the instance is terminated or the network interface is detached.
    #: For more information about primary IPv6 addresses, see `RunInstances <https://d
    #: ocs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html>`_.
    PrimaryIpv6: Optional[bool] = None
    #: Configure ENA Express settings for your launch template.
    EnaSrdSpecification: Optional[EnaSrdSpecificationRequest] = None
    #: A security group connection tracking specification that enables you to set the
    #: timeout for connection tracking on an Elastic network interface. For more
    #: information, see `Connection tracking timeouts
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    #: connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon Elastic
    #: Compute Cloud User Guide*.
    ConnectionTrackingSpecification: Optional[
        ConnectionTrackingSpecificationRequest
    ] = None


class LaunchTemplatesMonitoringRequest(Boto3Model):
    """
    The monitoring for the instance.
    """

    #: Specify ``true`` to enable detailed monitoring. Otherwise, basic monitoring is
    #: enabled.
    Enabled: Optional[bool] = None


class LaunchTemplatePlacementRequest(Boto3Model):
    """
    The placement for the instance.
    """

    #: The Availability Zone for the instance.
    AvailabilityZone: Optional[str] = None
    #: The affinity setting for an instance on a Dedicated Host.
    Affinity: Optional[str] = None
    #: The name of the placement group for the instance.
    GroupName: Optional[str] = None
    #: The ID of the Dedicated Host for the instance.
    HostId: Optional[str] = None
    #: The tenancy of the instance. An instance with a tenancy of dedicated runs on
    #: single-tenant hardware.
    Tenancy: Optional[Literal["default", "dedicated", "host"]] = None
    #: Reserved for future use.
    SpreadDomain: Optional[str] = None
    #: The ARN of the host resource group in which to launch the instances. If you
    #: specify a host resource group ARN, omit the **Tenancy** parameter or set it to
    #: ``host``.
    HostResourceGroupArn: Optional[str] = None
    #: The number of the partition the instance should launch in. Valid only if the
    #: placement group strategy is set to ``partition``.
    PartitionNumber: Optional[int] = None
    #: The Group Id of a placement group. You must specify the Placement Group **Group
    #: Id** to launch an instance in a shared placement group.
    GroupId: Optional[str] = None


class LaunchTemplateTagSpecificationRequest(TagsDictMixin, Boto3Model):
    """
    The tags specification for the resources that are created during instance
    launch.
    """

    tag_class: ClassVar[Type] = Tag
    #: The type of resource to tag.
    ResourceType: Optional[
        Literal[
            "capacity-reservation",
            "client-vpn-endpoint",
            "customer-gateway",
            "carrier-gateway",
            "coip-pool",
            "dedicated-host",
            "dhcp-options",
            "egress-only-internet-gateway",
            "elastic-ip",
            "elastic-gpu",
            "export-image-task",
            "export-instance-task",
            "fleet",
            "fpga-image",
            "host-reservation",
            "image",
            "import-image-task",
            "import-snapshot-task",
            "instance",
            "instance-event-window",
            "internet-gateway",
            "ipam",
            "ipam-pool",
            "ipam-scope",
            "ipv4pool-ec2",
            "ipv6pool-ec2",
            "key-pair",
            "launch-template",
            "local-gateway",
            "local-gateway-route-table",
            "local-gateway-virtual-interface",
            "local-gateway-virtual-interface-group",
            "local-gateway-route-table-vpc-association",
            "local-gateway-route-table-virtual-interface-group-association",
            "natgateway",
            "network-acl",
            "network-interface",
            "network-insights-analysis",
            "network-insights-path",
            "network-insights-access-scope",
            "network-insights-access-scope-analysis",
            "placement-group",
            "prefix-list",
            "replace-root-volume-task",
            "reserved-instances",
            "route-table",
            "security-group",
            "security-group-rule",
            "snapshot",
            "spot-fleet-request",
            "spot-instances-request",
            "subnet",
            "subnet-cidr-reservation",
            "traffic-mirror-filter",
            "traffic-mirror-session",
            "traffic-mirror-target",
            "transit-gateway",
            "transit-gateway-attachment",
            "transit-gateway-connect-peer",
            "transit-gateway-multicast-domain",
            "transit-gateway-policy-table",
            "transit-gateway-route-table",
            "transit-gateway-route-table-announcement",
            "volume",
            "vpc",
            "vpc-endpoint",
            "vpc-endpoint-connection",
            "vpc-endpoint-service",
            "vpc-endpoint-service-permission",
            "vpc-peering-connection",
            "vpn-connection",
            "vpn-gateway",
            "vpc-flow-log",
            "capacity-reservation-fleet",
            "traffic-mirror-filter-rule",
            "vpc-endpoint-connection-device-type",
            "verified-access-instance",
            "verified-access-group",
            "verified-access-endpoint",
            "verified-access-policy",
            "verified-access-trust-provider",
            "vpn-connection-device-type",
            "vpc-block-public-access-exclusion",
            "ipam-resource-discovery",
            "ipam-resource-discovery-association",
            "instance-connect-endpoint",
        ]
    ] = None
    #: The tags to apply to the resource.
    Tags: Optional[List[Tag]] = None


class LaunchTemplateElasticInferenceAccelerator(Boto3Model):
    """
    Describes an elastic inference accelerator.
    """

    #: The type of elastic inference accelerator. The possible values are
    #: eia1.medium, eia1.large, and eia1.xlarge.
    Type: str
    #: The number of elastic inference accelerators to attach to the instance.
    Count: Optional[int] = None


class LaunchTemplateSpotMarketOptionsRequest(Boto3Model):
    """
    The options for Spot Instances.
    """

    #: The maximum hourly price you're willing to pay for the Spot Instances. We do
    #: not recommend using this parameter because it can lead to increased
    #: interruptions. If you do not specify this parameter, you will pay the current
    #: Spot price.
    MaxPrice: Optional[str] = None
    #: The Spot Instance request type.
    SpotInstanceType: Optional[Literal["one-time", "persistent"]] = None
    #: Deprecated.
    BlockDurationMinutes: Optional[int] = None
    #: The end date of the request, in UTC format (*YYYY-MM-DD*T*HH:MM:SS*Z).
    #: Supported only for persistent requests.
    ValidUntil: Optional[datetime] = None
    #: The behavior when a Spot Instance is interrupted. The default is ``terminate``.
    InstanceInterruptionBehavior: Optional[
        Literal["hibernate", "stop", "terminate"]
    ] = None


class LaunchTemplateInstanceMarketOptionsRequest(Boto3Model):
    """
    The market (purchasing) option for the instances.
    """

    #: The market type.
    MarketType: Optional[Literal["spot", "capacity-block"]] = None
    #: The options for Spot Instances.
    SpotOptions: Optional[LaunchTemplateSpotMarketOptionsRequest] = None


class LaunchTemplateCpuOptionsRequest(Boto3Model):
    """
    The CPU options for the instance.

    For more information, see
    `Optimizing CPU Options <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-
    cpu.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    """

    #: The number of CPU cores for the instance.
    CoreCount: Optional[int] = None
    #: The number of threads per CPU core. To disable multithreading for the instance,
    #: specify a value of ``1``. Otherwise, specify the default value of ``2``.
    ThreadsPerCore: Optional[int] = None
    #: Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is
    #: supported with M6a, R6a, and C6a instance types only. For more information, see
    #: `AMD SEV-SNP <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-
    #: snp.html>`_.
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = None


class LaunchTemplateCapacityReservationSpecificationRequest(Boto3Model):
    """
    The Capacity Reservation targeting option.

    If you do not specify this
    parameter, the instance's Capacity Reservation preference defaults to ``open``,
    which enables it to run in any open Capacity Reservation that has matching
    attributes (instance type, platform, Availability Zone).
    """

    #: Indicates the instance's Capacity Reservation preferences. Possible preferences
    #: include:
    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    #: Information about the target Capacity Reservation or Capacity Reservation
    #: group.
    CapacityReservationTarget: Optional[EC2CapacityReservationTarget] = None


class LaunchTemplateLicenseConfigurationRequest(Boto3Model):
    """
    Describes a license configuration.
    """

    #: The Amazon Resource Name (ARN) of the license configuration.
    LicenseConfigurationArn: Optional[str] = None


class LaunchTemplateHibernationOptionsRequest(Boto3Model):
    """
    Indicates whether an instance is enabled for hibernation.

    This parameter is valid only if the instance meets the
    `hibernation prerequisites <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-
     prerequisites.html>`_. For more information, see
    `Hibernate your instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_
    in the *Amazon Elastic Compute Cloud User Guide*.
    """

    #: If you set this parameter to ``true``, the instance is enabled for hibernation.
    Configured: Optional[bool] = None


class LaunchTemplateInstanceMetadataOptionsRequest(Boto3Model):
    """
    The metadata options for the instance.

    For more information, see
    `Instance metadata and user data <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    metadata.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    """

    #: Indicates whether IMDSv2 is required.
    HttpTokens: Optional[Literal["optional", "required"]] = None
    #: The desired HTTP PUT response hop limit for instance metadata requests. The
    #: larger the number, the further instance metadata requests can travel.
    HttpPutResponseHopLimit: Optional[int] = None
    #: Enables or disables the HTTP metadata endpoint on your instances. If the
    #: parameter is not specified, the default state is ``enabled``.
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    #: Enables or disables the IPv6 endpoint for the instance metadata service.
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    #: Set to ``enabled`` to allow access to instance tags from the instance metadata.
    #: Set to ``disabled`` to turn off access to instance tags from the instance
    #: metadata. For more information, see `Work with instance tags using the instance
    #: metadata <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#w
    #: ork-with-tags-in-IMDS>`_.
    InstanceMetadataTags: Optional[Literal["disabled", "enabled"]] = None


class LaunchTemplateEnclaveOptionsRequest(Boto3Model):
    """Indicates whether the instance is enabled for Amazon Web Services Nitro
    Enclaves. For more information, see  `What is Amazon Web Services Nitro
    Enclaves? <https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html>`_
    in the *Amazon Web Services Nitro Enclaves User Guide*.

    You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same
    instance.
    """

    #: To enable the instance for Amazon Web Services Nitro Enclaves, set this
    #: parameter to ``true``.
    Enabled: Optional[bool] = None


class VCpuCountRangeRequest(Boto3Model):
    """
    The minimum and maximum number of vCPUs.
    """

    #: The minimum number of vCPUs. To specify no minimum limit, specify ``0``.
    Min: int
    #: The maximum number of vCPUs. To specify no maximum limit, omit this parameter.
    Max: Optional[int] = None


class MemoryMiBRequest(Boto3Model):
    """
    The minimum and maximum amount of memory, in MiB.
    """

    #: The minimum amount of memory, in MiB. To specify no minimum limit, specify
    #: ``0``.
    Min: int
    #: The maximum amount of memory, in MiB. To specify no maximum limit, omit this
    #: parameter.
    Max: Optional[int] = None


class EC2MemoryGiBPerVCpuRequest(Boto3Model):
    """
    The minimum and maximum amount of memory per vCPU, in GiB.

    Default: No minimum or maximum limits
    """

    #: The minimum amount of memory per vCPU, in GiB. To specify no minimum limit,
    #: omit this parameter.
    Min: Optional[float] = None
    #: The maximum amount of memory per vCPU, in GiB. To specify no maximum limit,
    #: omit this parameter.
    Max: Optional[float] = None


class NetworkInterfaceCountRequest(Boto3Model):
    """
    The minimum and maximum number of network interfaces.

    Default: No minimum or maximum limits
    """

    #: The minimum number of network interfaces. To specify no minimum limit, omit
    #: this parameter.
    Min: Optional[int] = None
    #: The maximum number of network interfaces. To specify no maximum limit, omit
    #: this parameter.
    Max: Optional[int] = None


class TotalLocalStorageGBRequest(Boto3Model):
    """
    The minimum and maximum amount of total local storage, in GB.

    Default: No minimum or maximum limits
    """

    #: The minimum amount of total local storage, in GB. To specify no minimum limit,
    #: omit this parameter.
    Min: Optional[float] = None
    #: The maximum amount of total local storage, in GB. To specify no maximum limit,
    #: omit this parameter.
    Max: Optional[float] = None


class BaselineEbsBandwidthMbpsRequest(Boto3Model):
    """The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more
    information, see `Amazon EBS–optimized
    instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-
    optimized.html>`_ in the *Amazon EC2 User Guide*.

    Default: No minimum or maximum limits
    """

    #: The minimum baseline bandwidth, in Mbps. To specify no minimum limit, omit this
    #: parameter.
    Min: Optional[int] = None
    #: The maximum baseline bandwidth, in Mbps. To specify no maximum limit, omit this
    #: parameter.
    Max: Optional[int] = None


class AcceleratorCountRequest(Boto3Model):
    """
    The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web
    Services Inferentia chips) on an instance.

    To exclude accelerator-enabled instance types, set ``Max`` to ``0``.

    Default: No minimum or maximum limits
    """

    #: The minimum number of accelerators. To specify no minimum limit, omit this
    #: parameter.
    Min: Optional[int] = None
    #: The maximum number of accelerators. To specify no maximum limit, omit this
    #: parameter. To exclude accelerator-enabled instance types, set ``Max`` to ``0``.
    Max: Optional[int] = None


class AcceleratorTotalMemoryMiBRequest(Boto3Model):
    """
    The minimum and maximum amount of total accelerator memory, in MiB.

    Default: No minimum or maximum limits
    """

    #: The minimum amount of accelerator memory, in MiB. To specify no minimum limit,
    #: omit this parameter.
    Min: Optional[int] = None
    #: The maximum amount of accelerator memory, in MiB. To specify no maximum limit,
    #: omit this parameter.
    Max: Optional[int] = None


class EC2NetworkBandwidthGbpsRequest(Boto3Model):
    """The minimum and maximum amount of baseline network bandwidth, in gigabits per
    second (Gbps). For more information, see `Amazon EC2 instance network
    bandwidth <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    network-bandwidth.html>`_ in the *Amazon EC2 User Guide*.

    Default: No minimum or maximum limits
    """

    #: The minimum amount of network bandwidth, in Gbps. To specify no minimum limit,
    #: omit this parameter.
    Min: Optional[float] = None
    #: The maximum amount of network bandwidth, in Gbps. To specify no maximum limit,
    #: omit this parameter.
    Max: Optional[float] = None


class InstanceRequirementsRequest(Boto3Model):
    """
    The attributes for the instance types. When you specify instance
    attributes, Amazon EC2 will identify instance types with these attributes.

    You must specify ``VCpuCount`` and ``MemoryMiB``. All other attributes are
    optional. Any unspecified optional attribute is set to its default.

    When you specify multiple attributes, you get instance types that satisfy all
    of the specified attributes. If you specify multiple values for an attribute,
    you get instance types that satisfy any of the specified values.

    To limit the list of instance types from which Amazon EC2 can identify matching
    instance types, you can use one of the following parameters, but not both in
    the same request:

    * ``AllowedInstanceTypes`` - The instance types to include in the list. All
      other instance types are ignored, even if they match your specified attributes.
    * ``ExcludedInstanceTypes`` - The instance types to exclude from the list, even
      if they match your specified attributes.

    If you specify ``InstanceRequirements``, you can't specify ``InstanceType``.

    Attribute-based instance type selection is only supported when using Auto
    Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to
    use the launch template in the `launch instance
    wizard <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-
    instance-wizard.html>`_, or with the `RunInstances <https://docs.aws.amazon.com/A
    WSEC2/latest/APIReference/API_RunInstances.html>`_ API or `AWS::EC2::Instance <ht
    tps://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-
    ec2-instance.html>`_ Amazon Web Services CloudFormation resource, you can't
    specify ``InstanceRequirements``.

    For more information, see `Attribute-based instance type selection for EC2
    Fleet <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-
    based-instance-type-selection.html>`_, `Attribute-based instance type selection
    for Spot Fleet <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-
    attribute-based-instance-type-selection.html>`_, and `Spot placement
    score <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-placement-
    score.html>`_ in the *Amazon EC2 User Guide*.
    """

    #: The minimum and maximum number of vCPUs.
    VCpuCount: VCpuCountRangeRequest
    #: The minimum and maximum amount of memory, in MiB.
    MemoryMiB: MemoryMiBRequest
    #: The CPU manufacturers to include.
    CpuManufacturers: Optional[
        List[Literal["intel", "amd", "amazon-web-services"]]
    ] = None
    #: The minimum and maximum amount of memory per vCPU, in GiB.
    MemoryGiBPerVCpu: Optional[EC2MemoryGiBPerVCpuRequest] = None
    #: The instance types to exclude.
    ExcludedInstanceTypes: Optional[List[str]] = None
    #: Indicates whether current or previous generation instance types are included.
    #: The current generation instance types are recommended for use. Current
    #: generation instance types are typically the latest two to three generations in
    #: each instance family. For more information, see `Instance types
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>`_ in
    #: the *Amazon EC2 User Guide*.
    InstanceGenerations: Optional[List[Literal["current", "previous"]]] = None
    #: The price protection threshold for Spot Instance. This is the maximum you’ll
    #: pay for an Spot Instance, expressed as a percentage above the least expensive
    #: current generation M, C, or R instance type with your specified attributes.
    #: When Amazon EC2 selects instance types with your attributes, it excludes
    #: instance types priced above your threshold.
    SpotMaxPricePercentageOverLowestPrice: Optional[int] = None
    #: The price protection threshold for On-Demand Instances. This is the maximum
    #: you’ll pay for an On-Demand Instance, expressed as a percentage above the least
    #: expensive current generation M, C, or R instance type with your specified
    #: attributes. When Amazon EC2 selects instance types with your attributes, it
    #: excludes instance types priced above your threshold.
    OnDemandMaxPricePercentageOverLowestPrice: Optional[int] = None
    #: Indicates whether bare metal instance types must be included, excluded, or
    #: required.
    BareMetal: Optional[Literal["included", "required", "excluded"]] = None
    #: Indicates whether burstable performance T instance types are included,
    #: excluded, or required. For more information, see `Burstable performance
    #: instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-
    #: performance-instances.html>`_.
    BurstablePerformance: Optional[Literal["included", "required", "excluded"]] = None
    #: Indicates whether instance types must support hibernation for On-Demand
    #: Instances.
    RequireHibernateSupport: Optional[bool] = None
    #: The minimum and maximum number of network interfaces.
    NetworkInterfaceCount: Optional[NetworkInterfaceCountRequest] = None
    #: Indicates whether instance types with instance store volumes are included,
    #: excluded, or required. For more information, `Amazon EC2 instance store <https:
    #: //docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html>`_ in the
    #: *Amazon EC2 User Guide*.
    LocalStorage: Optional[Literal["included", "required", "excluded"]] = None
    #: The type of local storage that is required.
    LocalStorageTypes: Optional[List[Literal["hdd", "ssd"]]] = None
    #: The minimum and maximum amount of total local storage, in GB.
    TotalLocalStorageGB: Optional[TotalLocalStorageGBRequest] = None
    #: The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more
    #: information, see `Amazon EBS–optimized instances
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs- optimized.html>`_ in
    #: the *Amazon EC2 User Guide*.
    BaselineEbsBandwidthMbps: Optional[BaselineEbsBandwidthMbpsRequest] = None
    #: The accelerator types that must be on the instance type.
    AcceleratorTypes: Optional[List[Literal["gpu", "fpga", "inference"]]] = None
    #: The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web
    #: Services Inferentia chips) on an instance.
    AcceleratorCount: Optional[AcceleratorCountRequest] = None
    #: Indicates whether instance types must have accelerators by specific
    #: manufacturers.
    AcceleratorManufacturers: Optional[
        List[Literal["amazon-web-services", "amd", "nvidia", "xilinx", "habana"]]
    ] = None
    #: The accelerators that must be on the instance type.
    AcceleratorNames: Optional[
        List[
            Literal[
                "a100",
                "inferentia",
                "k520",
                "k80",
                "m60",
                "radeon-pro-v520",
                "t4",
                "vu9p",
                "v100",
                "a10g",
                "h100",
                "t4g",
            ]
        ]
    ] = None
    #: The minimum and maximum amount of total accelerator memory, in MiB.
    AcceleratorTotalMemoryMiB: Optional[AcceleratorTotalMemoryMiBRequest] = None
    #: The minimum and maximum amount of baseline network bandwidth, in gigabits per
    #: second (Gbps). For more information, see `Amazon EC2 instance network bandwidth
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance- network-
    #: bandwidth.html>`_ in the *Amazon EC2 User Guide*.
    NetworkBandwidthGbps: Optional[EC2NetworkBandwidthGbpsRequest] = None
    #: The instance types to apply your specified attributes against. All other
    #: instance types are ignored, even if they match your specified attributes.
    AllowedInstanceTypes: Optional[List[str]] = None


class LaunchTemplatePrivateDnsNameOptionsRequest(Boto3Model):
    """
    The options for the instance hostname.

    The default values are inherited from the subnet.
    """

    #: The type of hostname for Amazon EC2 instances. For IPv4 only subnets, an
    #: instance DNS name must be based on the instance IPv4 address. For IPv6 native
    #: subnets, an instance DNS name must be based on the instance ID. For dual-stack
    #: subnets, you can specify whether DNS names use the instance IPv4 address or the
    #: instance ID.
    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS A
    #: records.
    EnableResourceNameDnsARecord: Optional[bool] = None
    #: Indicates whether to respond to DNS queries for instance hostnames with DNS
    #: AAAA records.
    EnableResourceNameDnsAAAARecord: Optional[bool] = None


class LaunchTemplateInstanceMaintenanceOptionsRequest(Boto3Model):
    """
    The maintenance options for the instance.
    """

    #: Disables the automatic recovery behavior of your instance or sets it to
    #: default. For more information, see `Simplified automatic recovery
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    #: recover.html#instance-configuration-recovery>`_.
    AutoRecovery: Optional[Literal["default", "disabled"]] = None


class RequestLaunchTemplateData(Boto3Model):
    """
    The information for the launch template.
    """

    #: The ID of the kernel.
    KernelId: Optional[str] = None
    #: Indicates whether the instance is optimized for Amazon EBS I/O. This
    #: optimization provides dedicated throughput to Amazon EBS and an optimized
    #: configuration stack to provide optimal Amazon EBS I/O performance. This
    #: optimization isn't available with all instance types. Additional usage charges
    #: apply when using an EBS-optimized instance.
    EbsOptimized: Optional[bool] = None
    #: The name or Amazon Resource Name (ARN) of an IAM instance profile.
    IamInstanceProfile: Optional[
        LaunchTemplateIamInstanceProfileSpecificationRequest
    ] = None
    #: The block device mapping.
    BlockDeviceMappings: Optional[
        List["LaunchTemplateBlockDeviceMappingRequest"]
    ] = None
    #: One or more network interfaces. If you specify a network interface, you must
    #: specify any security groups and subnets as part of the network interface.
    NetworkInterfaces: Optional[
        List["LaunchTemplateInstanceNetworkInterfaceSpecificationRequest"]
    ] = None
    #: The ID of the AMI. Alternatively, you can specify a Systems Manager parameter,
    #: which will resolve to an AMI ID on launch.
    ImageId: Optional[str] = None
    #: The instance type. For more information, see `Instance types
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>`_ in
    #: the *Amazon Elastic Compute Cloud User Guide*.
    InstanceType: Optional[
        Literal[
            "a1.medium",
            "a1.large",
            "a1.xlarge",
            "a1.2xlarge",
            "a1.4xlarge",
            "a1.metal",
            "c1.medium",
            "c1.xlarge",
            "c3.large",
            "c3.xlarge",
            "c3.2xlarge",
            "c3.4xlarge",
            "c3.8xlarge",
            "c4.large",
            "c4.xlarge",
            "c4.2xlarge",
            "c4.4xlarge",
            "c4.8xlarge",
            "c5.large",
            "c5.xlarge",
            "c5.2xlarge",
            "c5.4xlarge",
            "c5.9xlarge",
            "c5.12xlarge",
            "c5.18xlarge",
            "c5.24xlarge",
            "c5.metal",
            "c5a.large",
            "c5a.xlarge",
            "c5a.2xlarge",
            "c5a.4xlarge",
            "c5a.8xlarge",
            "c5a.12xlarge",
            "c5a.16xlarge",
            "c5a.24xlarge",
            "c5ad.large",
            "c5ad.xlarge",
            "c5ad.2xlarge",
            "c5ad.4xlarge",
            "c5ad.8xlarge",
            "c5ad.12xlarge",
            "c5ad.16xlarge",
            "c5ad.24xlarge",
            "c5d.large",
            "c5d.xlarge",
            "c5d.2xlarge",
            "c5d.4xlarge",
            "c5d.9xlarge",
            "c5d.12xlarge",
            "c5d.18xlarge",
            "c5d.24xlarge",
            "c5d.metal",
            "c5n.large",
            "c5n.xlarge",
            "c5n.2xlarge",
            "c5n.4xlarge",
            "c5n.9xlarge",
            "c5n.18xlarge",
            "c5n.metal",
            "c6g.medium",
            "c6g.large",
            "c6g.xlarge",
            "c6g.2xlarge",
            "c6g.4xlarge",
            "c6g.8xlarge",
            "c6g.12xlarge",
            "c6g.16xlarge",
            "c6g.metal",
            "c6gd.medium",
            "c6gd.large",
            "c6gd.xlarge",
            "c6gd.2xlarge",
            "c6gd.4xlarge",
            "c6gd.8xlarge",
            "c6gd.12xlarge",
            "c6gd.16xlarge",
            "c6gd.metal",
            "c6gn.medium",
            "c6gn.large",
            "c6gn.xlarge",
            "c6gn.2xlarge",
            "c6gn.4xlarge",
            "c6gn.8xlarge",
            "c6gn.12xlarge",
            "c6gn.16xlarge",
            "c6i.large",
            "c6i.xlarge",
            "c6i.2xlarge",
            "c6i.4xlarge",
            "c6i.8xlarge",
            "c6i.12xlarge",
            "c6i.16xlarge",
            "c6i.24xlarge",
            "c6i.32xlarge",
            "c6i.metal",
            "cc1.4xlarge",
            "cc2.8xlarge",
            "cg1.4xlarge",
            "cr1.8xlarge",
            "d2.xlarge",
            "d2.2xlarge",
            "d2.4xlarge",
            "d2.8xlarge",
            "d3.xlarge",
            "d3.2xlarge",
            "d3.4xlarge",
            "d3.8xlarge",
            "d3en.xlarge",
            "d3en.2xlarge",
            "d3en.4xlarge",
            "d3en.6xlarge",
            "d3en.8xlarge",
            "d3en.12xlarge",
            "dl1.24xlarge",
            "f1.2xlarge",
            "f1.4xlarge",
            "f1.16xlarge",
            "g2.2xlarge",
            "g2.8xlarge",
            "g3.4xlarge",
            "g3.8xlarge",
            "g3.16xlarge",
            "g3s.xlarge",
            "g4ad.xlarge",
            "g4ad.2xlarge",
            "g4ad.4xlarge",
            "g4ad.8xlarge",
            "g4ad.16xlarge",
            "g4dn.xlarge",
            "g4dn.2xlarge",
            "g4dn.4xlarge",
            "g4dn.8xlarge",
            "g4dn.12xlarge",
            "g4dn.16xlarge",
            "g4dn.metal",
            "g5.xlarge",
            "g5.2xlarge",
            "g5.4xlarge",
            "g5.8xlarge",
            "g5.12xlarge",
            "g5.16xlarge",
            "g5.24xlarge",
            "g5.48xlarge",
            "g5g.xlarge",
            "g5g.2xlarge",
            "g5g.4xlarge",
            "g5g.8xlarge",
            "g5g.16xlarge",
            "g5g.metal",
            "hi1.4xlarge",
            "hpc6a.48xlarge",
            "hs1.8xlarge",
            "h1.2xlarge",
            "h1.4xlarge",
            "h1.8xlarge",
            "h1.16xlarge",
            "i2.xlarge",
            "i2.2xlarge",
            "i2.4xlarge",
            "i2.8xlarge",
            "i3.large",
            "i3.xlarge",
            "i3.2xlarge",
            "i3.4xlarge",
            "i3.8xlarge",
            "i3.16xlarge",
            "i3.metal",
            "i3en.large",
            "i3en.xlarge",
            "i3en.2xlarge",
            "i3en.3xlarge",
            "i3en.6xlarge",
            "i3en.12xlarge",
            "i3en.24xlarge",
            "i3en.metal",
            "im4gn.large",
            "im4gn.xlarge",
            "im4gn.2xlarge",
            "im4gn.4xlarge",
            "im4gn.8xlarge",
            "im4gn.16xlarge",
            "inf1.xlarge",
            "inf1.2xlarge",
            "inf1.6xlarge",
            "inf1.24xlarge",
            "is4gen.medium",
            "is4gen.large",
            "is4gen.xlarge",
            "is4gen.2xlarge",
            "is4gen.4xlarge",
            "is4gen.8xlarge",
            "m1.small",
            "m1.medium",
            "m1.large",
            "m1.xlarge",
            "m2.xlarge",
            "m2.2xlarge",
            "m2.4xlarge",
            "m3.medium",
            "m3.large",
            "m3.xlarge",
            "m3.2xlarge",
            "m4.large",
            "m4.xlarge",
            "m4.2xlarge",
            "m4.4xlarge",
            "m4.10xlarge",
            "m4.16xlarge",
            "m5.large",
            "m5.xlarge",
            "m5.2xlarge",
            "m5.4xlarge",
            "m5.8xlarge",
            "m5.12xlarge",
            "m5.16xlarge",
            "m5.24xlarge",
            "m5.metal",
            "m5a.large",
            "m5a.xlarge",
            "m5a.2xlarge",
            "m5a.4xlarge",
            "m5a.8xlarge",
            "m5a.12xlarge",
            "m5a.16xlarge",
            "m5a.24xlarge",
            "m5ad.large",
            "m5ad.xlarge",
            "m5ad.2xlarge",
            "m5ad.4xlarge",
            "m5ad.8xlarge",
            "m5ad.12xlarge",
            "m5ad.16xlarge",
            "m5ad.24xlarge",
            "m5d.large",
            "m5d.xlarge",
            "m5d.2xlarge",
            "m5d.4xlarge",
            "m5d.8xlarge",
            "m5d.12xlarge",
            "m5d.16xlarge",
            "m5d.24xlarge",
            "m5d.metal",
            "m5dn.large",
            "m5dn.xlarge",
            "m5dn.2xlarge",
            "m5dn.4xlarge",
            "m5dn.8xlarge",
            "m5dn.12xlarge",
            "m5dn.16xlarge",
            "m5dn.24xlarge",
            "m5dn.metal",
            "m5n.large",
            "m5n.xlarge",
            "m5n.2xlarge",
            "m5n.4xlarge",
            "m5n.8xlarge",
            "m5n.12xlarge",
            "m5n.16xlarge",
            "m5n.24xlarge",
            "m5n.metal",
            "m5zn.large",
            "m5zn.xlarge",
            "m5zn.2xlarge",
            "m5zn.3xlarge",
            "m5zn.6xlarge",
            "m5zn.12xlarge",
            "m5zn.metal",
            "m6a.large",
            "m6a.xlarge",
            "m6a.2xlarge",
            "m6a.4xlarge",
            "m6a.8xlarge",
            "m6a.12xlarge",
            "m6a.16xlarge",
            "m6a.24xlarge",
            "m6a.32xlarge",
            "m6a.48xlarge",
            "m6g.metal",
            "m6g.medium",
            "m6g.large",
            "m6g.xlarge",
            "m6g.2xlarge",
            "m6g.4xlarge",
            "m6g.8xlarge",
            "m6g.12xlarge",
            "m6g.16xlarge",
            "m6gd.metal",
            "m6gd.medium",
            "m6gd.large",
            "m6gd.xlarge",
            "m6gd.2xlarge",
            "m6gd.4xlarge",
            "m6gd.8xlarge",
            "m6gd.12xlarge",
            "m6gd.16xlarge",
            "m6i.large",
            "m6i.xlarge",
            "m6i.2xlarge",
            "m6i.4xlarge",
            "m6i.8xlarge",
            "m6i.12xlarge",
            "m6i.16xlarge",
            "m6i.24xlarge",
            "m6i.32xlarge",
            "m6i.metal",
            "mac1.metal",
            "p2.xlarge",
            "p2.8xlarge",
            "p2.16xlarge",
            "p3.2xlarge",
            "p3.8xlarge",
            "p3.16xlarge",
            "p3dn.24xlarge",
            "p4d.24xlarge",
            "r3.large",
            "r3.xlarge",
            "r3.2xlarge",
            "r3.4xlarge",
            "r3.8xlarge",
            "r4.large",
            "r4.xlarge",
            "r4.2xlarge",
            "r4.4xlarge",
            "r4.8xlarge",
            "r4.16xlarge",
            "r5.large",
            "r5.xlarge",
            "r5.2xlarge",
            "r5.4xlarge",
            "r5.8xlarge",
            "r5.12xlarge",
            "r5.16xlarge",
            "r5.24xlarge",
            "r5.metal",
            "r5a.large",
            "r5a.xlarge",
            "r5a.2xlarge",
            "r5a.4xlarge",
            "r5a.8xlarge",
            "r5a.12xlarge",
            "r5a.16xlarge",
            "r5a.24xlarge",
            "r5ad.large",
            "r5ad.xlarge",
            "r5ad.2xlarge",
            "r5ad.4xlarge",
            "r5ad.8xlarge",
            "r5ad.12xlarge",
            "r5ad.16xlarge",
            "r5ad.24xlarge",
            "r5b.large",
            "r5b.xlarge",
            "r5b.2xlarge",
            "r5b.4xlarge",
            "r5b.8xlarge",
            "r5b.12xlarge",
            "r5b.16xlarge",
            "r5b.24xlarge",
            "r5b.metal",
            "r5d.large",
            "r5d.xlarge",
            "r5d.2xlarge",
            "r5d.4xlarge",
            "r5d.8xlarge",
            "r5d.12xlarge",
            "r5d.16xlarge",
            "r5d.24xlarge",
            "r5d.metal",
            "r5dn.large",
            "r5dn.xlarge",
            "r5dn.2xlarge",
            "r5dn.4xlarge",
            "r5dn.8xlarge",
            "r5dn.12xlarge",
            "r5dn.16xlarge",
            "r5dn.24xlarge",
            "r5dn.metal",
            "r5n.large",
            "r5n.xlarge",
            "r5n.2xlarge",
            "r5n.4xlarge",
            "r5n.8xlarge",
            "r5n.12xlarge",
            "r5n.16xlarge",
            "r5n.24xlarge",
            "r5n.metal",
            "r6g.medium",
            "r6g.large",
            "r6g.xlarge",
            "r6g.2xlarge",
            "r6g.4xlarge",
            "r6g.8xlarge",
            "r6g.12xlarge",
            "r6g.16xlarge",
            "r6g.metal",
            "r6gd.medium",
            "r6gd.large",
            "r6gd.xlarge",
            "r6gd.2xlarge",
            "r6gd.4xlarge",
            "r6gd.8xlarge",
            "r6gd.12xlarge",
            "r6gd.16xlarge",
            "r6gd.metal",
            "r6i.large",
            "r6i.xlarge",
            "r6i.2xlarge",
            "r6i.4xlarge",
            "r6i.8xlarge",
            "r6i.12xlarge",
            "r6i.16xlarge",
            "r6i.24xlarge",
            "r6i.32xlarge",
            "r6i.metal",
            "t1.micro",
            "t2.nano",
            "t2.micro",
            "t2.small",
            "t2.medium",
            "t2.large",
            "t2.xlarge",
            "t2.2xlarge",
            "t3.nano",
            "t3.micro",
            "t3.small",
            "t3.medium",
            "t3.large",
            "t3.xlarge",
            "t3.2xlarge",
            "t3a.nano",
            "t3a.micro",
            "t3a.small",
            "t3a.medium",
            "t3a.large",
            "t3a.xlarge",
            "t3a.2xlarge",
            "t4g.nano",
            "t4g.micro",
            "t4g.small",
            "t4g.medium",
            "t4g.large",
            "t4g.xlarge",
            "t4g.2xlarge",
            "u-6tb1.56xlarge",
            "u-6tb1.112xlarge",
            "u-9tb1.112xlarge",
            "u-12tb1.112xlarge",
            "u-6tb1.metal",
            "u-9tb1.metal",
            "u-12tb1.metal",
            "u-18tb1.metal",
            "u-24tb1.metal",
            "vt1.3xlarge",
            "vt1.6xlarge",
            "vt1.24xlarge",
            "x1.16xlarge",
            "x1.32xlarge",
            "x1e.xlarge",
            "x1e.2xlarge",
            "x1e.4xlarge",
            "x1e.8xlarge",
            "x1e.16xlarge",
            "x1e.32xlarge",
            "x2iezn.2xlarge",
            "x2iezn.4xlarge",
            "x2iezn.6xlarge",
            "x2iezn.8xlarge",
            "x2iezn.12xlarge",
            "x2iezn.metal",
            "x2gd.medium",
            "x2gd.large",
            "x2gd.xlarge",
            "x2gd.2xlarge",
            "x2gd.4xlarge",
            "x2gd.8xlarge",
            "x2gd.12xlarge",
            "x2gd.16xlarge",
            "x2gd.metal",
            "z1d.large",
            "z1d.xlarge",
            "z1d.2xlarge",
            "z1d.3xlarge",
            "z1d.6xlarge",
            "z1d.12xlarge",
            "z1d.metal",
            "x2idn.16xlarge",
            "x2idn.24xlarge",
            "x2idn.32xlarge",
            "x2iedn.xlarge",
            "x2iedn.2xlarge",
            "x2iedn.4xlarge",
            "x2iedn.8xlarge",
            "x2iedn.16xlarge",
            "x2iedn.24xlarge",
            "x2iedn.32xlarge",
            "c6a.large",
            "c6a.xlarge",
            "c6a.2xlarge",
            "c6a.4xlarge",
            "c6a.8xlarge",
            "c6a.12xlarge",
            "c6a.16xlarge",
            "c6a.24xlarge",
            "c6a.32xlarge",
            "c6a.48xlarge",
            "c6a.metal",
            "m6a.metal",
            "i4i.large",
            "i4i.xlarge",
            "i4i.2xlarge",
            "i4i.4xlarge",
            "i4i.8xlarge",
            "i4i.16xlarge",
            "i4i.32xlarge",
            "i4i.metal",
            "x2idn.metal",
            "x2iedn.metal",
            "c7g.medium",
            "c7g.large",
            "c7g.xlarge",
            "c7g.2xlarge",
            "c7g.4xlarge",
            "c7g.8xlarge",
            "c7g.12xlarge",
            "c7g.16xlarge",
            "mac2.metal",
            "c6id.large",
            "c6id.xlarge",
            "c6id.2xlarge",
            "c6id.4xlarge",
            "c6id.8xlarge",
            "c6id.12xlarge",
            "c6id.16xlarge",
            "c6id.24xlarge",
            "c6id.32xlarge",
            "c6id.metal",
            "m6id.large",
            "m6id.xlarge",
            "m6id.2xlarge",
            "m6id.4xlarge",
            "m6id.8xlarge",
            "m6id.12xlarge",
            "m6id.16xlarge",
            "m6id.24xlarge",
            "m6id.32xlarge",
            "m6id.metal",
            "r6id.large",
            "r6id.xlarge",
            "r6id.2xlarge",
            "r6id.4xlarge",
            "r6id.8xlarge",
            "r6id.12xlarge",
            "r6id.16xlarge",
            "r6id.24xlarge",
            "r6id.32xlarge",
            "r6id.metal",
            "r6a.large",
            "r6a.xlarge",
            "r6a.2xlarge",
            "r6a.4xlarge",
            "r6a.8xlarge",
            "r6a.12xlarge",
            "r6a.16xlarge",
            "r6a.24xlarge",
            "r6a.32xlarge",
            "r6a.48xlarge",
            "r6a.metal",
            "p4de.24xlarge",
            "u-3tb1.56xlarge",
            "u-18tb1.112xlarge",
            "u-24tb1.112xlarge",
            "trn1.2xlarge",
            "trn1.32xlarge",
            "hpc6id.32xlarge",
            "c6in.large",
            "c6in.xlarge",
            "c6in.2xlarge",
            "c6in.4xlarge",
            "c6in.8xlarge",
            "c6in.12xlarge",
            "c6in.16xlarge",
            "c6in.24xlarge",
            "c6in.32xlarge",
            "m6in.large",
            "m6in.xlarge",
            "m6in.2xlarge",
            "m6in.4xlarge",
            "m6in.8xlarge",
            "m6in.12xlarge",
            "m6in.16xlarge",
            "m6in.24xlarge",
            "m6in.32xlarge",
            "m6idn.large",
            "m6idn.xlarge",
            "m6idn.2xlarge",
            "m6idn.4xlarge",
            "m6idn.8xlarge",
            "m6idn.12xlarge",
            "m6idn.16xlarge",
            "m6idn.24xlarge",
            "m6idn.32xlarge",
            "r6in.large",
            "r6in.xlarge",
            "r6in.2xlarge",
            "r6in.4xlarge",
            "r6in.8xlarge",
            "r6in.12xlarge",
            "r6in.16xlarge",
            "r6in.24xlarge",
            "r6in.32xlarge",
            "r6idn.large",
            "r6idn.xlarge",
            "r6idn.2xlarge",
            "r6idn.4xlarge",
            "r6idn.8xlarge",
            "r6idn.12xlarge",
            "r6idn.16xlarge",
            "r6idn.24xlarge",
            "r6idn.32xlarge",
            "c7g.metal",
            "m7g.medium",
            "m7g.large",
            "m7g.xlarge",
            "m7g.2xlarge",
            "m7g.4xlarge",
            "m7g.8xlarge",
            "m7g.12xlarge",
            "m7g.16xlarge",
            "m7g.metal",
            "r7g.medium",
            "r7g.large",
            "r7g.xlarge",
            "r7g.2xlarge",
            "r7g.4xlarge",
            "r7g.8xlarge",
            "r7g.12xlarge",
            "r7g.16xlarge",
            "r7g.metal",
            "c6in.metal",
            "m6in.metal",
            "m6idn.metal",
            "r6in.metal",
            "r6idn.metal",
            "inf2.xlarge",
            "inf2.8xlarge",
            "inf2.24xlarge",
            "inf2.48xlarge",
            "trn1n.32xlarge",
            "i4g.large",
            "i4g.xlarge",
            "i4g.2xlarge",
            "i4g.4xlarge",
            "i4g.8xlarge",
            "i4g.16xlarge",
            "hpc7g.4xlarge",
            "hpc7g.8xlarge",
            "hpc7g.16xlarge",
            "c7gn.medium",
            "c7gn.large",
            "c7gn.xlarge",
            "c7gn.2xlarge",
            "c7gn.4xlarge",
            "c7gn.8xlarge",
            "c7gn.12xlarge",
            "c7gn.16xlarge",
            "p5.48xlarge",
            "m7i.large",
            "m7i.xlarge",
            "m7i.2xlarge",
            "m7i.4xlarge",
            "m7i.8xlarge",
            "m7i.12xlarge",
            "m7i.16xlarge",
            "m7i.24xlarge",
            "m7i.48xlarge",
            "m7i-flex.large",
            "m7i-flex.xlarge",
            "m7i-flex.2xlarge",
            "m7i-flex.4xlarge",
            "m7i-flex.8xlarge",
            "m7a.medium",
            "m7a.large",
            "m7a.xlarge",
            "m7a.2xlarge",
            "m7a.4xlarge",
            "m7a.8xlarge",
            "m7a.12xlarge",
            "m7a.16xlarge",
            "m7a.24xlarge",
            "m7a.32xlarge",
            "m7a.48xlarge",
            "m7a.metal-48xl",
            "hpc7a.12xlarge",
            "hpc7a.24xlarge",
            "hpc7a.48xlarge",
            "hpc7a.96xlarge",
            "c7gd.medium",
            "c7gd.large",
            "c7gd.xlarge",
            "c7gd.2xlarge",
            "c7gd.4xlarge",
            "c7gd.8xlarge",
            "c7gd.12xlarge",
            "c7gd.16xlarge",
            "m7gd.medium",
            "m7gd.large",
            "m7gd.xlarge",
            "m7gd.2xlarge",
            "m7gd.4xlarge",
            "m7gd.8xlarge",
            "m7gd.12xlarge",
            "m7gd.16xlarge",
            "r7gd.medium",
            "r7gd.large",
            "r7gd.xlarge",
            "r7gd.2xlarge",
            "r7gd.4xlarge",
            "r7gd.8xlarge",
            "r7gd.12xlarge",
            "r7gd.16xlarge",
            "r7a.medium",
            "r7a.large",
            "r7a.xlarge",
            "r7a.2xlarge",
            "r7a.4xlarge",
            "r7a.8xlarge",
            "r7a.12xlarge",
            "r7a.16xlarge",
            "r7a.24xlarge",
            "r7a.32xlarge",
            "r7a.48xlarge",
            "c7i.large",
            "c7i.xlarge",
            "c7i.2xlarge",
            "c7i.4xlarge",
            "c7i.8xlarge",
            "c7i.12xlarge",
            "c7i.16xlarge",
            "c7i.24xlarge",
            "c7i.48xlarge",
            "mac2-m2pro.metal",
            "r7iz.large",
            "r7iz.xlarge",
            "r7iz.2xlarge",
            "r7iz.4xlarge",
            "r7iz.8xlarge",
            "r7iz.12xlarge",
            "r7iz.16xlarge",
            "r7iz.32xlarge",
            "c7a.medium",
            "c7a.large",
            "c7a.xlarge",
            "c7a.2xlarge",
            "c7a.4xlarge",
            "c7a.8xlarge",
            "c7a.12xlarge",
            "c7a.16xlarge",
            "c7a.24xlarge",
            "c7a.32xlarge",
            "c7a.48xlarge",
            "c7a.metal-48xl",
            "r7a.metal-48xl",
            "r7i.large",
            "r7i.xlarge",
            "r7i.2xlarge",
            "r7i.4xlarge",
            "r7i.8xlarge",
            "r7i.12xlarge",
            "r7i.16xlarge",
            "r7i.24xlarge",
            "r7i.48xlarge",
            "dl2q.24xlarge",
            "mac2-m2.metal",
            "i4i.12xlarge",
            "i4i.24xlarge",
            "c7i.metal-24xl",
            "c7i.metal-48xl",
            "m7i.metal-24xl",
            "m7i.metal-48xl",
            "r7i.metal-24xl",
            "r7i.metal-48xl",
        ]
    ] = None
    #: The name of the key pair. You can create a key pair using `CreateKeyPair <https
    #: ://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html>`_ or
    #: `I mportKeyPair
    #: <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Import
    #: KeyPair.html>`_.
    KeyName: Optional[str] = None
    #: The monitoring for the instance.
    Monitoring: Optional[LaunchTemplatesMonitoringRequest] = None
    #: The placement for the instance.
    Placement: Optional[LaunchTemplatePlacementRequest] = None
    #: The ID of the RAM disk.
    RamDiskId: Optional[str] = None
    #: If you set this parameter to ``true``, you can't terminate the instance using
    #: the Amazon EC2 console, CLI, or API; otherwise, you can. To change this
    #: attribute after launch, use `ModifyInstanceAttribute <https://docs.aws.amazon.c
    #: om/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html>`_.
    #: Alternatively, if you set ``InstanceInitiatedShutdownBehavior`` to
    #: ``terminate``, you can terminate the instance by running the shutdown command
    #: from the instance.
    DisableApiTermination: Optional[bool] = None
    #: Indicates whether an instance stops or terminates when you initiate shutdown
    #: from the instance (using the operating system command for system shutdown).
    InstanceInitiatedShutdownBehavior: Optional[Literal["stop", "terminate"]] = None
    #: The user data to make available to the instance. You must provide
    #: base64-encoded text. User data is limited to 16 KB. For more information, see
    #: `Run commands on your Linux instance at launch
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html>`_ (Linux)
    #: or `Work with instance user data
    #: <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instancedata-add- user-
    #: data.html>`_ (Windows) in the *Amazon Elastic Compute Cloud User Guide*.
    UserData: Optional[str] = None
    #: The tags to apply to the resources that are created during instance launch.
    #: These tags are not applied to the launch template.
    TagSpecifications: Optional[List["LaunchTemplateTagSpecificationRequest"]] = None
    #: An elastic GPU to associate with the instance.
    ElasticGpuSpecifications: Optional[List["ElasticGpuSpecification"]] = None
    #: An elastic inference accelerator to associate with the instance. Elastic
    #: inference accelerators are a resource you can attach to your Amazon EC2
    #: instances to accelerate your Deep Learning (DL) inference workloads.
    ElasticInferenceAccelerators: Optional[
        List["LaunchTemplateElasticInferenceAccelerator"]
    ] = None
    #: One or more security group IDs. You can create a security group using `CreateSe
    #: curityGroup <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateS
    #: ecurityGroup.html>`_.
    SecurityGroupIds: Optional[List[str]] = None
    #: One or more security group names. For a nondefault VPC, you must use security
    #: group IDs instead.
    SecurityGroups: Optional[List[str]] = None
    #: The market (purchasing) option for the instances.
    InstanceMarketOptions: Optional[LaunchTemplateInstanceMarketOptionsRequest] = None
    #: The credit option for CPU usage of the instance. Valid only for T instances.
    CreditSpecification: Optional[CreditSpecificationRequest] = None
    #: The CPU options for the instance. For more information, see `Optimizing CPU
    #: Options <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-
    #: cpu.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    CpuOptions: Optional[LaunchTemplateCpuOptionsRequest] = None
    #: The Capacity Reservation targeting option. If you do not specify this
    #: parameter, the instance's Capacity Reservation preference defaults to ``open``,
    #: which enables it to run in any open Capacity Reservation that has matching
    #: attributes (instance type, platform, Availability Zone).
    CapacityReservationSpecification: Optional[
        LaunchTemplateCapacityReservationSpecificationRequest
    ] = None
    #: The license configurations.
    LicenseSpecifications: Optional[
        List["LaunchTemplateLicenseConfigurationRequest"]
    ] = None
    #: Indicates whether an instance is enabled for hibernation. This parameter is
    #: valid only if the instance meets the `hibernation prerequisites
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-
    #: prerequisites.html>`_. For more information, see `Hibernate your instance
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_ in the
    #: *Amazon Elastic Compute Cloud User Guide*.
    HibernationOptions: Optional[LaunchTemplateHibernationOptionsRequest] = None
    #: The metadata options for the instance. For more information, see `Instance
    #: metadata and user data
    #: <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-
    #: metadata.html>`_ in the *Amazon Elastic Compute Cloud User Guide*.
    MetadataOptions: Optional[LaunchTemplateInstanceMetadataOptionsRequest] = None
    #: Indicates whether the instance is enabled for Amazon Web Services Nitro
    #: Enclaves. For more information, see  `What is Amazon Web Services Nitro
    #: Enclaves? <https://docs.aws.amazon.com/enclaves/latest/user/nitro-
    #: enclave.html>`_ in the *Amazon Web Services Nitro Enclaves User Guide*.
    EnclaveOptions: Optional[LaunchTemplateEnclaveOptionsRequest] = None
    #: The attributes for the instance types. When you specify instance attributes,
    #: Amazon EC2 will identify instance types with these attributes.
    InstanceRequirements: Optional[InstanceRequirementsRequest] = None
    #: The options for the instance hostname. The default values are inherited from
    #: the subnet.
    PrivateDnsNameOptions: Optional[LaunchTemplatePrivateDnsNameOptionsRequest] = None
    #: The maintenance options for the instance.
    MaintenanceOptions: Optional[LaunchTemplateInstanceMaintenanceOptionsRequest] = None
    #: Indicates whether to enable the instance for stop protection. For more
    #: information, see `Stop protection <https://docs.aws.amazon.com/AWSEC2/latest/Us
    #: erGuide/Stop_Start.html#Using_StopProtection>`_ in the *Amazon Elastic Compute
    #: Cloud User Guide*.
    DisableApiStop: Optional[bool] = None


class ValidationError(Boto3Model):
    """
    The error code and error message that is returned for a parameter or
    parameter combination that is not valid when a new launch template or new
    version of a launch template is created.
    """

    #: The error code that indicates why the parameter or parameter combination is not
    #: valid. For more information about error codes, see `Error codes
    #: <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-
    #: overview.html>`_.
    Code: Optional[str] = None
    #: The error message that describes why the parameter or parameter combination is
    #: not valid. For more information about error messages, see `Error codes
    #: <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-
    #: overview.html>`_.
    Message: Optional[str] = None


class ValidationWarning(Boto3Model):
    """
    If the launch template contains parameters or parameter combinations that
    are not valid, an error code and an error message are returned for each
    issue that's found.
    """

    #: The error codes and error messages.
    Errors: Optional[List["ValidationError"]] = None


class CreateLaunchTemplateResult(Boto3Model):
    #: Information about the launch template.
    LaunchTemplateInstance: LaunchTemplate = Field(
        default=None, serialization_alias="LaunchTemplate"
    )
    #: If the launch template contains parameters or parameter combinations that are
    #: not valid, an error code and an error message are returned for each issue
    #: that's found.
    Warning: Optional[ValidationWarning] = None


class DeleteLaunchTemplateResult(Boto3Model):
    #: Information about the launch template.
    LaunchTemplateInstance: LaunchTemplate = Field(
        default=None, serialization_alias="LaunchTemplate"
    )


class DescribeLaunchTemplatesResult(Boto3Model):
    #: Information about the launch templates.
    LaunchTemplates: Optional[List["LaunchTemplate"]] = None
    #: The token to use to retrieve the next page of results. This value is ``null``
    #: when there are no more results to return.
    NextToken: Optional[str] = None


class CreateLaunchTemplateVersionResult(Boto3Model):
    #: Information about the launch template version.
    LaunchTemplateVersionInstance: LaunchTemplateVersion = Field(
        default=None, serialization_alias="LaunchTemplateVersion"
    )
    #: If the new version of the launch template contains parameters or parameter
    #: combinations that are not valid, an error code and an error message are
    #: returned for each issue that's found.
    Warning: Optional[ValidationWarning] = None


class DeleteLaunchTemplateVersionsResponseSuccessItem(Boto3Model):
    """
    Describes a launch template version that was successfully deleted.
    """

    #: The ID of the launch template.
    LaunchTemplateId: Optional[str] = None
    #: The name of the launch template.
    LaunchTemplateName: Optional[str] = None
    #: The version number of the launch template.
    VersionNumber: Optional[int] = None


class EC2ResponseError(Boto3Model):
    """
    Information about the error.
    """

    #: The error code.
    Code: Optional[
        Literal[
            "launchTemplateIdDoesNotExist",
            "launchTemplateIdMalformed",
            "launchTemplateNameDoesNotExist",
            "launchTemplateNameMalformed",
            "launchTemplateVersionDoesNotExist",
            "unexpectedError",
        ]
    ] = None
    #: The error message, if applicable.
    Message: Optional[str] = None


class DeleteLaunchTemplateVersionsResponseErrorItem(Boto3Model):
    """
    Describes a launch template version that could not be deleted.
    """

    #: The ID of the launch template.
    LaunchTemplateId: Optional[str] = None
    #: The name of the launch template.
    LaunchTemplateName: Optional[str] = None
    #: The version number of the launch template.
    VersionNumber: Optional[int] = None
    #: Information about the error.
    ResponseError: Optional[EC2ResponseError] = None


class DeleteLaunchTemplateVersionsResult(Boto3Model):
    #: Information about the launch template versions that were successfully deleted.
    SuccessfullyDeletedLaunchTemplateVersions: Optional[
        List["DeleteLaunchTemplateVersionsResponseSuccessItem"]
    ] = None
    #: Information about the launch template versions that could not be deleted.
    UnsuccessfullyDeletedLaunchTemplateVersions: Optional[
        List["DeleteLaunchTemplateVersionsResponseErrorItem"]
    ] = None


class DescribeLaunchTemplateVersionsResult(Boto3Model):
    #: Information about the launch template versions.
    LaunchTemplateVersions: Optional[List["LaunchTemplateVersion"]] = None
    #: The token to use to retrieve the next page of results. This value is ``null``
    #: when there are no more results to return.
    NextToken: Optional[str] = None
