Skip to content

EC2Client

Index > EC2 > EC2Client

Auto-generated documentation for EC2 type annotations stubs module mypy-boto3-ec2.

EC2Client

Type annotations and code completion for boto3.client("ec2"). boto3 documentation

Usage example
from boto3.session import Session
from mypy_boto3_ec2.client import EC2Client

def get_ec2_client() -> EC2Client:
    return Session().client("ec2")

Exceptions

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("ec2").exceptions structure.

Usage example
client = boto3.client("ec2")

try:
    do_something(client)
except (
    client.ClientError,
) as e:
    print(e)
Type checking example
from mypy_boto3_ec2.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods

accept_reserved_instances_exchange_quote

Accepts the Convertible Reserved Instance exchange quote described in the GetReservedInstancesExchangeQuote call.

Type annotations and code completion for boto3.client("ec2").accept_reserved_instances_exchange_quote method. boto3 documentation

Method definition
def accept_reserved_instances_exchange_quote(
    self,
    *,
    ReservedInstanceIds: Sequence[str],
    DryRun: bool = ...,
    TargetConfigurations: Sequence[TargetConfigurationRequestTypeDef] = ...,  # (1)
) -> AcceptReservedInstancesExchangeQuoteResultTypeDef:  # (2)
    ...
  1. See TargetConfigurationRequestTypeDef
  2. See AcceptReservedInstancesExchangeQuoteResultTypeDef
Usage example with kwargs
kwargs: AcceptReservedInstancesExchangeQuoteRequestRequestTypeDef = {  # (1)
    "ReservedInstanceIds": ...,
}

parent.accept_reserved_instances_exchange_quote(**kwargs)
  1. See AcceptReservedInstancesExchangeQuoteRequestRequestTypeDef

accept_transit_gateway_multicast_domain_associations

Accepts a request to associate subnets with a transit gateway multicast domain.

Type annotations and code completion for boto3.client("ec2").accept_transit_gateway_multicast_domain_associations method. boto3 documentation

Method definition
def accept_transit_gateway_multicast_domain_associations(
    self,
    *,
    TransitGatewayMulticastDomainId: str = ...,
    TransitGatewayAttachmentId: str = ...,
    SubnetIds: Sequence[str] = ...,
    DryRun: bool = ...,
) -> AcceptTransitGatewayMulticastDomainAssociationsResultTypeDef:  # (1)
    ...
  1. See AcceptTransitGatewayMulticastDomainAssociationsResultTypeDef
Usage example with kwargs
kwargs: AcceptTransitGatewayMulticastDomainAssociationsRequestRequestTypeDef = {  # (1)
    "TransitGatewayMulticastDomainId": ...,
}

parent.accept_transit_gateway_multicast_domain_associations(**kwargs)
  1. See AcceptTransitGatewayMulticastDomainAssociationsRequestRequestTypeDef

accept_transit_gateway_peering_attachment

Accepts a transit gateway peering attachment request.

Type annotations and code completion for boto3.client("ec2").accept_transit_gateway_peering_attachment method. boto3 documentation

Method definition
def accept_transit_gateway_peering_attachment(
    self,
    *,
    TransitGatewayAttachmentId: str,
    DryRun: bool = ...,
) -> AcceptTransitGatewayPeeringAttachmentResultTypeDef:  # (1)
    ...
  1. See AcceptTransitGatewayPeeringAttachmentResultTypeDef
Usage example with kwargs
kwargs: AcceptTransitGatewayPeeringAttachmentRequestRequestTypeDef = {  # (1)
    "TransitGatewayAttachmentId": ...,
}

parent.accept_transit_gateway_peering_attachment(**kwargs)
  1. See AcceptTransitGatewayPeeringAttachmentRequestRequestTypeDef

accept_transit_gateway_vpc_attachment

Accepts a request to attach a VPC to a transit gateway.

