# 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,unused-import,redefined-outer-name
# pyright: reportUnusedImport=false
# mypy: disable-error-code="index, override, assignment, union-attr, misc"
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 your VPCs. The default is to describe all your VPCs.
        Alternatively, you can specify specific VPC IDs or filter the results
        to include only the VPCs that match specific criteria.

        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 and response.Vpcs:
            self.sessionize(response.Vpcs[0])
            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 your VPCs. The default is to describe all your VPCs.
        Alternatively, you can specify specific VPC IDs or filter the results
        to include only the VPCs that match specific criteria.

        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
        self.sessionize(results)
        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)

        results: bool = None
        if response is not None:
            results = response.EnableDnsHostnames["Value"]

        self.sessionize(results)
        return cast(bool, results)

    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)

        results: bool = None
        if response is not None:
            results = response.EnableDnsSupport["Value"]

        self.sessionize(results)
        return cast(bool, results)

    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)

        results: bool = None
        if response is not None:
            results = response.EnableNetworkAddressUsageMetrics["Value"]

        self.sessionize(results)
        return cast(bool, results)


class SubnetManager(ReadonlyBoto3ModelManager):

    service_name: str = "ec2"

    def get(self, SubnetId: str, *, DryRun: bool = False) -> Optional["Subnet"]:
        """
        Describes your subnets. The default is to describe all your subnets.
        Alternatively, you can specify specific subnet IDs or filter the
        results to include only the subnets that match specific criteria.

        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 and response.Subnets:
            self.sessionize(response.Subnets[0])
            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 your subnets. The default is to describe all your subnets.
        Alternatively, you can specify specific subnet IDs or filter the
        results to include only the subnets that match specific criteria.

        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
        self.sessionize(results)
        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)

        self.sessionize(response.GroupId)
        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 and response.SecurityGroups:
            self.sessionize(response.SecurityGroups[0])
            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
        self.sessionize(results)
        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)

        results: Optional[bool] = None
        if response is not None:
            results = response.Return

        self.sessionize(results)
        return cast(Optional[bool], results)

    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.
            IpPermissions: The permissions for the security group rules.

        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: 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)

        results: Optional[bool] = None
        if response is not None:
            results = response.Return

        self.sessionize(results)
        return cast(Optional[bool], results)


class NetworkAclManager(EC2TagsManagerMixin, Boto3ModelManager):

    service_name: str = "ec2"

    def create(
        self, model: "NetworkAcl", ClientToken: Optional[str] = None
    ) -> "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.

        Keyword Args:
            ClientToken: Unique, case-sensitive identifier that you provide to ensure
                the idempotency of the request. For more information, see `Ensuring
                idempotency <https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-
                idempotency.html>`_.
        """
        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"))
            ),
            ClientToken=self.serialize(ClientToken),
        )
        _response = self.client.create_network_acl(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateNetworkAclResult(**_response)

        self.sessionize(response.NetworkAclInstance)
        return cast("NetworkAcl", response.NetworkAclInstance)

    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 your network ACLs. The default is to describe all your
        network ACLs. Alternatively, you can specify specific network ACL IDs
        or filter the results to include only the network ACLs that match
        specific criteria.

        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 and response.NetworkAcls:
            self.sessionize(response.NetworkAcls[0])
            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 your network ACLs. The default is to describe all your
        network ACLs. Alternatively, you can specify specific network ACL IDs
        or filter the results to include only the network ACLs that match
        specific criteria.

        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
        self.sessionize(results)
        return results


class AMIManager(EC2TagsManagerMixin, Boto3ModelManager):

    service_name: str = "ec2"

    def create(self, model: "AMI", NoReboot: Optional[bool] = None) -> str:
        """
        Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance
        that is either running or stopped.

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

        Keyword Args:
            NoReboot: Indicates whether or not the instance should be automatically
                rebooted before creating the image. Specify one of the following values:
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            InstanceId=data.get("InstanceId"),
            Name=data.get("Name"),
            BlockDeviceMappings=data.get("BlockDeviceMappings"),
            Description=data.get("Description"),
            DryRun=data.get("DryRun"),
            NoReboot=self.serialize(NoReboot),
            TagSpecifications=self.serialize(
                self.serialize(self.convert_tags(model.Tags, "image"))
            ),
        )
        _response = self.client.create_image(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateImageResult(**_response)

        self.sessionize(response.ImageId)
        return cast(str, response.ImageId)

    def delete(self, ImageId: str, *, DryRun: bool = False) -> None:
        """
        Deregisters the specified AMI. After you deregister an AMI, it can't be
        used to launch new instances.

        Args:
            ImageId: The ID of the AMI.

        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(
            ImageId=self.serialize(ImageId), DryRun=self.serialize(DryRun)
        )
        self.client.deregister_image(**{k: v for k, v in args.items() if v is not None})

    def get(
        self,
        ImageId: str,
        *,
        ExecutableUsers: Optional[List[str]] = None,
        Owners: Optional[List[str]] = None,
        IncludeDeprecated: Optional[bool] = None,
        IncludeDisabled: Optional[bool] = None,
        DryRun: bool = False
    ) -> Optional["AMI"]:
        """
        Describes the specified images (AMIs, AKIs, and ARIs) available to you
        or all of the images available to you.

        Args:
            ImageId: The IDs of the images.

        Keyword Args:
            ExecutableUsers: Scopes the images by users with explicit launch
                permissions. Specify an Amazon Web Services account ID, ``self`` (the
                sender of the request), or ``all`` (public AMIs).
            Owners: Scopes the results to images with the specified owners. You can
                specify a combination of Amazon Web Services account IDs, ``self``,
                ``amazon``, and ``aws-marketplace``. If you omit this parameter, the
                results include all images for which you have launch permissions,
                regardless of ownership.
            IncludeDeprecated: Specifies whether to include deprecated AMIs.
            IncludeDisabled: Specifies whether to include disabled AMIs.
            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(
            ExecutableUsers=self.serialize(ExecutableUsers),
            ImageIds=self.serialize([ImageId]),
            Owners=self.serialize(Owners),
            IncludeDeprecated=self.serialize(IncludeDeprecated),
            IncludeDisabled=self.serialize(IncludeDisabled),
            DryRun=self.serialize(DryRun),
        )
        _response = self.client.describe_images(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DescribeImagesResult(**_response)

        if response and response.Images:
            self.sessionize(response.Images[0])
            return response.Images[0]
        return None

    def list(
        self,
        *,
        ExecutableUsers: Optional[List[str]] = None,
        Filters: Optional[List[Filter]] = None,
        ImageIds: Optional[List[str]] = None,
        Owners: Optional[List[str]] = None,
        IncludeDeprecated: Optional[bool] = None,
        IncludeDisabled: Optional[bool] = None,
        DryRun: bool = False
    ) -> List["AMI"]:
        """
        Describes the specified images (AMIs, AKIs, and ARIs) available to you
        or all of the images available to you.

        Keyword Args:
            ExecutableUsers: Scopes the images by users with explicit launch
                permissions. Specify an Amazon Web Services account ID, ``self`` (the
                sender of the request), or ``all`` (public AMIs).
            Filters: The filters.
            ImageIds: The image IDs.
            Owners: Scopes the results to images with the specified owners. You can
                specify a combination of Amazon Web Services account IDs, ``self``,
                ``amazon``, and ``aws-marketplace``. If you omit this parameter, the
                results include all images for which you have launch permissions,
                regardless of ownership.
            IncludeDeprecated: Specifies whether to include deprecated AMIs.
            IncludeDisabled: Specifies whether to include disabled AMIs.
            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_images")
        args: Dict[str, Any] = dict(
            ExecutableUsers=self.serialize(ExecutableUsers),
            Filters=self.serialize(Filters),
            ImageIds=self.serialize(ImageIds),
            Owners=self.serialize(Owners),
            IncludeDeprecated=self.serialize(IncludeDeprecated),
            IncludeDisabled=self.serialize(IncludeDisabled),
            DryRun=self.serialize(DryRun),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["AMI"] = []
        for _response in response_iterator:
            response = DescribeImagesResult(**_response)
            if response.Images:
                results.extend(response.Images)
            else:
                break
        self.sessionize(results)
        return results

    def copy(
        self,
        ClientToken: str,
        Name: str,
        SourceImageId: str,
        SourceRegion: str,
        *,
        Description: Optional[str] = None,
        Encrypted: Optional[bool] = None,
        KmsKeyId: Optional[str] = None,
        DestinationOutpostArn: Optional[str] = None,
        DryRun: Optional[bool] = None,
        CopyImageTags: Optional[bool] = None,
        TagSpecifications: Optional[List["TagSpecification"]] = None
    ) -> str:
        """
        Initiates an AMI copy operation. You can copy an AMI from one Region to
        another, or from a Region to an Outpost. You can't copy an AMI from an Outpost
        to a Region, from one Outpost to another, or within the same Outpost. To copy
        an AMI to another partition, see `CreateStoreImageTask <https://docs.aws.amazon
        .com/AWSEC2/latest/APIReference/API_CreateStoreImageTask.html>`_.

        Args:
            ClientToken: Unique, case-sensitive identifier you provide to ensure
                idempotency of the request. For more information, see `Ensuring idempotency
                <https://docs.aws.amaz
                on.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html>`_ in the
                *Amazon EC2 API Reference*.
            Name: The name of the new AMI in the destination Region.
            SourceImageId: The ID of the AMI to copy.
            SourceRegion: The name of the Region that contains the AMI to copy.

        Keyword Args:
            Description: A description for the new AMI in the destination Region.
            Encrypted: Specifies whether the destination snapshots of the copied image
                should be encrypted. You can encrypt a copy of an unencrypted snapshot, but
                you cannot create an unencrypted copy of an encrypted snapshot. The default
                KMS key for Amazon EBS is used unless you specify a non-default Key
                Management Service (KMS) KMS key using ``KmsKeyId``. For more information,
                see `Use encryption with EBS-backed AMIs
                <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html>`_
                in the *Amazon EC2 User Guide*.
            KmsKeyId: The identifier of the symmetric Key Management Service (KMS) KMS
                key to use when creating encrypted volumes. If this parameter is not
                specified, your Amazon Web Services managed KMS key for Amazon EBS is used.
                If you specify a KMS key, you must also set the encrypted state to
                ``true``.
            DestinationOutpostArn: The Amazon Resource Name (ARN) of the Outpost to
                which to copy the AMI. Only specify this parameter when copying an AMI from
                an Amazon Web Services Region to an Outpost. The AMI must be in the Region
                of the destination Outpost. You cannot copy an AMI from an Outpost to a
                Region, from one Outpost to another, or within the same Outpost.
            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``.
            CopyImageTags: Indicates whether to include your user-defined AMI tags when
                copying the AMI.
            TagSpecifications: The tags to apply to the new AMI and new snapshots. You
                can tag the AMI, the snapshots, or both. To tag the new AMI, the value for
                ````ResourceType```` must be "image" To tag the new snapshots, the value
                for ````ResourceType```` must be "snapshot". The same tag is applied to all
                the new snapshots.

        """
        args: Dict[str, Any] = dict(
            Name=self.serialize(Name),
            SourceImageId=self.serialize(SourceImageId),
            SourceRegion=self.serialize(SourceRegion),
            ClientToken=self.serialize(ClientToken),
            Description=self.serialize(Description),
            Encrypted=self.serialize(Encrypted),
            KmsKeyId=self.serialize(KmsKeyId),
            DestinationOutpostArn=self.serialize(DestinationOutpostArn),
            DryRun=self.serialize(DryRun),
            CopyImageTags=self.serialize(CopyImageTags),
            TagSpecifications=self.serialize(TagSpecifications),
        )
        _response = self.client.copy_image(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CopyImageResult(**_response)

        results: str = None
        if response is not None:
            results = response.ImageId

        self.sessionize(results)
        return cast(str, 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 a value
                that is more capacity than Amazon EC2 can launch in the target Availability
                Zone, Amazon EC2 launches the largest possible number of instances above
                the specified minimum count.
            MinCount: The minimum number of instances to launch. If you specify a value
                that is more capacity than Amazon EC2 can provide in the target
                Availability Zone, Amazon EC2 does not launch any 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 to make available to the instance. User data must
                be base64-encoded. Depending on the tool or SDK that you're using, the
                base64-encoding might be performed for you. For more information, see `Work
                with instance user data
                <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-add-
                user-data.html>`_.
            ElasticGpuSpecification: An elastic GPU to associate with the instance.
            ElasticInferenceAccelerators: An elastic inference accelerator to associate
                with the instance.
            LaunchTemplate: The launch template. Any additional parameters that you
                specify for the new instance overwrite the corresponding parameters
                included in the launch template.
            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)

        self.sessionize(response.Instances[0])
        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 and response.Reservations:
            self.sessionize(response.Reservations[0])
            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
        self.sessionize(results)
        return results

    def start(
        self,
        InstanceIds: List[str],
        *,
        AdditionalInfo: Optional[str] = None,
        DryRun: bool = False
    ) -> Optional[List["InstanceStateChange"]]:
        """
        Starts an Amazon EBS-backed instance that you've previously stopped.

        Args:
            InstanceIds: The IDs of the instances.

        Keyword Args:
            AdditionalInfo: Reserved.
            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(InstanceIds),
            AdditionalInfo=self.serialize(AdditionalInfo),
            DryRun=self.serialize(DryRun),
        )
        _response = self.client.start_instances(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = StartInstancesResult(**_response)

        results: Optional[List["InstanceStateChange"]] = None
        if response is not None:
            results = response.StartingInstances

        self.sessionize(results)
        return cast(Optional[List["InstanceStateChange"]], results)

    def stop(
        self,
        InstanceIds: List[str],
        *,
        Hibernate: Optional[bool] = None,
        DryRun: bool = False,
        Force: Optional[bool] = None
    ) -> Optional[List["InstanceStateChange"]]:
        """
        Stops an Amazon EBS-backed instance. For more information, see `Stop and start
        Amazon EC2
        instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html>`_
        in the *Amazon EC2 User Guide*.

        Args:
            InstanceIds: The IDs of the instances.

        Keyword Args:
            Hibernate: Hibernates the instance if the instance was enabled for
                hibernation at launch. If the instance cannot hibernate successfully, a
                normal shutdown occurs. For more information, see `Hibernate your instance
                <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_ in
                the *Amazon EC2 User Guide*.
            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``.
            Force: Forces the instances to stop. The instances do not have an
                opportunity to flush file system caches or file system metadata. If you use
                this option, you must perform file system check and repair procedures. This
                option is not recommended for Windows instances.

        """
        args: Dict[str, Any] = dict(
            InstanceIds=self.serialize(InstanceIds),
            Hibernate=self.serialize(Hibernate),
            DryRun=self.serialize(DryRun),
            Force=self.serialize(Force),
        )
        _response = self.client.stop_instances(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = StopInstancesResult(**_response)

        results: Optional[List["InstanceStateChange"]] = None
        if response is not None:
            results = response.StoppingInstances

        self.sessionize(results)
        return cast(Optional[List["InstanceStateChange"]], results)

    def reboot(self, InstanceIds: List[str], *, DryRun: bool = False) -> "None":
        """
        Requests a reboot of the specified instances. This operation is
        asynchronous; it only queues a request to reboot the specified
        instances. The operation succeeds if the instances are valid and belong
        to you. Requests to reboot terminated instances are ignored.

        Args:
            InstanceIds: The instance IDs.

        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(InstanceIds), DryRun=self.serialize(DryRun)
        )
        self.client.reboot_instances(**{k: v for k, v in args.items() if v is not None})

        self.sessionize(results)
        return cast("None", results)

    def terminate(
        self, InstanceIds: List[str], *, DryRun: bool = False
    ) -> Optional[List["InstanceStateChange"]]:
        """
        Shuts down the specified instances. This operation is idempotent; if
        you terminate an instance more than once, each call succeeds.

        Args:
            InstanceIds: The IDs of the instances.

        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(InstanceIds), DryRun=self.serialize(DryRun)
        )
        _response = self.client.terminate_instances(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = TerminateInstancesResult(**_response)

        results: Optional[List["InstanceStateChange"]] = None
        if response is not None:
            results = response.TerminatingInstances

        self.sessionize(results)
        return cast(Optional[List["InstanceStateChange"]], 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)

        self.sessionize(response.LaunchTemplateInstance)
        return cast("LaunchTemplate", response.LaunchTemplateInstance)

    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.LaunchTemplateInstance)

    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 and response.LaunchTemplates:
            self.sessionize(response.LaunchTemplates[0])
            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
        self.sessionize(results)
        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 must specify an
        existing launch template, either by name or ID. You can determine
        whether the new version inherits parameters from a source version, and
        add or overwrite parameters as needed.

        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 of the launch template on which to base the new
                version. 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
                EC2 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)

        self.sessionize(response.LaunchTemplateVersionInstance)
        return cast("LaunchTemplateVersion", response.LaunchTemplateVersionInstance)

    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 and response.LaunchTemplateVersions:
            self.sessionize(response.LaunchTemplateVersions[0])
            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
        self.sessionize(results)
        return results


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


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

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


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

    AssociationId: Optional[str] = None
    """
    The association ID for the IPv6 CIDR block.
    """
    Ipv6CidrBlock: Optional[str] = None
    """
    The IPv6 CIDR block.
    """
    Ipv6CidrBlockState: Optional[VpcCidrBlockState] = None
    """
    Information about the state of the CIDR block.
    """
    NetworkBorderGroup: Optional[str] = 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``.
    """
    Ipv6Pool: Optional[str] = None
    """
    The ID of the IPv6 address pool from which the IPv6 CIDR block is
    allocated.
    """
    Ipv6AddressAttribute: Optional[Literal["public", "private"]] = None
    """
    Public IPv6 addresses are those advertised on the internet from Amazon Web
    Services.

    Private IP addresses are not and cannot be advertised on the internet from
    Amazon Web Services.
    """
    IpSource: Optional[Literal["amazon", "byoip", "none"]] = None
    """
    The source that allocated the IP address space.

    ``byoip`` or ``amazon``
    indicates public IP address space allocated by Amazon or space that you have
    allocated with Bring your own IP (BYOIP). ``none`` indicates private space.
    """


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

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


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

    tag_class: ClassVar[Type] = Tag
    manager_class: ClassVar[Type[Boto3ModelManager]] = VpcManager

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

    @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.
    """

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


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

    AssociationId: Optional[str] = None
    """
    The ID of the association.
    """
    Ipv6CidrBlock: Optional[str] = None
    """
    The IPv6 CIDR block.
    """
    Ipv6CidrBlockState: Optional[SubnetCidrBlockState] = None
    """
    The state of the CIDR block.
    """
    Ipv6AddressAttribute: Optional[Literal["public", "private"]] = None
    """
    Public IPv6 addresses are those advertised on the internet from Amazon Web
    Services.

    Private IP addresses are not and cannot be advertised on the internet from
    Amazon Web Services.
    """
    IpSource: Optional[Literal["amazon", "byoip", "none"]] = None
    """
    The source that allocated the IP address space.

    ``byoip`` or ``amazon``
    indicates public IP address space allocated by Amazon or space that you have
    allocated with Bring your own IP (BYOIP). ``none`` indicates private space.
    """


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.
    """

    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    """
    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.
    """
    EnableResourceNameDnsARecord: Optional[bool] = None
    """
    Indicates whether to respond to DNS queries for instance hostnames with DNS
    A records.
    """
    EnableResourceNameDnsAAAARecord: Optional[bool] = None
    """
    Indicates whether to respond to DNS queries for instance hostname with DNS
    AAAA records.
    """


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

    tag_class: ClassVar[Type] = Tag
    manager_class: ClassVar[Type[Boto3ModelManager]] = SubnetManager

    VpcId: str
    """
    The ID of the VPC the subnet is in.
    """
    AvailabilityZone: str
    """
    The Availability Zone of the subnet.
    """
    CidrBlock: str
    """
    The IPv4 CIDR block assigned to the subnet.
    """
    Ipv6Native: Optional[bool] = False
    """
    Indicates whether this is an IPv6 only subnet.
    """
    Tags: Optional[List[Tag]] = None
    """
    Any tags assigned to the subnet.
    """
    AvailabilityZoneId: Optional[str] = None
    """
    The AZ ID of the subnet.
    """
    AvailableIpAddressCount: int = Field(default=None, frozen=True)
    """
    The number of unused private IPv4 addresses in the subnet.

    The IPv4 addresses for any stopped instances are considered unavailable.
    """
    DefaultForAz: bool = Field(default=None, frozen=True)
    """
    Indicates whether this is the default subnet for the Availability Zone.
    """
    EnableLniAtDeviceIndex: int = 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).
    """
    MapPublicIpOnLaunch: bool = Field(default=None, frozen=True)
    """
    Indicates whether instances launched in this subnet receive a public IPv4
    address.
    """
    MapCustomerOwnedIpOnLaunch: 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.
    """
    CustomerOwnedIpv4Pool: str = Field(default=None, frozen=True)
    """
    The customer-owned IPv4 address pool associated with the subnet.
    """
    State: Literal["pending", "available", "unavailable"] = Field(
        default=None, frozen=True
    )
    """
    The current state of the subnet.
    """
    SubnetId: str = Field(default=None, frozen=True)
    """
    The ID of the subnet.
    """
    OwnerId: str = Field(default=None, frozen=True)
    """
    The ID of the Amazon Web Services account that owns the subnet.
    """
    AssignIpv6AddressOnCreation: bool = 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.
    """
    Ipv6CidrBlockAssociationSet: List["SubnetIpv6CidrBlockAssociation"] = Field(
        default=None, frozen=True
    )
    """
    Information about the IPv6 CIDR blocks associated with the subnet.
    """
    SubnetArn: str = Field(default=None, frozen=True)
    """
    The Amazon Resource Name (ARN) of the subnet.
    """
    OutpostArn: Optional[str] = None
    """
    The Amazon Resource Name (ARN) of the Outpost.
    """
    EnableDns64: bool = Field(default=None, frozen=True)
    """
    Indicates whether DNS queries made to the Amazon-provided DNS Resolver in
    this subnet should return synthetic IPv6 addresses for IPv4-only
    destinations.
    """
    PrivateDnsNameOptionsOnLaunch: EC2PrivateDnsNameOptionsOnLaunch = 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.
    """

    @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 address range.
    """

    CidrIp: Optional[str] = None
    """
    The IPv4 address range.

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


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

    CidrIpv6: Optional[str] = None
    """
    The IPv6 address range.

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


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

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


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

    Description: Optional[str] = None
    """
    A description for the security group rule that references this user ID
    group pair.
    """
    GroupId: Optional[str] = None
    """
    The ID of the security group.
    """
    GroupName: Optional[str] = None
    """
    [Default VPC] The name of the security group.

    For a security group in a nondefault VPC, use the security group ID.
    """
    PeeringStatus: Optional[str] = None
    """
    The status of a VPC peering connection, if applicable.
    """
    UserId: Optional[str] = None
    """
    The ID of an Amazon Web Services account.
    """
    VpcId: Optional[str] = None
    """
    The ID of the VPC for the referenced security group, if applicable.
    """
    VpcPeeringConnectionId: Optional[str] = None
    """
    The ID of the VPC peering connection, if applicable.
    """


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

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


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

    tag_class: ClassVar[Type] = Tag
    manager_class: ClassVar[Type[Boto3ModelManager]] = SecurityGroupManager

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

    @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.
    """

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


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

    Code: Optional[int] = None
    """
    The ICMP code.

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

    A value of -1 means all types.
    """


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

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


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

    CidrBlock: Optional[str] = None
    """
    The IPv4 network range to allow or deny, in CIDR notation.
    """
    Egress: Optional[bool] = None
    """
    Indicates whether the rule is an egress rule (applied to traffic leaving
    the subnet).
    """
    IcmpTypeCode: Optional[EC2IcmpTypeCode] = None
    """
ICMP protocol: The ICMP type and code.
    """
    Ipv6CidrBlock: Optional[str] = None
    """
    The IPv6 network range to allow or deny, in CIDR notation.
    """
    PortRange: Optional[NetworkAclPortRange] = None
    """
TCP or UDP protocols: The range of ports the rule applies to.
    """
    Protocol: Optional[str] = None
    """
    The protocol number.

    A value of "-1" means all protocols.
    """
    RuleAction: Optional[Literal["allow", "deny"]] = None
    """
    Indicates whether to allow or deny the traffic that matches the rule.
    """
    RuleNumber: Optional[int] = None
    """
    The rule number for the entry.

    ACL entries are processed in ascending order by rule number.
    """


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

    tag_class: ClassVar[Type] = Tag
    manager_class: ClassVar[Type[Boto3ModelManager]] = NetworkAclManager

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

    @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 ProductCode(Boto3Model):
    """
    Describes a product code.
    """

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


class EC2StateReason(Boto3Model):
    """
    The reason for the state change.
    """

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


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

    DeleteOnTermination: Optional[bool] = None
    """
    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*.
    """
    Iops: Optional[int] = 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.
    """
    SnapshotId: Optional[str] = None
    """
    The ID of the snapshot.
    """
    VolumeSize: Optional[int] = 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.
    """
    VolumeType: Optional[
        Literal["standard", "io1", "io2", "gp2", "sc1", "st1", "gp3"]
    ] = None
    """
    The volume type.

    For more information, see
    `Amazon EBS volume types <https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html>`_
    in the *Amazon EBS User Guide*.
    """
    KmsKeyId: Optional[str] = None
    """
    Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed
    CMK under which the EBS volume is encrypted.
    """
    Throughput: Optional[int] = None
    """
    The throughput that the volume supports, in MiB/s.
    """
    OutpostArn: Optional[str] = None
    """
    The ARN of the Outpost on which the snapshot is stored.
    """
    Encrypted: Optional[bool] = 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/ebs/latest/userguide/ebs-
    encryption.html#encryption-parameters>`_ in the *Amazon EBS User Guide*.
    """


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

    DeviceName: Optional[str] = None
    """
    The device name (for example, ``/dev/sdh`` or ``xvdh``).
    """
    VirtualName: 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.
    """
    Ebs: Optional[EbsBlockDevice] = None
    """
    Parameters used to automatically set up EBS volumes when the instance is
    launched.
    """
    NoDevice: Optional[str] = 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.
    """


class AMI(TagsDictMixin, PrimaryBoto3Model):
    """
    Describes an image.
    """

    tag_class: ClassVar[Type] = Tag
    manager_class: ClassVar[Type[Boto3ModelManager]] = AMIManager

    Architecture: Literal["i386", "x86_64", "arm64", "x86_64_mac", "arm64_mac"] = Field(
        default=None, frozen=True
    )
    """
    The architecture of the image.
    """
    ImageId: str = Field(default=None, frozen=True)
    """
    The ID of the AMI.
    """
    ImageType: Literal["machine", "kernel", "ramdisk"] = Field(
        default=None, frozen=True
    )
    """
    The type of image.
    """
    Public: bool = Field(default=None, frozen=True)
    """
    Indicates whether the image has public launch permissions.

    The value is
    ``true`` if this image has public launch permissions or ``false`` if it has
    only implicit and explicit launch permissions.
    """
    KernelId: str = Field(default=None, frozen=True)
    """
    The kernel associated with the image, if any.

    Only applicable for machine images.
    """
    Platform: Literal["Windows"] = Field(default=None, frozen=True)
    """
    This value is set to ``windows`` for Windows AMIs; otherwise, it is blank.
    """
    PlatformDetails: str = Field(default=None, frozen=True)
    """
    The platform details associated with the billing code of the AMI.

    For more information, see
    `Understand AMI billing information <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-
    info.html>`_ in the *Amazon EC2 User Guide*.
    """
    UsageOperation: str = Field(default=None, frozen=True)
    """
    The operation of the Amazon EC2 instance and the billing code that is
    associated with the AMI.

    ``usageOperation`` corresponds to the
    `lineitem/Operation <https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-
    columns.html#Lineitem-details-O-Operation>`_ column on your Amazon Web Services
    Cost and Usage Report and in the `Amazon Web Services Price List
    API <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-
    changes.html>`_. You can view these fields on the **Instances** or **AMIs** pages
    in the Amazon EC2 console, or in the responses that are returned by the `Descri
    beImages <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeIm
    ages.html>`_ command in the Amazon EC2 API, or the `describe-
    images <https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-
    images.html>`_ command in the CLI.
    """
    ProductCodes: List["ProductCode"] = Field(default=None, frozen=True)
    """
    Any product codes associated with the AMI.
    """
    RamdiskId: str = Field(default=None, frozen=True)
    """
    The RAM disk associated with the image, if any.

    Only applicable for machine images.
    """
    State: Literal[
        "pending",
        "available",
        "invalid",
        "deregistered",
        "transient",
        "failed",
        "error",
        "disabled",
    ] = Field(default=None, frozen=True)
    """
    The current state of the AMI.

    If the state is ``available``, the image is
    successfully registered and can be used to launch an instance.
    """
    EnaSupport: bool = Field(default=None, frozen=True)
    """
    Specifies whether enhanced networking with ENA is enabled.
    """
    ImageOwnerAlias: str = Field(default=None, frozen=True)
    """
    The owner alias (``amazon`` | ``aws-marketplace``).
    """
    RootDeviceName: str = Field(default=None, frozen=True)
    """
    The device name of the root device volume (for example, ``/dev/sda1``).
    """
    RootDeviceType: Literal["ebs", "instance-store"] = Field(default=None, frozen=True)
    """
    The type of root device used by the AMI.

    The AMI can use an Amazon EBS volume or an instance store volume.
    """
    SriovNetSupport: str = Field(default=None, frozen=True)
    """
    Specifies whether enhanced networking with the Intel 82599 Virtual Function
    interface is enabled.
    """
    VirtualizationType: Literal["hvm", "paravirtual"] = Field(default=None, frozen=True)
    """
    The type of virtualization of the AMI.
    """
    StateReason: EC2StateReason = Field(default=None, frozen=True)
    """
    The reason for the state change.
    """
    BootMode: Literal["legacy-bios", "uefi", "uefi-preferred"] = Field(
        default=None, frozen=True
    )
    """
    The boot mode of the image.

    For more information, see
    `Boot modes <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html>`_
    in
    the *Amazon EC2 User Guide*.
    """
    DeprecationTime: str = Field(default=None, frozen=True)
    """
    The date and time to deprecate the AMI, in UTC, in the following format:

    *YYYY*-*MM*-*DD*T*HH*:*MM*:*SS*Z. If you specified a value for seconds,
    Amazon EC2 rounds the seconds to the nearest minute.
    """
    ImdsSupport: Literal["v2.0"] = Field(default=None, frozen=True)
    """
    If ``v2.0``, it indicates that IMDSv2 is specified in the AMI.

    Instances
    launched from this AMI will have ``HttpTokens`` automatically set to
    ``required`` so that, by default, the instance requires that IMDSv2 is used
    when requesting instance metadata. In addition, ``HttpPutResponseHopLimit`` is
    set to ``2``. For more information, see `Configure the
    AMI <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-
    instances.html#configure-IMDS-new-instances-ami-configuration>`_ in the *Amazon
    EC2 User Guide*.
    """
    CreationDate: str = Field(default=None, frozen=True)
    """
    The date and time the image was created.
    """
    ImageLocation: str = Field(default=None, frozen=True)
    """
    The location of the AMI.
    """
    OwnerId: str = Field(default=None, frozen=True)
    """
    The ID of the Amazon Web Services account that owns the image.
    """
    BlockDeviceMappings: Optional[List["EC2BlockDeviceMapping"]] = None
    """
    Any block device mapping entries.
    """
    Description: Optional[str] = None
    """
    The description of the AMI that was provided during image creation.
    """
    Hypervisor: Literal["ovm", "xen"] = Field(default=None, frozen=True)
    """
    The hypervisor type of the image.

    Only ``xen`` is supported. ``ovm`` is not
    supported.
    """
    Name: Optional[str] = None
    """
    The name of the AMI that was provided during image creation.
    """
    Tags: List[Tag] = Field(default=None, frozen=True)
    """
    Any tags assigned to the image.
    """
    TpmSupport: Literal["v2.0"] = Field(default=None, frozen=True)
    """
    If the image 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*.
    """
    SourceInstanceId: str = Field(default=None, frozen=True)
    """
The ID of the instance that the AMI was created from if the AMI was created
using `CreateImage <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_
CreateImage.html>`_. This field only appears if the AMI was created using
CreateImage.
    """
    DeregistrationProtection: str = Field(default=None, frozen=True)
    """
    Indicates whether deregistration protection is enabled for the AMI.
    """
    LastLaunchedTime: str = Field(default=None, frozen=True)
    """
The date and time, in `ISO 8601 date-time
format <http://www.iso.org/iso/iso8601>`_, when the AMI was last used to launch
an EC2 instance. When the AMI is used to launch an instance, there is a
24-hour delay before that usage is reported.
    """

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

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

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

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


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

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

    Otherwise, basic monitoring is enabled.
    """


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

    AvailabilityZone: Optional[str] = None
    """
    The Availability Zone of the instance.
    """
    Affinity: Optional[str] = None
    """
    The affinity setting for the instance on the Dedicated Host.
    """
    GroupName: Optional[str] = None
    """
    The name of the placement group that the instance is in.

    If you specify
    ``GroupName``, you can't specify ``GroupId``.
    """
    PartitionNumber: Optional[int] = None
    """
    The number of the partition that the instance is in.

    Valid only if the
    placement group strategy is set to ``partition``.
    """
    HostId: Optional[str] = None
    """
    The ID of the Dedicated Host on which the instance resides.
    """
    Tenancy: Optional[Literal["default", "dedicated", "host"]] = None
    """
    The tenancy of the instance.

    An instance with a tenancy of ``dedicated`` runs
    on single-tenant hardware.
    """
    SpreadDomain: Optional[str] = None
    """
    Reserved for future use.
    """
    HostResourceGroupArn: Optional[str] = None
    """
    The ARN of the host resource group in which to launch the instances.
    """
    GroupId: Optional[str] = None
    """
    The ID of the placement group that the instance is in.

    If you specify
    ``GroupId``, you can't specify ``GroupName``.
    """


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

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


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

    AttachTime: Optional[datetime] = None
    """
    The time stamp when the attachment initiated.
    """
    DeleteOnTermination: Optional[bool] = None
    """
    Indicates whether the volume is deleted on instance termination.
    """
    Status: Optional[Literal["attaching", "attached", "detaching", "detached"]] = None
    """
    The attachment state.
    """
    VolumeId: Optional[str] = None
    """
    The ID of the EBS volume.
    """
    AssociatedResource: Optional[str] = None
    """
    The ARN of the Amazon ECS or Fargate task to which the volume is attached.
    """
    VolumeOwnerId: Optional[str] = None
    """
    The ID of the Amazon Web Services account that owns the volume.
    """


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

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


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

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


class ElasticGpuAssociation(Boto3Model):
    """
    Amazon Elastic Graphics reached end of life on January 8, 2024. For
    workloads that require graphics acceleration, we recommend that you use
    Amazon EC2 G4, G5, or G6 instances.

    Describes the association between an instance and an Elastic Graphics
    accelerator.
    """

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


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

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


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

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


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

    EnaSrdUdpEnabled: Optional[bool] = None
    """
    Indicates whether UDP traffic to and from the instance uses ENA Express.

    To specify this setting, you must first enable ENA Express.
    """


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

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


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

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


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

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


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

    Ipv6Address: Optional[str] = None
    """
    The IPv6 address.
    """
    IsPrimaryIpv6: Optional[bool] = 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>`_.
    """


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

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


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

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


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

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


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 EC2 User
    Guide*.
    """

    TcpEstablishedTimeout: Optional[int] = None
    """
    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.
    """
    UdpStreamTimeout: 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.
    """
    UdpTimeout: 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.
    """


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

    Association: Optional[InstanceNetworkInterfaceAssociation] = None
    """
    The association information for an Elastic IPv4 associated with the network
    interface.
    """
    Attachment: Optional[InstanceNetworkInterfaceAttachment] = None
    """
    The network interface attachment.
    """
    Description: Optional[str] = None
    """
    The description.
    """
    Groups: Optional[List["GroupIdentifier"]] = None
    """
    The security groups.
    """
    Ipv6Addresses: Optional[List["InstanceIpv6Address"]] = None
    """
    The IPv6 addresses associated with the network interface.
    """
    MacAddress: Optional[str] = None
    """
    The MAC address.
    """
    NetworkInterfaceId: Optional[str] = None
    """
    The ID of the network interface.
    """
    OwnerId: Optional[str] = None
    """
    The ID of the Amazon Web Services account that created the network
    interface.
    """
    PrivateDnsName: Optional[str] = None
    """
    The private DNS name.
    """
    PrivateIpAddress: Optional[str] = None
    """
    The IPv4 address of the network interface within the subnet.
    """
    PrivateIpAddresses: Optional[List["InstancePrivateIpAddress"]] = None
    """
    The private IPv4 addresses associated with the network interface.
    """
    SourceDestCheck: Optional[bool] = None
    """
    Indicates whether source/destination checking is enabled.
    """
    Status: Optional[
        Literal["available", "associated", "attaching", "in-use", "detaching"]
    ] = None
    """
    The status of the network interface.
    """
    SubnetId: Optional[str] = None
    """
    The ID of the subnet.
    """
    VpcId: Optional[str] = None
    """
    The ID of the VPC.
    """
    InterfaceType: Optional[str] = None
    """
    The type of network interface.
    """
    Ipv4Prefixes: Optional[List["InstanceIpv4Prefix"]] = None
    """
    The IPv4 delegated prefixes that are assigned to the network interface.
    """
    Ipv6Prefixes: Optional[List["InstanceIpv6Prefix"]] = None
    """
    The IPv6 delegated prefixes that are assigned to the network interface.
    """
    ConnectionTrackingConfiguration: Optional[
        ConnectionTrackingSpecificationResponse
    ] = 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 EC2 User
    Guide*.
    """


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

    CoreCount: Optional[int] = None
    """
    The number of CPU cores for the instance.
    """
    ThreadsPerCore: Optional[int] = None
    """
    The number of threads per CPU core.
    """
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = 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>`_.
    """


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

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


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

    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    """
    Describes the instance's Capacity Reservation preferences.

    Possible preferences
    include:
    """
    CapacityReservationTarget: Optional[CapacityReservationTargetResponse] = None
    """
    Information about the targeted Capacity Reservation or Capacity Reservation
    group.
    """


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

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


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

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


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

    State: Optional[Literal["pending", "applied"]] = None
    """
    The state of the metadata option changes.
    """
    HttpTokens: Optional[Literal["optional", "required"]] = None
    """
    Indicates whether IMDSv2 is required.
    """
    HttpPutResponseHopLimit: Optional[int] = None
    """
    The maximum number of hops that the metadata token can travel.
    """
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    """
    Indicates whether the HTTP metadata endpoint on your instances is enabled
    or disabled.
    """
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    """
    Indicates whether the IPv6 endpoint for the instance metadata service is
    enabled or disabled.
    """
    InstanceMetadataTags: 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>`_.
    """


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

    Enabled: Optional[bool] = None
    """
    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.
    """


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

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


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

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


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

    tag_class: ClassVar[Type] = Tag
    manager_class: ClassVar[Type[Boto3ModelManager]] = InstanceManager

    Tags: Optional[List[Tag]] = None
    """
    Any tags assigned to the instance.
    """
    AmiLaunchIndex: int = Field(default=None, frozen=True)
    """
    The AMI launch index, which can be used to find this instance in the launch
    group.
    """
    ImageId: Optional[str] = None
    """
    The ID of the AMI used to launch the instance.
    """
    InstanceId: str = Field(default=None, frozen=True)
    """
    The ID of the instance.
    """
    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",
            "r7iz.metal-16xl",
            "r7iz.metal-32xl",
            "c7gd.metal",
            "m7gd.metal",
            "r7gd.metal",
            "g6.xlarge",
            "g6.2xlarge",
            "g6.4xlarge",
            "g6.8xlarge",
            "g6.12xlarge",
            "g6.16xlarge",
            "g6.24xlarge",
            "g6.48xlarge",
            "gr6.4xlarge",
            "gr6.8xlarge",
            "c7i-flex.large",
            "c7i-flex.xlarge",
            "c7i-flex.2xlarge",
            "c7i-flex.4xlarge",
            "c7i-flex.8xlarge",
            "u7i-12tb.224xlarge",
            "u7in-16tb.224xlarge",
            "u7in-24tb.224xlarge",
            "u7in-32tb.224xlarge",
            "u7ib-12tb.224xlarge",
            "c7gn.metal",
            "r8g.medium",
            "r8g.large",
            "r8g.xlarge",
            "r8g.2xlarge",
            "r8g.4xlarge",
            "r8g.8xlarge",
            "r8g.12xlarge",
            "r8g.16xlarge",
            "r8g.24xlarge",
            "r8g.48xlarge",
            "r8g.metal-24xl",
            "r8g.metal-48xl",
            "mac2-m1ultra.metal",
            "g6e.xlarge",
            "g6e.2xlarge",
            "g6e.4xlarge",
            "g6e.8xlarge",
            "g6e.12xlarge",
            "g6e.16xlarge",
            "g6e.24xlarge",
            "g6e.48xlarge",
        ]
    ] = None
    """
    The instance type.
    """
    KernelId: Optional[str] = None
    """
    The kernel associated with this instance, if applicable.
    """
    KeyName: Optional[str] = None
    """
    The name of the key pair, if this instance was launched with an associated
    key pair.
    """
    LaunchTime: datetime = Field(default=None, frozen=True)
    """
    The time the instance was launched.
    """
    Monitoring: Optional[EC2DetailedMonitoring] = None
    """
    The monitoring for the instance.
    """
    Placement: Optional[EC2Placement] = None
    """
    The location where the instance launched, if applicable.
    """
    Platform: Literal["Windows"] = Field(default=None, frozen=True)
    """
    The platform.

    This value is ``windows`` for Windows instances; otherwise, it is
    empty.
    """
    PrivateDnsName: str = 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.
    """
    PrivateIpAddress: Optional[str] = None
    """
    The private IPv4 address assigned to the instance.
    """
    ProductCodes: List["ProductCode"] = Field(default=None, frozen=True)
    """
    The product codes attached to this instance, if applicable.
    """
    PublicDnsName: str = 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.
    """
    PublicIpAddress: str = Field(default=None, frozen=True)
    """
    The public IPv4 address, or the Carrier IP address assigned to the
    instance, if applicable.
    """
    RamdiskId: Optional[str] = None
    """
    The RAM disk associated with this instance, if applicable.
    """
    State: InstanceState = Field(default=None, frozen=True)
    """
    The current state of the instance.
    """
    StateTransitionReason: str = Field(default=None, frozen=True)
    """
    The reason for the most recent state transition.

    This might be an empty string.
    """
    SubnetId: Optional[str] = None
    """
    The ID of the subnet in which the instance is running.
    """
    VpcId: str = Field(default=None, frozen=True)
    """
    The ID of the VPC in which the instance is running.
    """
    Architecture: Literal["i386", "x86_64", "arm64", "x86_64_mac", "arm64_mac"] = Field(
        default=None, frozen=True
    )
    """
    The architecture of the image.
    """
    BlockDeviceMappings: Optional[List["InstanceBlockDeviceMapping"]] = None
    """
    Any block device mapping entries for the instance.
    """
    ClientToken: Optional[str] = None
    """
    The idempotency token you provided when you launched the instance, if
    applicable.
    """
    EbsOptimized: Optional[bool] = 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.
    """
    EnaSupport: bool = Field(default=None, frozen=True)
    """
    Specifies whether enhanced networking with ENA is enabled.
    """
    Hypervisor: Literal["ovm", "xen"] = Field(default=None, frozen=True)
    """
    The hypervisor type of the instance.

    The value ``xen`` is used for both Xen and
    Nitro hypervisors.
    """
    IamInstanceProfile: Optional[EC2IamInstanceProfile] = None
    """
    The IAM instance profile associated with the instance, if applicable.
    """
    InstanceLifecycle: Literal["spot", "scheduled", "capacity-block"] = Field(
        default=None, frozen=True
    )
    """
    Indicates whether this is a Spot Instance or a Scheduled Instance.
    """
    ElasticGpuAssociations: List["ElasticGpuAssociation"] = Field(
        default=None, frozen=True
    )
    """
    Deprecated.
    """
    ElasticInferenceAcceleratorAssociations: List[
        "ElasticInferenceAcceleratorAssociation"
    ] = Field(default=None, frozen=True)
    """
    The elastic inference accelerator associated with the instance.
    """
    NetworkInterfaces: Optional[List["InstanceNetworkInterface"]] = None
    """
    The network interfaces for the instance.
    """
    OutpostArn: str = Field(default=None, frozen=True)
    """
    The Amazon Resource Name (ARN) of the Outpost.
    """
    RootDeviceName: str = Field(default=None, frozen=True)
    """
    The device name of the root device volume (for example, ``/dev/sda1``).
    """
    RootDeviceType: Literal["ebs", "instance-store"] = 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.
    """
    SecurityGroups: Optional[List["GroupIdentifier"]] = None
    """
    The security groups for the instance.
    """
    SourceDestCheck: bool = Field(default=None, frozen=True)
    """
    Indicates whether source/destination checking is enabled.
    """
    SpotInstanceRequestId: str = Field(default=None, frozen=True)
    """
    If the request is a Spot Instance request, the ID of the request.
    """
    SriovNetSupport: str = Field(default=None, frozen=True)
    """
    Specifies whether enhanced networking with the Intel 82599 Virtual Function
    interface is enabled.
    """
    StateReason: EC2StateReason = Field(default=None, frozen=True)
    """
    The reason for the most recent state transition.
    """
    VirtualizationType: Literal["hvm", "paravirtual"] = Field(default=None, frozen=True)
    """
    The virtualization type of the instance.
    """
    CpuOptions: Optional[EC2CpuOptions] = None
    """
    The CPU options for the instance.
    """
    CapacityReservationId: str = Field(default=None, frozen=True)
    """
    The ID of the Capacity Reservation.
    """
    CapacityReservationSpecification: Optional[
        CapacityReservationSpecificationResponse
    ] = None
    """
    Information about the Capacity Reservation targeting option.
    """
    HibernationOptions: Optional[EC2HibernationOptions] = None
    """
    Indicates whether the instance is enabled for hibernation.
    """
    Licenses: List["LicenseConfiguration"] = Field(default=None, frozen=True)
    """
    The license configurations for the instance.
    """
    MetadataOptions: Optional[InstanceMetadataOptionsResponse] = None
    """
    The metadata options for the instance.
    """
    EnclaveOptions: Optional[EC2EnclaveOptions] = None
    """
    Indicates whether the instance is enabled for Amazon Web Services Nitro
    Enclaves.
    """
    BootMode: Literal["legacy-bios", "uefi", "uefi-preferred"] = Field(
        default=None, frozen=True
    )
    """
    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.
    """
    PlatformDetails: str = 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*.
    """
    UsageOperation: 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*.
    """
    UsageOperationUpdateTime: datetime = Field(default=None, frozen=True)
    """
    The time that the usage operation was last updated.
    """
    PrivateDnsNameOptions: Optional[PrivateDnsNameOptionsResponse] = None
    """
    The options for the instance hostname.
    """
    Ipv6Address: str = Field(default=None, frozen=True)
    """
    The IPv6 address assigned to the instance.
    """
    TpmSupport: 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*.
    """
    MaintenanceOptions: Optional[InstanceMaintenanceOptions] = None
    """
    Provides information on the recovery and maintenance options of your
    instance.
    """
    CurrentInstanceBootMode: Literal["legacy-bios", "uefi"] = Field(
        default=None, frozen=True
    )
    """
    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*.
    """

    @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

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

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "VpcId": self.VpcId,
                }
            )
        except AttributeError:
            return None
        return Vpc.objects.using(self.session).get(**pk)  # type: ignore[arg-type]

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

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "SubnetId": self.SubnetId,
                }
            )
        except AttributeError:
            return None
        return Subnet.objects.using(self.session).get(**pk)  # type: ignore[arg-type]

    @cached_property
    def security_groups(self) -> Optional[List["SecurityGroup"]]:
        """
        Return the :py:class:`SecurityGroup` objects that this instance belongs
        to, if any.

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "GroupIds": [
                        identifier.GroupId
                        for identifier in cast(
                            List["GroupIdentifier"], self.SecurityGroups
                        )
                    ],
                }
            )
        except AttributeError:
            return []
        return SecurityGroup.objects.using(self.session).list(**pk)  # type: ignore[arg-type]

    def start(self, DryRun: bool = False) -> Optional[List["InstanceStateChange"]]:
        """
        Start 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``.
        """

        return (
            cast(InstanceManager, self.objects)
            .using(self.session)
            .start([self.InstanceId], DryRun=DryRun)
        )

    def stop(
        self,
        DryRun: bool = False,
        Hibernate: Optional[bool] = None,
        Force: Optional[bool] = None,
    ) -> Optional[List["InstanceStateChange"]]:
        """
        Stop 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``.
            Hibernate: Hibernates the instance if the instance was enabled for
                hibernation at launch. If the instance cannot hibernate successfully, a
                normal shutdown occurs. For more information, see `Hibernate your instance
                <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_ in
                the *Amazon EC2 User Guide*.
            Force: Forces the instances to stop. The instances do not have an
                opportunity to flush file system caches or file system metadata. If you use
                this option, you must perform file system check and repair procedures. This
                option is not recommended for Windows instances.
        """

        return (
            cast(InstanceManager, self.objects)
            .using(self.session)
            .stop([self.InstanceId], DryRun=DryRun, Hibernate=Hibernate, Force=Force)
        )

    def reboot(self, DryRun: bool = False) -> "None":
        """
        Reboot 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``.
        """

        return (
            cast(InstanceManager, self.objects)
            .using(self.session)
            .reboot([self.InstanceId], DryRun=DryRun)
        )

    def terminate(self, DryRun: bool = False) -> Optional[List["InstanceStateChange"]]:
        """
        Terminate 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``.
        """

        return (
            cast(InstanceManager, self.objects)
            .using(self.session)
            .terminate([self.InstanceId], DryRun=DryRun)
        )


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

    tag_class: ClassVar[Type] = Tag
    manager_class: ClassVar[Type[Boto3ModelManager]] = LaunchTemplateManager

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

    @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.

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                }
            )
        except AttributeError:
            return []
        return LaunchTemplateVersion.objects.using(self.session).list(**pk)  # type: ignore[arg-type]

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

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                    "Version": self.DefaultVersionNumber,
                }
            )
        except AttributeError:
            return None
        return LaunchTemplateVersion.objects.using(self.session).get(**pk)  # type: ignore[arg-type]

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

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                    "Version": self.LatestVersionNumber,
                }
            )
        except AttributeError:
            return None
        return LaunchTemplateVersion.objects.using(self.session).get(**pk)  # type: ignore[arg-type]


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

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


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

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


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

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


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

    Primary: Optional[bool] = None
    """
    Indicates whether the private IPv4 address is the primary private IPv4
    address.

    Only one IPv4 address can be designated as primary.
    """
    PrivateIpAddress: Optional[str] = None
    """
    The private IPv4 address.
    """


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

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


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

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


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

    EnaSrdUdpEnabled: Optional[bool] = None
    """
    Indicates whether UDP traffic to and from the instance uses ENA Express.

    To specify this setting, you must first enable ENA Express.
    """


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

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


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 `Idle connection tracking
    timeout <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon EC2 User
    Guide*.
    """

    TcpEstablishedTimeout: Optional[int] = None
    """
    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.
    """
    UdpTimeout: 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.
    """
    UdpStreamTimeout: 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.
    """


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

    AssociateCarrierIpAddress: Optional[bool] = None
    """
    Indicates whether to associate a Carrier IP address with eth0 for a new
    network interface.
    """
    AssociatePublicIpAddress: Optional[bool] = None
    """
    Indicates whether to associate a public IPv4 address with eth0 for a new
    network interface.
    """
    DeleteOnTermination: Optional[bool] = None
    """
    Indicates whether the network interface is deleted when the instance is
    terminated.
    """
    Description: Optional[str] = None
    """
    A description for the network interface.
    """
    DeviceIndex: Optional[int] = None
    """
    The device index for the network interface attachment.
    """
    Groups: Optional[List[str]] = None
    """
    The IDs of one or more security groups.
    """
    InterfaceType: Optional[str] = None
    """
    The type of network interface.
    """
    Ipv6AddressCount: Optional[int] = None
    """
    The number of IPv6 addresses for the network interface.
    """
    Ipv6Addresses: Optional[List["InstanceIpv6Address"]] = None
    """
    The IPv6 addresses for the network interface.
    """
    NetworkInterfaceId: Optional[str] = None
    """
    The ID of the network interface.
    """
    PrivateIpAddress: Optional[str] = None
    """
    The primary private IPv4 address of the network interface.
    """
    PrivateIpAddresses: Optional[List["PrivateIpAddressSpecification"]] = None
    """
    One or more private IPv4 addresses.
    """
    SecondaryPrivateIpAddressCount: Optional[int] = None
    """
    The number of secondary private IPv4 addresses for the network interface.
    """
    SubnetId: Optional[str] = None
    """
    The ID of the subnet for the network interface.
    """
    NetworkCardIndex: Optional[int] = None
    """
    The index of the network card.
    """
    Ipv4Prefixes: Optional[List["Ipv4PrefixSpecificationResponse"]] = None
    """
    One or more IPv4 prefixes assigned to the network interface.
    """
    Ipv4PrefixCount: Optional[int] = None
    """
    The number of IPv4 prefixes that Amazon Web Services automatically assigned
    to the network interface.
    """
    Ipv6Prefixes: Optional[List["Ipv6PrefixSpecificationResponse"]] = None
    """
    One or more IPv6 prefixes assigned to the network interface.
    """
    Ipv6PrefixCount: Optional[int] = None
    """
    The number of IPv6 prefixes that Amazon Web Services automatically assigned
    to the network interface.
    """
    PrimaryIpv6: Optional[bool] = 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>`_.
    """
    EnaSrdSpecification: Optional[LaunchTemplateEnaSrdSpecification] = None
    """
    Contains the ENA Express settings for instances launched from your launch
    template.
    """
    ConnectionTrackingSpecification: Optional[EC2ConnectionTrackingSpecification] = 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 `Idle connection tracking
    timeout <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon EC2 User
    Guide*.
    """


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

    Enabled: Optional[bool] = None
    """
    Indicates whether detailed monitoring is enabled.

    Otherwise, basic monitoring is enabled.
    """


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

    AvailabilityZone: Optional[str] = None
    """
    The Availability Zone of the instance.
    """
    Affinity: Optional[str] = None
    """
    The affinity setting for the instance on the Dedicated Host.
    """
    GroupName: Optional[str] = None
    """
    The name of the placement group for the instance.
    """
    HostId: Optional[str] = None
    """
    The ID of the Dedicated Host for the instance.
    """
    Tenancy: Optional[Literal["default", "dedicated", "host"]] = None
    """
    The tenancy of the instance.

    An instance with a tenancy of ``dedicated`` runs
    on single-tenant hardware.
    """
    SpreadDomain: Optional[str] = None
    """
    Reserved for future use.
    """
    HostResourceGroupArn: Optional[str] = None
    """
    The ARN of the host resource group in which to launch the instances.
    """
    PartitionNumber: Optional[int] = None
    """
    The number of the partition the instance should launch in.

    Valid only if the
    placement group strategy is set to ``partition``.
    """
    GroupId: Optional[str] = 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.
    """


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

    tag_class: ClassVar[Type] = 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",
            "ipam-external-resource-verification-token",
        ]
    ] = None
    """
    The type of resource to tag.
    """
    Tags: Optional[List[Tag]] = None
    """
    The tags for the resource.
    """


class ElasticGpuSpecificationResponse(Boto3Model):
    """
    Deprecated.

    Amazon Elastic Graphics reached end of life on January 8, 2024. For
    workloads that require graphics acceleration, we recommend that you use
    Amazon EC2 G4ad, G4dn, or G5 instances.
    """

    Type: Optional[str] = None
    """
    Deprecated.
    """


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

    Type: Optional[str] = None
    """
    The type of elastic inference accelerator.

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


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

    MaxPrice: Optional[str] = None
    """
    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.
    """
    SpotInstanceType: Optional[Literal["one-time", "persistent"]] = None
    """
    The Spot Instance request type.
    """
    BlockDurationMinutes: Optional[int] = 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).
    """
    ValidUntil: Optional[datetime] = 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.
    """
    InstanceInterruptionBehavior: Optional[
        Literal["hibernate", "stop", "terminate"]
    ] = None
    """
    The behavior when a Spot Instance is interrupted.
    """


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

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


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

    CpuCredits: Optional[str] = None
    """
    The credit option for CPU usage of a T instance.
    """