Type annotations and code completion for boto3.client("ec2").accept_transit_gateway_vpc_attachment method. boto3 documentation

Method definition
def accept_transit_gateway_vpc_attachment(
    self,
    *,
    TransitGatewayAttachmentId: str,
    DryRun: bool = ...,
) -> AcceptTransitGatewayVpcAttachmentResultTypeDef:  # (1)
    ...
  1. See AcceptTransitGatewayVpcAttachmentResultTypeDef
Usage example with kwargs
kwargs: AcceptTransitGatewayVpcAttachmentRequestRequestTypeDef = {  # (1)
    "TransitGatewayAttachmentId": ...,
}

parent.accept_transit_gateway_vpc_attachment(**kwargs)
  1. See AcceptTransitGatewayVpcAttachmentRequestRequestTypeDef

accept_vpc_endpoint_connections

Accepts one or more interface VPC endpoint connection requests to your VPC endpoint service.

Type annotations and code completion for boto3.client("ec2").accept_vpc_endpoint_connections method. boto3 documentation

Method definition
def accept_vpc_endpoint_connections(
    self,
    *,
    ServiceId: str,
    VpcEndpointIds: Sequence[str],
    DryRun: bool = ...,
) -> AcceptVpcEndpointConnectionsResultTypeDef:  # (1)
    ...
  1. See AcceptVpcEndpointConnectionsResultTypeDef
Usage example with kwargs
kwargs: AcceptVpcEndpointConnectionsRequestRequestTypeDef = {  # (1)
    "ServiceId": ...,
    "VpcEndpointIds": ...,
}

parent.accept_vpc_endpoint_connections(**kwargs)
  1. See AcceptVpcEndpointConnectionsRequestRequestTypeDef

accept_vpc_peering_connection

Accept a VPC peering connection request.

Type annotations and code completion for boto3.client("ec2").accept_vpc_peering_connection method. boto3 documentation

Method definition
def accept_vpc_peering_connection(
    self,
    *,
    DryRun: bool = ...,
    VpcPeeringConnectionId: str = ...,
) -> AcceptVpcPeeringConnectionResultTypeDef:  # (1)
    ...
  1. See AcceptVpcPeeringConnectionResultTypeDef
Usage example with kwargs
kwargs: AcceptVpcPeeringConnectionRequestRequestTypeDef = {  # (1)
    "DryRun": ...,
}

parent.accept_vpc_peering_connection(**kwargs)
  1. See AcceptVpcPeeringConnectionRequestRequestTypeDef

Advertises an IPv4 or IPv6 address range that is provisioned for use with your Amazon Web Services resources through bring your own IP addresses (BYOIP).

Type annotations and code completion for boto3.client("ec2").advertise_byoip_cidr method. boto3 documentation

Method definition
def advertise_byoip_cidr(
    self,
    *,
    Cidr: str,
    DryRun: bool = ...,
) -> AdvertiseByoipCidrResultTypeDef:  # (1)
    ...
  1. See AdvertiseByoipCidrResultTypeDef
Usage example with kwargs
kwargs: AdvertiseByoipCidrRequestRequestTypeDef = {  # (1)
    "Cidr": ...,
}

parent.advertise_byoip_cidr(**kwargs)
  1. See AdvertiseByoipCidrRequestRequestTypeDef

allocate_address

Allocates an Elastic IP address to your Amazon Web Services account.

Type annotations and code completion for boto3.client("ec2").allocate_address method. boto3 documentation

Method definition
def allocate_address(
    self,
    *,
    Domain: DomainTypeType = ...,  # (1)
    Address: str = ...,
    PublicIpv4Pool: str = ...,
    NetworkBorderGroup: str = ...,
    CustomerOwnedIpv4Pool: str = ...,
    DryRun: bool = ...,
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (2)
) -> AllocateAddressResultTypeDef:  # (3)
    ...
  1. See DomainTypeType
  2. See TagSpecificationTypeDef
  3. See AllocateAddressResultTypeDef
Usage example with kwargs
kwargs: AllocateAddressRequestRequestTypeDef = {  # (1)
    "Domain": ...,
}

parent.allocate_address(**kwargs)
  1. See AllocateAddressRequestRequestTypeDef

allocate_hosts

Allocates a Dedicated Host to your account.

Type annotations and code completion for boto3.client("ec2").allocate_hosts method. boto3 documentation

Method definition
def allocate_hosts(
    self,
    *,
    AvailabilityZone: str,
    Quantity: int,
    AutoPlacement: AutoPlacementType = ...,  # (1)
    ClientToken: str = ...,
    InstanceType: str = ...,
    InstanceFamily: str = ...,
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (2)
    HostRecovery: HostRecoveryType = ...,  # (3)
    OutpostArn: str = ...,
) -> AllocateHostsResultTypeDef:  # (4)
    ...
  1. See AutoPlacementType
  2. See TagSpecificationTypeDef
  3. See HostRecoveryType
  4. See AllocateHostsResultTypeDef
Usage example with kwargs
kwargs: AllocateHostsRequestRequestTypeDef = {  # (1)
    "AvailabilityZone": ...,
    "Quantity": ...,
}

parent.allocate_hosts(**kwargs)
  1. See AllocateHostsRequestRequestTypeDef

allocate_ipam_pool_cidr

Allocate a CIDR from an IPAM pool.

Type annotations and code completion for boto3.client("ec2").allocate_ipam_pool_cidr method. boto3 documentation

Method definition
def allocate_ipam_pool_cidr(
    self,
    *,
    IpamPoolId: str,
    DryRun: bool = ...,
    Cidr: str = ...,
    NetmaskLength: int = ...,
    ClientToken: str = ...,
    Description: str = ...,
    PreviewNextCidr: bool = ...,
    DisallowedCidrs: Sequence[str] = ...,
) -> AllocateIpamPoolCidrResultTypeDef:  # (1)
    ...
  1. See AllocateIpamPoolCidrResultTypeDef
Usage example with kwargs
kwargs: AllocateIpamPoolCidrRequestRequestTypeDef = {  # (1)
    "IpamPoolId": ...,
}

parent.allocate_ipam_pool_cidr(**kwargs)
  1. See AllocateIpamPoolCidrRequestRequestTypeDef

apply_security_groups_to_client_vpn_target_network

Applies a security group to the association between the target network and the Client VPN endpoint.

Type annotations and code completion for boto3.client("ec2").apply_security_groups_to_client_vpn_target_network method. boto3 documentation

Method definition
def apply_security_groups_to_client_vpn_target_network(
    self,
    *,
    ClientVpnEndpointId: str,
    VpcId: str,
    SecurityGroupIds: Sequence[str],
    DryRun: bool = ...,
) -> ApplySecurityGroupsToClientVpnTargetNetworkResultTypeDef:  # (1)
    ...
  1. See ApplySecurityGroupsToClientVpnTargetNetworkResultTypeDef
Usage example with kwargs
kwargs: ApplySecurityGroupsToClientVpnTargetNetworkRequestRequestTypeDef = {  # (1)
    "ClientVpnEndpointId": ...,
    "VpcId": ...,
    "SecurityGroupIds": ...,
}

parent.apply_security_groups_to_client_vpn_target_network(**kwargs)
  1. See ApplySecurityGroupsToClientVpnTargetNetworkRequestRequestTypeDef

assign_ipv6_addresses

Assigns one or more IPv6 addresses to the specified network interface.

Type annotations and code completion for boto3.client("ec2").assign_ipv6_addresses method. boto3 documentation