class LaunchTemplateCpuOptions(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*.
    """

    CoreCount: Optional[int] = None
    """
    The number of CPU cores for the instance.
    """
    ThreadsPerCore: Optional[int] = None
    """
    The number of threads per CPU core.
    """
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = 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>`_.
    """


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

    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    """
    Indicates the instance's Capacity Reservation preferences.

    Possible preferences
    include:
    """
    CapacityReservationTarget: Optional[CapacityReservationTargetResponse] = None
    """
    Information about the target Capacity Reservation or Capacity Reservation
    group.
    """


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

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


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

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

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


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 EC2 User Guide*.
    """

    State: Optional[Literal["pending", "applied"]] = None
    """
    The state of the metadata option changes.
    """
    HttpTokens: Optional[Literal["optional", "required"]] = None
    """
    Indicates whether IMDSv2 is required.
    """
    HttpPutResponseHopLimit: Optional[int] = None
    """
    The desired HTTP PUT response hop limit for instance metadata requests.

    The larger the number, the further instance metadata requests can travel.
    """
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    """
    Enables or disables the HTTP metadata endpoint on your instances.

    If the
    parameter is not specified, the default state is ``enabled``.
    """
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    """
    Enables or disables the IPv6 endpoint for the instance metadata service.
    """
    InstanceMetadataTags: 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>`_.
    """


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

    Enabled: Optional[bool] = None
    """
    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.
    """


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

    Min: Optional[int] = None
    """
    The minimum number of vCPUs.

    If the value is ``0``, there is no minimum limit.
    """
    Max: Optional[int] = None
    """
    The maximum number of vCPUs.

    If this parameter is not specified, there is no maximum limit.
    """


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

    Min: Optional[int] = None
    """
    The minimum amount of memory, in MiB.

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

    If this parameter is not specified, there is no maximum limit.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[float] = None
    """
    The minimum amount of memory per vCPU, in GiB.

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

    If this parameter is not specified, there is no maximum limit.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[int] = None
    """
    The minimum number of network interfaces.

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

    If this parameter is not specified, there is no maximum limit.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[float] = None
    """
    The minimum amount of total local storage, in GB.

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

    If this parameter is not specified, there is no maximum limit.
    """


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

    """

    Min: Optional[int] = None
    """
    The minimum baseline bandwidth, in Mbps.

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

    If this parameter is not specified, there is no maximum limit.
    """


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
    """

    Min: Optional[int] = None
    """
    The minimum number of accelerators.

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

    If this parameter is not specified, there is no maximum limit.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[int] = None
    """
    The minimum amount of accelerator memory, in MiB.

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

    If this parameter is not specified, there is no maximum limit.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[float] = None
    """
    The minimum amount of network bandwidth, in Gbps.

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

    If this parameter is not specified, there is no maximum limit.
    """


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``.
    """

    VCpuCount: Optional[VCpuCountRange] = None
    """
    The minimum and maximum number of vCPUs.
    """
    MemoryMiB: Optional[InstanceMemoryMiB] = None
    """
    The minimum and maximum amount of memory, in MiB.
    """
    CpuManufacturers: Optional[List[Literal["intel", "amd", "amazon-web-services"]]] = (
        None
    )
    """
    The CPU manufacturers to include.
    """
    MemoryGiBPerVCpu: Optional[InstanceMemoryGiBPerVCpu] = None
    """
    The minimum and maximum amount of memory per vCPU, in GiB.
    """
    ExcludedInstanceTypes: Optional[List[str]] = None
    """
    The instance types to exclude.
    """
    InstanceGenerations: Optional[List[Literal["current", "previous"]]] = 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*.
    """
    SpotMaxPricePercentageOverLowestPrice: Optional[int] = None
    """
    [Price protection] The price protection threshold for Spot Instances, as a
    percentage higher than an identified Spot price.

    The identified Spot price is the Spot price of the lowest priced current
    generation C, M, or R instance type with your specified attributes. If no
    current generation C, M, or R instance type matches your attributes, then
    the identified Spot price is from the lowest priced current generation
    instance types, and failing that, from the lowest priced previous
    generation instance types that match your attributes. When Amazon EC2
    selects instance types with your attributes, it will exclude instance types
    whose Spot price exceeds your specified threshold.
    """
    OnDemandMaxPricePercentageOverLowestPrice: Optional[int] = None
    """
    [Price protection] The price protection threshold for On-Demand Instances,
    as a percentage higher than an identified On-Demand price.

    The identified On-Demand price is the price of the lowest priced current
    generation C, M, or R instance type with your specified attributes. When
    Amazon EC2 selects instance types with your attributes, it will exclude
    instance types whose price exceeds your specified threshold.
    """
    BareMetal: Optional[Literal["included", "required", "excluded"]] = None
    """
    Indicates whether bare metal instance types must be included, excluded, or
    required.
    """
    BurstablePerformance: 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>`_.
    """
    RequireHibernateSupport: Optional[bool] = None
    """
    Indicates whether instance types must support hibernation for On-Demand
    Instances.
    """
    NetworkInterfaceCount: Optional[InstanceNetworkInterfaceCount] = None
    """
    The minimum and maximum number of network interfaces.
    """
    LocalStorage: Optional[Literal["included", "required", "excluded"]] = 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*.
    """
    LocalStorageTypes: Optional[List[Literal["hdd", "ssd"]]] = None
    """
    The type of local storage that is required.
    """
    TotalLocalStorageGB: Optional[InstanceTotalLocalStorageGB] = None
    """
    The minimum and maximum amount of total local storage, in GB.
    """
    BaselineEbsBandwidthMbps: Optional[InstanceBaselineEbsBandwidthMbps] = 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*.
    """
    AcceleratorTypes: Optional[List[Literal["gpu", "fpga", "inference"]]] = None
    """
    The accelerator types that must be on the instance type.
    """
    AcceleratorCount: Optional[InstanceAcceleratorCount] = None
    """
    The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web
    Services Inferentia chips) on an instance.
    """
    AcceleratorManufacturers: Optional[
        List[Literal["amazon-web-services", "amd", "nvidia", "xilinx", "habana"]]
    ] = None
    """
    Indicates whether instance types must have accelerators by specific
    manufacturers.
    """
    AcceleratorNames: Optional[
        List[
            Literal[
                "a100",
                "inferentia",
                "k520",
                "k80",
                "m60",
                "radeon-pro-v520",
                "t4",
                "vu9p",
                "v100",
                "a10g",
                "h100",
                "t4g",
            ]
        ]
    ] = None
    """
    The accelerators that must be on the instance type.
    """
    AcceleratorTotalMemoryMiB: Optional[InstanceAcceleratorTotalMemoryMiB] = None
    """
    The minimum and maximum amount of total accelerator memory, in MiB.
    """
    NetworkBandwidthGbps: Optional[InstanceNetworkBandwidthGbps] = None
    """
    The minimum and maximum amount of network bandwidth, in gigabits per second
    (Gbps).
    """
    AllowedInstanceTypes: Optional[List[str]] = None
    """
    The instance types to apply your specified attributes against.

    All other instance types are ignored, even if they match your specified
    attributes.
    """
    MaxSpotPriceAsPercentageOfOptimalOnDemandPrice: Optional[int] = None
    """
    [Price protection] The price protection threshold for Spot Instances, as a
    percentage of an identified On-Demand price.

    The identified On-Demand price is the price of the lowest priced current
    generation C, M, or R instance type with your specified attributes. If no
    current generation C, M, or R instance type matches your attributes, then
    the identified price is from the lowest priced current generation instance
    types, and failing that, from the lowest priced previous generation
    instance types that match your attributes. When Amazon EC2 selects instance
    types with your attributes, it will exclude instance types whose price
    exceeds your specified threshold.
    """


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

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


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

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


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

    KernelId: Optional[str] = None
    """
    The ID of the kernel, if applicable.
    """
    EbsOptimized: Optional[bool] = None
    """
    Indicates whether the instance is optimized for Amazon EBS I/O.
    """
    IamInstanceProfile: Optional[LaunchTemplateIamInstanceProfileSpecification] = None
    """
    The IAM instance profile.
    """
    BlockDeviceMappings: Optional[List["LaunchTemplateBlockDeviceMapping"]] = None
    """
    The block device mappings.
    """
    NetworkInterfaces: Optional[
        List["LaunchTemplateInstanceNetworkInterfaceSpecification"]
    ] = None
    """
    The network interfaces.
    """
    ImageId: Optional[str] = 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.
    """
    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",
            "r7iz.metal-16xl",
            "r7iz.metal-32xl",
            "c7gd.metal",
            "m7gd.metal",
            "r7gd.metal",
            "g6.xlarge",
            "g6.2xlarge",
            "g6.4xlarge",
            "g6.8xlarge",
            "g6.12xlarge",
            "g6.16xlarge",
            "g6.24xlarge",
            "g6.48xlarge",
            "gr6.4xlarge",
            "gr6.8xlarge",
            "c7i-flex.large",
            "c7i-flex.xlarge",
            "c7i-flex.2xlarge",
            "c7i-flex.4xlarge",
            "c7i-flex.8xlarge",
            "u7i-12tb.224xlarge",
            "u7in-16tb.224xlarge",
            "u7in-24tb.224xlarge",
            "u7in-32tb.224xlarge",
            "u7ib-12tb.224xlarge",
            "c7gn.metal",
            "r8g.medium",
            "r8g.large",
            "r8g.xlarge",
            "r8g.2xlarge",
            "r8g.4xlarge",
            "r8g.8xlarge",
            "r8g.12xlarge",
            "r8g.16xlarge",
            "r8g.24xlarge",
            "r8g.48xlarge",
            "r8g.metal-24xl",
            "r8g.metal-48xl",
            "mac2-m1ultra.metal",
            "g6e.xlarge",
            "g6e.2xlarge",
            "g6e.4xlarge",
            "g6e.8xlarge",
            "g6e.12xlarge",
            "g6e.16xlarge",
            "g6e.24xlarge",
            "g6e.48xlarge",
        ]
    ] = None
    """
    The instance type.
    """
    KeyName: Optional[str] = None
    """
    The name of the key pair.
    """
    Monitoring: Optional[LaunchTemplatesMonitoring] = None
    """
    The monitoring for the instance.
    """
    Placement: Optional[LaunchTemplatePlacement] = None
    """
    The placement of the instance.
    """
    RamDiskId: Optional[str] = None
    """
    The ID of the RAM disk, if applicable.
    """
    DisableApiTermination: Optional[bool] = None
    """
    If set to ``true``, indicates that the instance cannot be terminated using
    the Amazon EC2 console, command line tool, or API.
    """
    InstanceInitiatedShutdownBehavior: Optional[Literal["stop", "terminate"]] = None
    """
    Indicates whether an instance stops or terminates when you initiate
    shutdown from the instance (using the operating system command for system
    shutdown).
    """
    UserData: Optional[str] = None
    """
    The user data for the instance.
    """
    TagSpecifications: Optional[List["LaunchTemplateTagSpecification"]] = None
    """
    The tags that are applied to the resources that are created during instance
    launch.
    """
    ElasticGpuSpecifications: Optional[List["ElasticGpuSpecificationResponse"]] = None
    """
    Deprecated.
    """
    ElasticInferenceAccelerators: Optional[
        List["LaunchTemplateElasticInferenceAcceleratorResponse"]
    ] = 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.
    """
    SecurityGroupIds: Optional[List[str]] = None
    """
    The security group IDs.
    """
    SecurityGroups: Optional[List[str]] = None
    """
    The security group names.
    """
    InstanceMarketOptions: Optional[LaunchTemplateInstanceMarketOptions] = None
    """
    The market (purchasing) option for the instances.
    """
    CreditSpecification: Optional[InstanceCreditSpecification] = None
    """
    The credit option for CPU usage of the instance.
    """
    CpuOptions: Optional[LaunchTemplateCpuOptions] = None
    """
    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*.
    """
    CapacityReservationSpecification: Optional[
        LaunchTemplateCapacityReservationSpecificationResponse
    ] = None
    """
    Information about the Capacity Reservation targeting option.
    """
    LicenseSpecifications: Optional[List["LaunchTemplateLicenseConfiguration"]] = None
    """
    The license configurations.
    """
    HibernationOptions: Optional[LaunchTemplateHibernationOptions] = None
    """
    Indicates whether an instance is configured for hibernation.

    For more information, see
    `Hibernate your Amazon EC2 instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_
    in the *Amazon EC2 User Guide*.
    """
    MetadataOptions: Optional[LaunchTemplateInstanceMetadataOptions] = 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 EC2 User Guide*.
    """
    EnclaveOptions: Optional[LaunchTemplateEnclaveOptions] = None
    """
    Indicates whether the instance is enabled for Amazon Web Services Nitro
    Enclaves.
    """
    InstanceRequirements: Optional[LaunchTemplateInstanceRequirements] = None
    """
    The attributes for the instance types.

    When you specify instance attributes, Amazon EC2 will identify instance
    types with these attributes.
    """
    PrivateDnsNameOptions: Optional[LaunchTemplatePrivateDnsNameOptions] = None
    """
    The options for the instance hostname.
    """
    MaintenanceOptions: Optional[LaunchTemplateInstanceMaintenanceOptions] = None
    """
    The maintenance options for your instance.
    """
    DisableApiStop: Optional[bool] = None
    """
    Indicates whether the instance is enabled for stop protection.

    For more information, see
    `Enable stop protection for your instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-
    protection.html>`_ in the *Amazon EC2 User Guide*.
    """


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

    manager_class: ClassVar[Type[Boto3ModelManager]] = LaunchTemplateVersionManager

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

    @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.

        .. note::

            The output of this property is cached on the model instance, so
            calling this multiple times will not result in multiple calls to the
            AWS API.   If you need a fresh copy of the data, you can re-get the
            model instance from the manager.
        """

        try:
            pk = OrderedDict(
                {
                    "LaunchTemplateId": self.LaunchTemplateId,
                }
            )
        except AttributeError:
            return None
        return LaunchTemplate.objects.using(self.session).get(**pk)  # type: ignore[arg-type]


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


class DescribeVpcsResult(Boto3Model):
    Vpcs: Optional[List["Vpc"]] = None
    """
    Information about the VPCs.
    """
    NextToken: Optional[str] = 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.
    """


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.
    """

    Value: Optional[bool] = None
    """
    The attribute value.

    The valid values are ``true`` or ``false``.
    """


class DescribeVpcAttributeResult(Boto3Model):
    VpcId: Optional[str] = None
    """
    The ID of the VPC.
    """
    EnableDnsHostnames: Optional[AttributeBooleanValue] = 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.
    """
    EnableDnsSupport: 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.
    """
    EnableNetworkAddressUsageMetrics: Optional[AttributeBooleanValue] = None
    """
    Indicates whether Network Address Usage metrics are enabled for your VPC.
    """


class DescribeSubnetsResult(Boto3Model):
    Subnets: Optional[List["Subnet"]] = None
    """
    Information about the subnets.
    """
    NextToken: Optional[str] = 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.
    """


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
    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",
            "ipam-external-resource-verification-token",
        ]
    ] = None
    """
    The type of resource to tag on creation.
    """
    Tags: Optional[List[Tag]] = None
    """
    The tags to apply to the resource.
    """


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


class DescribeSecurityGroupsResult(Boto3Model):
    SecurityGroups: Optional[List["SecurityGroup"]] = None
    """
    Information about the security groups.
    """
    NextToken: Optional[str] = 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.
    """


class RevokeSecurityGroupIngressResult(Boto3Model):
    Return: Optional[bool] = None
    """
    Returns ``true`` if the request succeeds; otherwise, returns an error.
    """
    UnknownIpPermissions: Optional[List["IpPermission"]] = None
    """
    The inbound rules that were unknown to the service.

    In some cases,
    ``unknownIpPermissionSet`` might be in a different format from the request
    parameter.
    """


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

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


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

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


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


class CreateNetworkAclResult(Boto3Model):
    NetworkAclInstance: NetworkAcl = Field(
        default=None, serialization_alias="NetworkAcl"
    )
    """
    Information about the network ACL.
    """
    ClientToken: Optional[str] = None
    """
    Unique, case-sensitive identifier to ensure the idempotency of the request.

    Only returned if a client token was provided in the request.
    """


class DescribeNetworkAclsResult(Boto3Model):
    NetworkAcls: Optional[List["NetworkAcl"]] = None
    """
    Information about the network ACLs.
    """
    NextToken: Optional[str] = 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.
    """


class CreateImageResult(Boto3Model):
    ImageId: Optional[str] = None
    """
    The ID of the new AMI.
    """


class DescribeImagesResult(Boto3Model):
    Images: Optional[List["AMI"]] = None
    """
    Information about the images.
    """
    NextToken: Optional[str] = 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.
    """


class CopyImageResult(Boto3Model):
    """
    Contains the output of CopyImage.
    """

    ImageId: Optional[str] = None
    """
    The ID of the new AMI.
    """


class ElasticGpuSpecification(Boto3Model):
    """
    Amazon Elastic Graphics reached end of life on January 8, 2024. For
    workloads that require graphics acceleration, we recommend that you use
    Amazon EC2 G4, G5, or G6 instances.

    A specification for an Elastic Graphics accelerator.
    """

    Type: str
    """
    The type of Elastic Graphics accelerator.
    """


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

    Type: str
    """
    The type of elastic inference accelerator.

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


class EC2LaunchTemplateSpecification(Boto3Model):
    """
    The launch template.

    Any additional parameters that you specify for the new instance overwrite
    the corresponding parameters included in the launch template.
    """

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


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

    MaxPrice: Optional[str] = None
    """
    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.
    """
    SpotInstanceType: Optional[Literal["one-time", "persistent"]] = 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``.
    """
    BlockDurationMinutes: Optional[int] = None
    """
    Deprecated.
    """
    ValidUntil: Optional[datetime] = None
    """
    The end date of the request, in UTC format
    (*YYYY*-*MM*-*DD*T*HH*:*MM*:*SS*Z).

    Supported only for persistent requests.
    """
    InstanceInterruptionBehavior: Optional[
        Literal["hibernate", "stop", "terminate"]
    ] = None
    """
    The behavior when a Spot Instance is interrupted.
    """


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``.
    """

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


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.

    """

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


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

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


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

    Enabled: bool
    """
    Indicates whether detailed monitoring is enabled.

    Otherwise, basic monitoring is enabled.
    """


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

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


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

    Ipv4Prefix: Optional[str] = None
    """
    The IPv4 prefix.

    For information, see
    `Assigning prefixes to network interfaces <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-
    eni.html>`_ in the *Amazon EC2 User Guide*.
    """


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

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


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

    EnaSrdUdpEnabled: Optional[bool] = None
    """
    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.
    """


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

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


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 EC2 User
    Guide*.
    """

    TcpEstablishedTimeout: Optional[int] = None
    """
    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.
    """
    UdpStreamTimeout: 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.
    """
    UdpTimeout: 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.
    """


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

    AssociatePublicIpAddress: Optional[bool] = None
    """
    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``.
    """
    DeleteOnTermination: 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.
    """
    Description: Optional[str] = None
    """
    The description of the network interface.

    Applies only if creating a network interface when launching an instance.
    """
    DeviceIndex: Optional[int] = None
    """
    The position of the network interface in the attachment order.

    A primary network interface has a device index of 0.
    """
    Groups: Optional[List[str]] = None
    """
    The IDs of the security groups for the network interface.

    Applies only if creating a network interface when launching an instance.
    """
    Ipv6AddressCount: Optional[int] = 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.
    """
    Ipv6Addresses: Optional[List["InstanceIpv6Address"]] = 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.
    """
    NetworkInterfaceId: Optional[str] = None
    """
    The ID of the network interface.
    """
    PrivateIpAddress: 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.
    """
    PrivateIpAddresses: Optional[List["PrivateIpAddressSpecification"]] = 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.
    """
    SecondaryPrivateIpAddressCount: Optional[int] = 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.
    """
    SubnetId: Optional[str] = None
    """
    The ID of the subnet associated with the network interface.

    Applies only if creating a network interface when launching an instance.
    """
    AssociateCarrierIpAddress: Optional[bool] = None
    """
    Indicates whether to assign a carrier IP address to the network interface.
    """
    InterfaceType: Optional[str] = None
    """
    The type of network interface.
    """
    NetworkCardIndex: Optional[int] = 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.
    """
    Ipv4Prefixes: Optional[List["Ipv4PrefixSpecificationRequest"]] = None
    """
    The IPv4 delegated prefixes to be assigned to the network interface.

    You cannot
    use this option if you use the ``Ipv4PrefixCount`` option.
    """
    Ipv4PrefixCount: Optional[int] = 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.
    """
    Ipv6Prefixes: Optional[List["Ipv6PrefixSpecificationRequest"]] = None
    """
    The IPv6 delegated prefixes to be assigned to the network interface.

    You cannot
    use this option if you use the ``Ipv6PrefixCount`` option.
    """
    Ipv6PrefixCount: Optional[int] = 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.
    """
    PrimaryIpv6: Optional[bool] = 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>`_.
    """
    EnaSrdSpecification: Optional[EnaSrdSpecificationRequest] = None
    """
    Specifies the ENA Express settings for the network interface that's
    attached to the instance.
    """
    ConnectionTrackingSpecification: Optional[
        ConnectionTrackingSpecificationRequest
    ] = 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 EC2 User
    Guide*.
    """


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*.
    """

    CoreCount: Optional[int] = None
    """
    The number of CPU cores for the instance.
    """
    ThreadsPerCore: 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``.
    """
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = 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>`_.
    """


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

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


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).
    """

    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    """
    Indicates the instance's Capacity Reservation preferences.

    Possible preferences
    include:
    """
    CapacityReservationTarget: Optional[EC2CapacityReservationTarget] = None
    """
    Information about the target Capacity Reservation or Capacity Reservation
    group.
    """


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 Amazon EC2
    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.

    """

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


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>`_.
    """

    HttpTokens: Optional[Literal["optional", "required"]] = None
    """
    Indicates whether IMDSv2 is required.
    """
    HttpPutResponseHopLimit: Optional[int] = None
    """
    The maximum number of hops that the metadata token can travel.
    """
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    """
    Enables or disables the HTTP metadata endpoint on your instances.
    """
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    """
    Enables or disables the IPv6 endpoint for the instance metadata service.
    """
    InstanceMetadataTags: 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>`_.
    """


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.

    """

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


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.
    """

    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    """
    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.
    """
    EnableResourceNameDnsARecord: Optional[bool] = None
    """
    Indicates whether to respond to DNS queries for instance hostnames with DNS
    A records.
    """
    EnableResourceNameDnsAAAARecord: Optional[bool] = None
    """
    Indicates whether to respond to DNS queries for instance hostnames with DNS
    AAAA records.
    """


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

    AutoRecovery: Optional[Literal["disabled", "default"]] = None
    """
    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>`_.
    """


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.
    """

    Groups: Optional[List["GroupIdentifier"]] = None
    """
    Not supported.
    """
    Instances: Optional[List["Instance"]] = None
    """
    The instances.
    """
    OwnerId: Optional[str] = None
    """
    The ID of the Amazon Web Services account that owns the reservation.
    """
    RequesterId: 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).
    """
    ReservationId: Optional[str] = None
    """
    The ID of the reservation.
    """


class DescribeInstancesResult(Boto3Model):
    Reservations: Optional[List["Reservation"]] = None
    """
    Information about the reservations.
    """
    NextToken: Optional[str] = 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.
    """