Method definition
def assign_ipv6_addresses(
    self,
    *,
    NetworkInterfaceId: str,
    Ipv6AddressCount: int = ...,
    Ipv6Addresses: Sequence[str] = ...,
    Ipv6PrefixCount: int = ...,
    Ipv6Prefixes: Sequence[str] = ...,
) -> AssignIpv6AddressesResultTypeDef:  # (1)
    ...
  1. See AssignIpv6AddressesResultTypeDef
Usage example with kwargs
kwargs: AssignIpv6AddressesRequestRequestTypeDef = {  # (1)
    "NetworkInterfaceId": ...,
}

parent.assign_ipv6_addresses(**kwargs)
  1. See AssignIpv6AddressesRequestRequestTypeDef

assign_private_ip_addresses

Assigns one or more secondary private IP addresses to the specified network interface.

Type annotations and code completion for boto3.client("ec2").assign_private_ip_addresses method. boto3 documentation

Method definition
def assign_private_ip_addresses(
    self,
    *,
    NetworkInterfaceId: str,
    AllowReassignment: bool = ...,
    PrivateIpAddresses: Sequence[str] = ...,
    SecondaryPrivateIpAddressCount: int = ...,
    Ipv4Prefixes: Sequence[str] = ...,
    Ipv4PrefixCount: int = ...,
) -> AssignPrivateIpAddressesResultTypeDef:  # (1)
    ...
  1. See AssignPrivateIpAddressesResultTypeDef
Usage example with kwargs
kwargs: AssignPrivateIpAddressesRequestRequestTypeDef = {  # (1)
    "NetworkInterfaceId": ...,
}

parent.assign_private_ip_addresses(**kwargs)
  1. See AssignPrivateIpAddressesRequestRequestTypeDef

associate_address

Associates an Elastic IP address, or carrier IP address (for instances that are in subnets in Wavelength Zones) with an instance or a network interface.

Type annotations and code completion for boto3.client("ec2").associate_address method. boto3 documentation

Method definition
def associate_address(
    self,
    *,
    AllocationId: str = ...,
    InstanceId: str = ...,
    PublicIp: str = ...,
    AllowReassociation: bool = ...,
    DryRun: bool = ...,
    NetworkInterfaceId: str = ...,
    PrivateIpAddress: str = ...,
) -> AssociateAddressResultTypeDef:  # (1)
    ...
  1. See AssociateAddressResultTypeDef
Usage example with kwargs
kwargs: AssociateAddressRequestRequestTypeDef = {  # (1)
    "AllocationId": ...,
}

parent.associate_address(**kwargs)
  1. See AssociateAddressRequestRequestTypeDef

associate_client_vpn_target_network

Associates a target network with a Client VPN endpoint.

Type annotations and code completion for boto3.client("ec2").associate_client_vpn_target_network method. boto3 documentation

Method definition
def associate_client_vpn_target_network(
    self,
    *,
    ClientVpnEndpointId: str,
    SubnetId: str,
    ClientToken: str = ...,
    DryRun: bool = ...,
) -> AssociateClientVpnTargetNetworkResultTypeDef:  # (1)
    ...
  1. See AssociateClientVpnTargetNetworkResultTypeDef
Usage example with kwargs
kwargs: AssociateClientVpnTargetNetworkRequestRequestTypeDef = {  # (1)
    "ClientVpnEndpointId": ...,
    "SubnetId": ...,
}

parent.associate_client_vpn_target_network(**kwargs)
  1. See AssociateClientVpnTargetNetworkRequestRequestTypeDef

associate_dhcp_options

Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.

Type annotations and code completion for boto3.client("ec2").associate_dhcp_options method. boto3 documentation