class InstanceStateChange(Boto3Model):
    """
    Describes an instance state change.
    """

    CurrentState: Optional[InstanceState] = None
    """
    The current state of the instance.
    """
    InstanceId: Optional[str] = None
    """
    The ID of the instance.
    """
    PreviousState: Optional[InstanceState] = None
    """
    The previous state of the instance.
    """


class StartInstancesResult(Boto3Model):
    StartingInstances: Optional[List["InstanceStateChange"]] = None
    """
    Information about the started instances.
    """


class StopInstancesResult(Boto3Model):
    StoppingInstances: Optional[List["InstanceStateChange"]] = None
    """
    Information about the stopped instances.
    """


class TerminateInstancesResult(Boto3Model):
    TerminatingInstances: Optional[List["InstanceStateChange"]] = None
    """
    Information about the terminated instances.
    """


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

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


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

    Encrypted: Optional[bool] = None
    """
    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.
    """
    DeleteOnTermination: Optional[bool] = None
    """
    Indicates whether the EBS volume is deleted on instance termination.
    """
    Iops: Optional[int] = 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.
    """
    KmsKeyId: Optional[str] = None
    """
    The ARN of the symmetric Key Management Service (KMS) CMK used for
    encryption.
    """
    SnapshotId: Optional[str] = None
    """
    The ID of the snapshot.
    """
    VolumeSize: Optional[int] = 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:
    """
    VolumeType: Optional[
        Literal["standard", "io1", "io2", "gp2", "sc1", "st1", "gp3"]
    ] = None
    """
    The volume type.

    For more information, see
    `Amazon EBS volume types <https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html>`_
    in the *Amazon EBS User Guide*.
    """
    Throughput: Optional[int] = None
    """
    The throughput to provision for a ``gp3`` volume, with a maximum of 1,000
    MiB/s.
    """


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

    DeviceName: Optional[str] = None
    """
    The device name (for example, /dev/sdh or xvdh).
    """
    VirtualName: 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.
    """
    Ebs: Optional[LaunchTemplateEbsBlockDeviceRequest] = None
    """
    Parameters used to automatically set up EBS volumes when the instance is
    launched.
    """
    NoDevice: Optional[str] = None
    """
    To omit the device from the block device mapping, specify an empty string.
    """


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

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


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

    AssociateCarrierIpAddress: Optional[bool] = None
    """
    Associates a Carrier IP address with eth0 for a new network interface.
    """
    AssociatePublicIpAddress: Optional[bool] = None
    """
    Associates a public IPv4 address with eth0 for a new network interface.
    """
    DeleteOnTermination: Optional[bool] = None
    """
    Indicates whether the network interface is deleted when the instance is
    terminated.
    """
    Description: Optional[str] = None
    """
    A description for the network interface.
    """
    DeviceIndex: Optional[int] = None
    """
    The device index for the network interface attachment.

    Each network interface requires a device index. If you create a launch
    template that includes secondary network interfaces but not a primary
    network interface, then you must add a primary network interface as a
    launch parameter when you launch an instance from the template.
    """
    Groups: Optional[List[str]] = None
    """
    The IDs of one or more security groups.
    """
    InterfaceType: Optional[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 EC2 User Guide*.
    """
    Ipv6AddressCount: Optional[int] = 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.
    """
    Ipv6Addresses: Optional[List["InstanceIpv6AddressRequest"]] = 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.
    """
    NetworkInterfaceId: Optional[str] = None
    """
    The ID of the network interface.
    """
    PrivateIpAddress: Optional[str] = None
    """
    The primary private IPv4 address of the network interface.
    """
    PrivateIpAddresses: Optional[List["PrivateIpAddressSpecification"]] = None
    """
    One or more private IPv4 addresses.
    """
    SecondaryPrivateIpAddressCount: Optional[int] = None
    """
    The number of secondary private IPv4 addresses to assign to a network
    interface.
    """
    SubnetId: Optional[str] = None
    """
    The ID of the subnet for the network interface.
    """
    NetworkCardIndex: Optional[int] = 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.
    """
    Ipv4Prefixes: Optional[List["Ipv4PrefixSpecificationRequest"]] = None
    """
    One or more IPv4 prefixes to be assigned to the network interface.

    You cannot
    use this option if you use the ``Ipv4PrefixCount`` option.
    """
    Ipv4PrefixCount: Optional[int] = 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.
    """
    Ipv6Prefixes: Optional[List["Ipv6PrefixSpecificationRequest"]] = None
    """
    One or more IPv6 prefixes to be assigned to the network interface.

    You cannot
    use this option if you use the ``Ipv6PrefixCount`` option.
    """
    Ipv6PrefixCount: Optional[int] = 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.
    """
    PrimaryIpv6: Optional[bool] = 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>`_.
    """
    EnaSrdSpecification: Optional[EnaSrdSpecificationRequest] = None
    """
    Configure ENA Express settings for your launch template.
    """
    ConnectionTrackingSpecification: Optional[
        ConnectionTrackingSpecificationRequest
    ] = 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 `Idle connection tracking
    timeout <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-
    connection-tracking.html#connection-tracking-timeouts>`_ in the *Amazon EC2 User
    Guide*.
    """


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

    Enabled: Optional[bool] = None
    """
    Specify ``true`` to enable detailed monitoring.

    Otherwise, basic monitoring is enabled.
    """


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

    AvailabilityZone: Optional[str] = None
    """
    The Availability Zone for the instance.
    """
    Affinity: Optional[str] = None
    """
    The affinity setting for an instance on a Dedicated Host.
    """
    GroupName: Optional[str] = None
    """
    The name of the placement group for the instance.
    """
    HostId: Optional[str] = None
    """
    The ID of the Dedicated Host for the instance.
    """
    Tenancy: Optional[Literal["default", "dedicated", "host"]] = None
    """
    The tenancy of the instance.

    An instance with a tenancy of dedicated runs on single-tenant hardware.
    """
    SpreadDomain: Optional[str] = None
    """
    Reserved for future use.
    """
    HostResourceGroupArn: 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``.
    """
    PartitionNumber: Optional[int] = None
    """
    The number of the partition the instance should launch in.

    Valid only if the
    placement group strategy is set to ``partition``.
    """
    GroupId: Optional[str] = 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.
    """


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

    tag_class: ClassVar[Type] = 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",
            "ipam-external-resource-verification-token",
        ]
    ] = None
    """
    The type of resource to tag.
    """
    Tags: Optional[List[Tag]] = None
    """
    The tags to apply to the resource.
    """


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

    Type: str
    """
    The type of elastic inference accelerator.

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


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

    MaxPrice: Optional[str] = None
    """
    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.
    """
    SpotInstanceType: Optional[Literal["one-time", "persistent"]] = None
    """
    The Spot Instance request type.
    """
    BlockDurationMinutes: Optional[int] = None
    """
    Deprecated.
    """
    ValidUntil: Optional[datetime] = None
    """
    The end date of the request, in UTC format (*YYYY-MM-DD*T*HH:MM:SS*Z).

    Supported only for persistent requests.
    """
    InstanceInterruptionBehavior: Optional[
        Literal["hibernate", "stop", "terminate"]
    ] = None
    """
    The behavior when a Spot Instance is interrupted.

    The default is ``terminate``.
    """


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

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


class LaunchTemplateCpuOptionsRequest(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*.
    """

    CoreCount: Optional[int] = None
    """
    The number of CPU cores for the instance.
    """
    ThreadsPerCore: 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``.
    """
    AmdSevSnp: Optional[Literal["enabled", "disabled"]] = 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>`_.
    """


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).
    """

    CapacityReservationPreference: Optional[Literal["open", "none"]] = None
    """
    Indicates the instance's Capacity Reservation preferences.

    Possible preferences
    include:
    """
    CapacityReservationTarget: Optional[EC2CapacityReservationTarget] = None
    """
    Information about the target Capacity Reservation or Capacity Reservation
    group.
    """


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

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


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 Amazon EC2 instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_
    in the *Amazon EC2 User Guide*.
    """

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


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 EC2 User Guide*.
    """

    HttpTokens: Optional[Literal["optional", "required"]] = None
    """
    Indicates whether IMDSv2 is required.
    """
    HttpPutResponseHopLimit: Optional[int] = None
    """
    The desired HTTP PUT response hop limit for instance metadata requests.

    The larger the number, the further instance metadata requests can travel.
    """
    HttpEndpoint: Optional[Literal["disabled", "enabled"]] = None
    """
    Enables or disables the HTTP metadata endpoint on your instances.

    If the
    parameter is not specified, the default state is ``enabled``.
    """
    HttpProtocolIpv6: Optional[Literal["disabled", "enabled"]] = None
    """
    Enables or disables the IPv6 endpoint for the instance metadata service.
    """
    InstanceMetadataTags: 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>`_.
    """


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.

    """

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


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

    Min: int
    """
    The minimum number of vCPUs.

    To specify no minimum limit, specify ``0``.
    """
    Max: Optional[int] = None
    """
    The maximum number of vCPUs.

    To specify no maximum limit, omit this parameter.
    """


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

    Min: int
    """
    The minimum amount of memory, in MiB.

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

    To specify no maximum limit, omit this parameter.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[float] = None
    """
    The minimum amount of memory per vCPU, in GiB.

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

    To specify no maximum limit, omit this parameter.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[int] = None
    """
    The minimum number of network interfaces.

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

    To specify no maximum limit, omit this parameter.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[float] = None
    """
    The minimum amount of total local storage, in GB.

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

    To specify no maximum limit, omit this parameter.
    """


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

    """

    Min: Optional[int] = None
    """
    The minimum baseline bandwidth, in Mbps.

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

    To specify no maximum limit, omit this parameter.
    """


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
    """

    Min: Optional[int] = None
    """
    The minimum number of accelerators.

    To specify no minimum limit, omit this parameter.
    """
    Max: 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``.
    """


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

    Default: No minimum or maximum limits
    """

    Min: Optional[int] = None
    """
    The minimum amount of accelerator memory, in MiB.

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

    To specify no maximum limit, omit this parameter.
    """


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

    """

    Min: Optional[float] = None
    """
    The minimum amount of network bandwidth, in Gbps.

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

    To specify no maximum limit, omit this parameter.
    """


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*.
    """

    VCpuCount: VCpuCountRangeRequest
    """
    The minimum and maximum number of vCPUs.
    """
    MemoryMiB: MemoryMiBRequest
    """
    The minimum and maximum amount of memory, in MiB.
    """
    CpuManufacturers: Optional[List[Literal["intel", "amd", "amazon-web-services"]]] = (
        None
    )
    """
    The CPU manufacturers to include.
    """
    MemoryGiBPerVCpu: Optional[EC2MemoryGiBPerVCpuRequest] = None
    """
    The minimum and maximum amount of memory per vCPU, in GiB.
    """
    ExcludedInstanceTypes: Optional[List[str]] = None
    """
    The instance types to exclude.
    """
    InstanceGenerations: Optional[List[Literal["current", "previous"]]] = 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*.
    """
    SpotMaxPricePercentageOverLowestPrice: Optional[int] = None
    """
    [Price protection] The price protection threshold for Spot Instances, as a
    percentage higher than an identified Spot price.

    The identified Spot price is the Spot price of the lowest priced current
    generation C, M, or R instance type with your specified attributes. If no
    current generation C, M, or R instance type matches your attributes, then
    the identified Spot price is from the lowest priced current generation
    instance types, and failing that, from the lowest priced previous
    generation instance types that match your attributes. When Amazon EC2
    selects instance types with your attributes, it will exclude instance types
    whose Spot price exceeds your specified threshold.
    """
    OnDemandMaxPricePercentageOverLowestPrice: Optional[int] = None
    """
    [Price protection] The price protection threshold for On-Demand Instances,
    as a percentage higher than an identified On-Demand price.

    The identified On-Demand price is the price of the lowest priced current
    generation C, M, or R instance type with your specified attributes. When
    Amazon EC2 selects instance types with your attributes, it will exclude
    instance types whose price exceeds your specified threshold.
    """
    BareMetal: Optional[Literal["included", "required", "excluded"]] = None
    """
    Indicates whether bare metal instance types must be included, excluded, or
    required.
    """
    BurstablePerformance: 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>`_.
    """
    RequireHibernateSupport: Optional[bool] = None
    """
    Indicates whether instance types must support hibernation for On-Demand
    Instances.
    """
    NetworkInterfaceCount: Optional[NetworkInterfaceCountRequest] = None
    """
    The minimum and maximum number of network interfaces.
    """
    LocalStorage: Optional[Literal["included", "required", "excluded"]] = 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*.
    """
    LocalStorageTypes: Optional[List[Literal["hdd", "ssd"]]] = None
    """
    The type of local storage that is required.
    """
    TotalLocalStorageGB: Optional[TotalLocalStorageGBRequest] = None
    """
    The minimum and maximum amount of total local storage, in GB.
    """
    BaselineEbsBandwidthMbps: Optional[BaselineEbsBandwidthMbpsRequest] = 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*.
    """
    AcceleratorTypes: Optional[List[Literal["gpu", "fpga", "inference"]]] = None
    """
    The accelerator types that must be on the instance type.
    """
    AcceleratorCount: Optional[AcceleratorCountRequest] = None
    """
    The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web
    Services Inferentia chips) on an instance.
    """
    AcceleratorManufacturers: Optional[
        List[Literal["amazon-web-services", "amd", "nvidia", "xilinx", "habana"]]
    ] = None
    """
    Indicates whether instance types must have accelerators by specific
    manufacturers.
    """
    AcceleratorNames: Optional[
        List[
            Literal[
                "a100",
                "inferentia",
                "k520",
                "k80",
                "m60",
                "radeon-pro-v520",
                "t4",
                "vu9p",
                "v100",
                "a10g",
                "h100",
                "t4g",
            ]
        ]
    ] = None
    """
    The accelerators that must be on the instance type.
    """
    AcceleratorTotalMemoryMiB: Optional[AcceleratorTotalMemoryMiBRequest] = None
    """
    The minimum and maximum amount of total accelerator memory, in MiB.
    """
    NetworkBandwidthGbps: Optional[EC2NetworkBandwidthGbpsRequest] = 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*.
    """
    AllowedInstanceTypes: Optional[List[str]] = None
    """
    The instance types to apply your specified attributes against.

    All other instance types are ignored, even if they match your specified
    attributes.
    """
    MaxSpotPriceAsPercentageOfOptimalOnDemandPrice: Optional[int] = None
    """
    [Price protection] The price protection threshold for Spot Instances, as a
    percentage of an identified On-Demand price.

    The identified On-Demand price is the price of the lowest priced current
    generation C, M, or R instance type with your specified attributes. If no
    current generation C, M, or R instance type matches your attributes, then
    the identified price is from the lowest priced current generation instance
    types, and failing that, from the lowest priced previous generation
    instance types that match your attributes. When Amazon EC2 selects instance
    types with your attributes, it will exclude instance types whose price
    exceeds your specified threshold.
    """


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

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

    HostnameType: Optional[Literal["ip-name", "resource-name"]] = None
    """
    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.
    """
    EnableResourceNameDnsARecord: Optional[bool] = None
    """
    Indicates whether to respond to DNS queries for instance hostnames with DNS
    A records.
    """
    EnableResourceNameDnsAAAARecord: Optional[bool] = None
    """
    Indicates whether to respond to DNS queries for instance hostnames with DNS
    AAAA records.
    """


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

    AutoRecovery: Optional[Literal["default", "disabled"]] = None
    """
    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>`_.
    """


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

    KernelId: Optional[str] = None
    """
    The ID of the kernel.
    """
    EbsOptimized: Optional[bool] = 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.
    """
    IamInstanceProfile: Optional[
        LaunchTemplateIamInstanceProfileSpecificationRequest
    ] = None
    """
    The name or Amazon Resource Name (ARN) of an IAM instance profile.
    """
    BlockDeviceMappings: Optional[List["LaunchTemplateBlockDeviceMappingRequest"]] = (
        None
    )
    """
    The block device mapping.
    """
    NetworkInterfaces: Optional[
        List["LaunchTemplateInstanceNetworkInterfaceSpecificationRequest"]
    ] = None
    """
    The network interfaces for the instance.
    """
    ImageId: Optional[str] = None
    """
    The ID of the AMI in the format ``ami-0ac394d6a3example``.
    """
    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",
            "r7iz.metal-16xl",
            "r7iz.metal-32xl",
            "c7gd.metal",
            "m7gd.metal",
            "r7gd.metal",
            "g6.xlarge",
            "g6.2xlarge",
            "g6.4xlarge",
            "g6.8xlarge",
            "g6.12xlarge",
            "g6.16xlarge",
            "g6.24xlarge",
            "g6.48xlarge",
            "gr6.4xlarge",
            "gr6.8xlarge",
            "c7i-flex.large",
            "c7i-flex.xlarge",
            "c7i-flex.2xlarge",
            "c7i-flex.4xlarge",
            "c7i-flex.8xlarge",
            "u7i-12tb.224xlarge",
            "u7in-16tb.224xlarge",
            "u7in-24tb.224xlarge",
            "u7in-32tb.224xlarge",
            "u7ib-12tb.224xlarge",
            "c7gn.metal",
            "r8g.medium",
            "r8g.large",
            "r8g.xlarge",
            "r8g.2xlarge",
            "r8g.4xlarge",
            "r8g.8xlarge",
            "r8g.12xlarge",
            "r8g.16xlarge",
            "r8g.24xlarge",
            "r8g.48xlarge",
            "r8g.metal-24xl",
            "r8g.metal-48xl",
            "mac2-m1ultra.metal",
            "g6e.xlarge",
            "g6e.2xlarge",
            "g6e.4xlarge",
            "g6e.8xlarge",
            "g6e.12xlarge",
            "g6e.16xlarge",
            "g6e.24xlarge",
            "g6e.48xlarge",
        ]
    ] = None
    """
    The instance type.

    For more information, see
    `Amazon EC2 instance types <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>`_
    in the *Amazon EC2 User Guide*.
    """
    KeyName: Optional[str] = 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>`_.
    """
    Monitoring: Optional[LaunchTemplatesMonitoringRequest] = None
    """
    The monitoring for the instance.
    """
    Placement: Optional[LaunchTemplatePlacementRequest] = None
    """
    The placement for the instance.
    """
    RamDiskId: Optional[str] = None
    """
    The ID of the RAM disk.
    """
    DisableApiTermination: Optional[bool] = 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.
    """
    InstanceInitiatedShutdownBehavior: Optional[Literal["stop", "terminate"]] = None
    """
    Indicates whether an instance stops or terminates when you initiate
    shutdown from the instance (using the operating system command for system
    shutdown).
    """
    UserData: Optional[str] = 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 Amazon EC2 instance at launch <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html>`_
    in
    the *Amazon EC2 User Guide*.
    """
    TagSpecifications: Optional[List["LaunchTemplateTagSpecificationRequest"]] = None
    """
    The tags to apply to the resources that are created during instance launch.

    These tags are not applied to the launch template.
    """
    ElasticGpuSpecifications: Optional[List["ElasticGpuSpecification"]] = None
    """
    Deprecated.
    """
    ElasticInferenceAccelerators: Optional[
        List["LaunchTemplateElasticInferenceAccelerator"]
    ] = 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.
    """
    SecurityGroupIds: Optional[List[str]] = None
    """
    The IDs of the security groups.
    """
    SecurityGroups: Optional[List[str]] = None
    """
    The names of the security groups.

    For a nondefault VPC, you must use security group IDs instead.
    """
    InstanceMarketOptions: Optional[LaunchTemplateInstanceMarketOptionsRequest] = None
    """
    The market (purchasing) option for the instances.
    """
    CreditSpecification: Optional[CreditSpecificationRequest] = None
    """
    The credit option for CPU usage of the instance.

    Valid only for T instances.
    """
    CpuOptions: Optional[LaunchTemplateCpuOptionsRequest] = None
    """
    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*.
    """
    CapacityReservationSpecification: Optional[
        LaunchTemplateCapacityReservationSpecificationRequest
    ] = 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).
    """
    LicenseSpecifications: Optional[
        List["LaunchTemplateLicenseConfigurationRequest"]
    ] = None
    """
    The license configurations.
    """
    HibernationOptions: Optional[LaunchTemplateHibernationOptionsRequest] = 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 Amazon EC2 instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html>`_
    in the *Amazon EC2 User Guide*.
    """
    MetadataOptions: Optional[LaunchTemplateInstanceMetadataOptionsRequest] = 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 EC2 User Guide*.
    """
    EnclaveOptions: Optional[LaunchTemplateEnclaveOptionsRequest] = 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*.
    """
    InstanceRequirements: Optional[InstanceRequirementsRequest] = None
    """
    The attributes for the instance types.

    When you specify instance attributes, Amazon EC2 will identify instance
    types with these attributes.
    """
    PrivateDnsNameOptions: Optional[LaunchTemplatePrivateDnsNameOptionsRequest] = None
    """
    The options for the instance hostname.

    The default values are inherited from the subnet.
    """
    MaintenanceOptions: Optional[LaunchTemplateInstanceMaintenanceOptionsRequest] = None
    """
    The maintenance options for the instance.
    """
    DisableApiStop: Optional[bool] = None
    """
    Indicates whether to enable the instance for stop protection.

    For more information, see
    `Enable stop protection for your instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-
    protection.html>`_ in the *Amazon EC2 User Guide*.
    """


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.
    """

    Code: Optional[str] = None
    """
    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>`_.
    """
    Message: 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>`_.
    """


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.
    """

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