Method definition
def associate_dhcp_options(
    self,
    *,
    DhcpOptionsId: str,
    VpcId: str,
    DryRun: bool = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: AssociateDhcpOptionsRequestRequestTypeDef = {  # (1)
    "DhcpOptionsId": ...,
    "VpcId": ...,
}

parent.associate_dhcp_options(**kwargs)
  1. See AssociateDhcpOptionsRequestRequestTypeDef

associate_enclave_certificate_iam_role

Associates an Identity and Access Management (IAM) role with an Certificate Manager (ACM) certificate.

Type annotations and code completion for boto3.client("ec2").associate_enclave_certificate_iam_role method. boto3 documentation

Method definition
def associate_enclave_certificate_iam_role(
    self,
    *,
    CertificateArn: str = ...,
    RoleArn: str = ...,
    DryRun: bool = ...,
) -> AssociateEnclaveCertificateIamRoleResultTypeDef:  # (1)
    ...
  1. See AssociateEnclaveCertificateIamRoleResultTypeDef
Usage example with kwargs
kwargs: AssociateEnclaveCertificateIamRoleRequestRequestTypeDef = {  # (1)
    "CertificateArn": ...,
}

parent.associate_enclave_certificate_iam_role(**kwargs)
  1. See AssociateEnclaveCertificateIamRoleRequestRequestTypeDef

associate_iam_instance_profile

Associates an IAM instance profile with a running or stopped instance.

Type annotations and code completion for boto3.client("ec2").associate_iam_instance_profile method. boto3 documentation

Method definition
def associate_iam_instance_profile(
    self,
    *,
    IamInstanceProfile: IamInstanceProfileSpecificationTypeDef,  # (1)
    InstanceId: str,
) -> AssociateIamInstanceProfileResultTypeDef:  # (2)
    ...
  1. See IamInstanceProfileSpecificationTypeDef
  2. See AssociateIamInstanceProfileResultTypeDef
Usage example with kwargs
kwargs: AssociateIamInstanceProfileRequestRequestTypeDef = {  # (1)
    "IamInstanceProfile": ...,
    "InstanceId": ...,
}

parent.associate_iam_instance_profile(**kwargs)
  1. See AssociateIamInstanceProfileRequestRequestTypeDef

associate_instance_event_window

Associates one or more targets with an event window.

Type annotations and code completion for boto3.client("ec2").associate_instance_event_window method. boto3 documentation

Method definition
def associate_instance_event_window(
    self,
    *,
    InstanceEventWindowId: str,
    AssociationTarget: InstanceEventWindowAssociationRequestTypeDef,  # (1)
    DryRun: bool = ...,
) -> AssociateInstanceEventWindowResultTypeDef:  # (2)
    ...
  1. See InstanceEventWindowAssociationRequestTypeDef
  2. See AssociateInstanceEventWindowResultTypeDef
Usage example with kwargs
kwargs: AssociateInstanceEventWindowRequestRequestTypeDef = {  # (1)
    "InstanceEventWindowId": ...,
    "AssociationTarget": ...,
}

parent.associate_instance_event_window(**kwargs)
  1. See AssociateInstanceEventWindowRequestRequestTypeDef

associate_route_table

Associates a subnet in your VPC or an internet gateway or virtual private gateway attached to your VPC with a route table in your VPC.

Type annotations and code completion for boto3.client("ec2").associate_route_table method. boto3 documentation

Method definition
def associate_route_table(
    self,
    *,
    RouteTableId: str,
    DryRun: bool = ...,
    SubnetId: str = ...,
    GatewayId: str = ...,
) -> AssociateRouteTableResultTypeDef:  # (1)
    ...
  1. See AssociateRouteTableResultTypeDef
Usage example with kwargs
kwargs: AssociateRouteTableRequestRequestTypeDef = {  # (1)
    "RouteTableId": ...,
}

parent.associate_route_table(**kwargs)
  1. See AssociateRouteTableRequestRequestTypeDef

associate_subnet_cidr_block

Associates a CIDR block with your subnet.

Type annotations and code completion for boto3.client("ec2").associate_subnet_cidr_block method. boto3 documentation

Method definition
def associate_subnet_cidr_block(
    self,
    *,
    Ipv6CidrBlock: str,
    SubnetId: str,
) -> AssociateSubnetCidrBlockResultTypeDef:  # (1)
    ...
  1. See AssociateSubnetCidrBlockResultTypeDef
Usage example with kwargs
kwargs: AssociateSubnetCidrBlockRequestRequestTypeDef = {  # (1)
    "Ipv6CidrBlock": ...,
    "SubnetId": ...,
}

parent.associate_subnet_cidr_block(**kwargs)
  1. See AssociateSubnetCidrBlockRequestRequestTypeDef

associate_transit_gateway_multicast_domain

Associates the specified subnets and transit gateway attachments with the specified transit gateway multicast domain.

Type annotations and code completion for boto3.client("ec2").associate_transit_gateway_multicast_domain method. boto3 documentation

Method definition
def associate_transit_gateway_multicast_domain(
    self,
    *,
    TransitGatewayMulticastDomainId: str = ...,
    TransitGatewayAttachmentId: str = ...,
    SubnetIds: Sequence[str] = ...,
    DryRun: bool = ...,
) -> AssociateTransitGatewayMulticastDomainResultTypeDef:  # (1)
    ...
  1. See AssociateTransitGatewayMulticastDomainResultTypeDef
Usage example with kwargs
kwargs: AssociateTransitGatewayMulticastDomainRequestRequestTypeDef = {  # (1)
    "TransitGatewayMulticastDomainId": ...,
}

parent.associate_transit_gateway_multicast_domain(**kwargs)
  1. See AssociateTransitGatewayMulticastDomainRequestRequestTypeDef

associate_transit_gateway_policy_table

Associates the specified transit gateway attachment with a transit gateway policy table.

Type annotations and code completion for boto3.client("ec2").associate_transit_gateway_policy_table method. boto3 documentation

Method definition
def associate_transit_gateway_policy_table(
    self,
    *,
    TransitGatewayPolicyTableId: str,
    TransitGatewayAttachmentId: str,
    DryRun: bool = ...,
) -> AssociateTransitGatewayPolicyTableResultTypeDef:  # (1)
    ...
  1. See AssociateTransitGatewayPolicyTableResultTypeDef
Usage example with kwargs
kwargs: AssociateTransitGatewayPolicyTableRequestRequestTypeDef = {  # (1)
    "TransitGatewayPolicyTableId": ...,
    "TransitGatewayAttachmentId": ...,
}

parent.associate_transit_gateway_policy_table(**kwargs)
  1. See AssociateTransitGatewayPolicyTableRequestRequestTypeDef

associate_transit_gateway_route_table

Associates the specified attachment with the specified transit gateway route table.

Type annotations and code completion for boto3.client("ec2").associate_transit_gateway_route_table method. boto3 documentation

Method definition
def associate_transit_gateway_route_table(
    self,
    *,
    TransitGatewayRouteTableId: str,
    TransitGatewayAttachmentId: str,
    DryRun: bool = ...,
) -> AssociateTransitGatewayRouteTableResultTypeDef:  # (1)
    ...
  1. See AssociateTransitGatewayRouteTableResultTypeDef
Usage example with kwargs
kwargs: AssociateTransitGatewayRouteTableRequestRequestTypeDef = {  # (1)
    "TransitGatewayRouteTableId": ...,
    "TransitGatewayAttachmentId": ...,
}

parent.associate_transit_gateway_route_table(**kwargs)
  1. See AssociateTransitGatewayRouteTableRequestRequestTypeDef

associate_trunk_interface

.

Type annotations and code completion for boto3.client("ec2").associate_trunk_interface method. boto3 documentation

Method definition
def associate_trunk_interface(
    self,
    *,
    BranchInterfaceId: str,
    TrunkInterfaceId: str,
    VlanId: int = ...,
    GreKey: int = ...,
    ClientToken: str = ...,
    DryRun: bool = ...,
) -> AssociateTrunkInterfaceResultTypeDef:  # (1)
    ...
  1. See AssociateTrunkInterfaceResultTypeDef
Usage example with kwargs
kwargs: AssociateTrunkInterfaceRequestRequestTypeDef = {  # (1)
    "BranchInterfaceId": ...,
    "TrunkInterfaceId": ...,
}

parent.associate_trunk_interface(**kwargs)
  1. See AssociateTrunkInterfaceRequestRequestTypeDef

associate_vpc_cidr_block

Associates a CIDR block with your VPC.

Type annotations and code completion for boto3.client("ec2").associate_vpc_cidr_block method. boto3 documentation

Method definition
def associate_vpc_cidr_block(
    self,
    *,
    VpcId: str,
    AmazonProvidedIpv6CidrBlock: bool = ...,
    CidrBlock: str = ...,
    Ipv6CidrBlockNetworkBorderGroup: str = ...,
    Ipv6Pool: str = ...,
    Ipv6CidrBlock: str = ...,
    Ipv4IpamPoolId: str = ...,
    Ipv4NetmaskLength: int = ...,
    Ipv6IpamPoolId: str = ...,
    Ipv6NetmaskLength: int = ...,
) -> AssociateVpcCidrBlockResultTypeDef:  # (1)
    ...
  1. See AssociateVpcCidrBlockResultTypeDef
Usage example with kwargs
kwargs: AssociateVpcCidrBlockRequestRequestTypeDef = {  # (1)
    "VpcId": ...,
}

parent.associate_vpc_cidr_block(**kwargs)
  1. See AssociateVpcCidrBlockRequestRequestTypeDef

.

Type annotations and code completion for boto3.client("ec2").attach_classic_link_vpc method. boto3 documentation

Method definition
def attach_classic_link_vpc(
    self,
    *,
    Groups: Sequence[str],
    InstanceId: str,
    VpcId: str,
    DryRun: bool = ...,
) -> AttachClassicLinkVpcResultTypeDef:  # (1)
    ...
  1. See AttachClassicLinkVpcResultTypeDef
Usage example with kwargs
kwargs: AttachClassicLinkVpcRequestRequestTypeDef = {  # (1)
    "Groups": ...,
    "InstanceId": ...,
    "VpcId": ...,
}

parent.attach_classic_link_vpc(**kwargs)
  1. See AttachClassicLinkVpcRequestRequestTypeDef

attach_internet_gateway

Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC.

Type annotations and code completion for boto3.client("ec2").attach_internet_gateway method. boto3 documentation

Method definition
def attach_internet_gateway(
    self,
    *,
    InternetGatewayId: str,
    VpcId: str,
    DryRun: bool = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: AttachInternetGatewayRequestRequestTypeDef = {  # (1)
    "InternetGatewayId": ...,
    "VpcId": ...,
}

parent.attach_internet_gateway(**kwargs)
  1. See AttachInternetGatewayRequestRequestTypeDef

attach_network_interface

Attaches a network interface to an instance.

Type annotations and code completion for boto3.client("ec2").attach_network_interface method. boto3 documentation

Method definition
def attach_network_interface(
    self,
    *,
    DeviceIndex: int,
    InstanceId: str,
    NetworkInterfaceId: str,
    DryRun: bool = ...,
    NetworkCardIndex: int = ...,
) -> AttachNetworkInterfaceResultTypeDef:  # (1)
    ...
  1. See AttachNetworkInterfaceResultTypeDef
Usage example with kwargs
kwargs: AttachNetworkInterfaceRequestRequestTypeDef = {  # (1)
    "DeviceIndex": ...,
    "InstanceId": ...,
    "NetworkInterfaceId": ...,
}

parent.attach_network_interface(**kwargs)
  1. See AttachNetworkInterfaceRequestRequestTypeDef

attach_volume

Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.

Type annotations and code completion for boto3.client("ec2").attach_volume method. boto3 documentation

Method definition
def attach_volume(
    self,
    *,
    Device: str,