class CreateLaunchTemplateResult(Boto3Model):
    LaunchTemplateInstance: LaunchTemplate = Field(
        default=None, serialization_alias="LaunchTemplate"
    )
    """
    Information about the launch template.
    """
    Warning: Optional[ValidationWarning] = None
    """
    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.
    """


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


class DescribeLaunchTemplatesResult(Boto3Model):
    LaunchTemplates: Optional[List["LaunchTemplate"]] = None
    """
    Information about the launch templates.
    """
    NextToken: Optional[str] = None
    """
    The token to use to retrieve the next page of results.

    This value is ``null``
    when there are no more results to return.
    """


class CreateLaunchTemplateVersionResult(Boto3Model):
    LaunchTemplateVersionInstance: LaunchTemplateVersion = Field(
        default=None, serialization_alias="LaunchTemplateVersion"
    )
    """
    Information about the launch template version.
    """
    Warning: Optional[ValidationWarning] = None
    """
    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.
    """


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

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


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

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


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

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


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


class DescribeLaunchTemplateVersionsResult(Boto3Model):
    LaunchTemplateVersions: Optional[List["LaunchTemplateVersion"]] = None
    """
    Information about the launch template versions.
    """
    NextToken: Optional[str] = None
    """
    The token to use to retrieve the next page of results.

    This value is ``null``
    when there are no more results to return.
    """
