EC2ServiceResource
Auto-generated documentation for EC2 type annotations stubs module mypy-boto3-ec2.
EC2ServiceResource
Type annotations and code completion for boto3.resource("ec2"), included resources and collections.
boto3 documentation
from mypy_boto3_ec2.service_resource import EC2ServiceResource
def get_ec2_resource() -> EC2ServiceResource:
return boto3.resource("ec2")
Attributes
-
meta: EC2ResourceMeta -
classic_addresses: ServiceResourceClassicAddressesCollection -
dhcp_options_sets: ServiceResourceDhcpOptionsSetsCollection -
images: ServiceResourceImagesCollection -
instances: ServiceResourceInstancesCollection -
internet_gateways: ServiceResourceInternetGatewaysCollection -
key_pairs: ServiceResourceKeyPairsCollection -
network_acls: ServiceResourceNetworkAclsCollection -
network_interfaces: ServiceResourceNetworkInterfacesCollection -
placement_groups: ServiceResourcePlacementGroupsCollection -
route_tables: ServiceResourceRouteTablesCollection -
security_groups: ServiceResourceSecurityGroupsCollection -
snapshots: ServiceResourceSnapshotsCollection -
subnets: ServiceResourceSubnetsCollection -
volumes: ServiceResourceVolumesCollection -
vpc_addresses: ServiceResourceVpcAddressesCollection -
vpc_peering_connections: ServiceResourceVpcPeeringConnectionsCollection
Collections
ServiceResourceClassicAddressesCollection
Provides access to ClassicAddress resource.
Type annotations and code completion for boto3.resource("ec2").classic_addresses collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceClassicAddressesCollection
def get_collection() -> ServiceResourceClassicAddressesCollection:
return boto3.resource("ec2").classic_addresses
ServiceResourceDhcpOptionsSetsCollection
Provides access to DhcpOptions resource.
Type annotations and code completion for boto3.resource("ec2").dhcp_options_sets collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceDhcpOptionsSetsCollection
def get_collection() -> ServiceResourceDhcpOptionsSetsCollection:
return boto3.resource("ec2").dhcp_options_sets
ServiceResourceImagesCollection
Provides access to Image resource.
Type annotations and code completion for boto3.resource("ec2").images collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceImagesCollection
def get_collection() -> ServiceResourceImagesCollection:
return boto3.resource("ec2").images
ServiceResourceInstancesCollection
Provides access to Instance resource.
Type annotations and code completion for boto3.resource("ec2").instances collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceInstancesCollection
def get_collection() -> ServiceResourceInstancesCollection:
return boto3.resource("ec2").instances
ServiceResourceInternetGatewaysCollection
Provides access to InternetGateway resource.
Type annotations and code completion for boto3.resource("ec2").internet_gateways collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceInternetGatewaysCollection
def get_collection() -> ServiceResourceInternetGatewaysCollection:
return boto3.resource("ec2").internet_gateways
ServiceResourceKeyPairsCollection
Provides access to KeyPairInfo resource.
Type annotations and code completion for boto3.resource("ec2").key_pairs collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceKeyPairsCollection
def get_collection() -> ServiceResourceKeyPairsCollection:
return boto3.resource("ec2").key_pairs
ServiceResourceNetworkAclsCollection
Provides access to NetworkAcl resource.
Type annotations and code completion for boto3.resource("ec2").network_acls collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceNetworkAclsCollection
def get_collection() -> ServiceResourceNetworkAclsCollection:
return boto3.resource("ec2").network_acls
ServiceResourceNetworkInterfacesCollection
Provides access to NetworkInterface resource.
Type annotations and code completion for boto3.resource("ec2").network_interfaces collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceNetworkInterfacesCollection
def get_collection() -> ServiceResourceNetworkInterfacesCollection:
return boto3.resource("ec2").network_interfaces
ServiceResourcePlacementGroupsCollection
Provides access to PlacementGroup resource.
Type annotations and code completion for boto3.resource("ec2").placement_groups collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourcePlacementGroupsCollection
def get_collection() -> ServiceResourcePlacementGroupsCollection:
return boto3.resource("ec2").placement_groups
ServiceResourceRouteTablesCollection
Provides access to RouteTable resource.
Type annotations and code completion for boto3.resource("ec2").route_tables collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceRouteTablesCollection
def get_collection() -> ServiceResourceRouteTablesCollection:
return boto3.resource("ec2").route_tables
ServiceResourceSecurityGroupsCollection
Provides access to SecurityGroup resource.
Type annotations and code completion for boto3.resource("ec2").security_groups collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceSecurityGroupsCollection
def get_collection() -> ServiceResourceSecurityGroupsCollection:
return boto3.resource("ec2").security_groups
ServiceResourceSnapshotsCollection
Provides access to Snapshot resource.
Type annotations and code completion for boto3.resource("ec2").snapshots collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceSnapshotsCollection
def get_collection() -> ServiceResourceSnapshotsCollection:
return boto3.resource("ec2").snapshots
ServiceResourceSubnetsCollection
Provides access to Subnet resource.
Type annotations and code completion for boto3.resource("ec2").subnets collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceSubnetsCollection
def get_collection() -> ServiceResourceSubnetsCollection:
return boto3.resource("ec2").subnets
ServiceResourceVolumesCollection
Provides access to Volume resource.
Type annotations and code completion for boto3.resource("ec2").volumes collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceVolumesCollection
def get_collection() -> ServiceResourceVolumesCollection:
return boto3.resource("ec2").volumes
ServiceResourceVpcAddressesCollection
Provides access to VpcAddress resource.
Type annotations and code completion for boto3.resource("ec2").vpc_addresses collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceVpcAddressesCollection
def get_collection() -> ServiceResourceVpcAddressesCollection:
return boto3.resource("ec2").vpc_addresses
ServiceResourceVpcPeeringConnectionsCollection
Provides access to VpcPeeringConnection resource.
Type annotations and code completion for boto3.resource("ec2").vpc_peering_connections collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceVpcPeeringConnectionsCollection
def get_collection() -> ServiceResourceVpcPeeringConnectionsCollection:
return boto3.resource("ec2").vpc_peering_connections
ServiceResourceVpcsCollection
Provides access to Vpc resource.
Type annotations and code completion for boto3.resource("ec2").vpcs collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import ServiceResourceVpcsCollection
def get_collection() -> ServiceResourceVpcsCollection:
return boto3.resource("ec2").vpcs
Methods
EC2ServiceResource.ClassicAddress method
Creates a ClassicAddress resource.
Type annotations and code completion for boto3.resource("ec2").ClassicAddress method.
boto3 documentation
kwargs: ServiceResourceClassicAddressRequestTypeDef = { # (1)
"public_ip": ...,
}
parent.ClassicAddress(**kwargs)
EC2ServiceResource.DhcpOptions method
Creates a DhcpOptions resource.
Type annotations and code completion for boto3.resource("ec2").DhcpOptions method.
boto3 documentation
kwargs: ServiceResourceDhcpOptionsRequestTypeDef = { # (1)
"id": ...,
}
parent.DhcpOptions(**kwargs)
EC2ServiceResource.Image method
Creates a Image resource.
Type annotations and code completion for boto3.resource("ec2").Image method.
boto3 documentation
kwargs: ServiceResourceImageRequestTypeDef = { # (1)
"id": ...,
}
parent.Image(**kwargs)
EC2ServiceResource.Instance method
Creates a Instance resource.
Type annotations and code completion for boto3.resource("ec2").Instance method.
boto3 documentation
kwargs: ServiceResourceInstanceRequestTypeDef = { # (1)
"id": ...,
}
parent.Instance(**kwargs)
EC2ServiceResource.InternetGateway method
Creates a InternetGateway resource.
Type annotations and code completion for boto3.resource("ec2").InternetGateway method.
boto3 documentation
kwargs: ServiceResourceInternetGatewayRequestTypeDef = { # (1)
"id": ...,
}
parent.InternetGateway(**kwargs)
EC2ServiceResource.KeyPair method
Creates a KeyPairInfo resource.
Type annotations and code completion for boto3.resource("ec2").KeyPair method.
boto3 documentation
kwargs: ServiceResourceKeyPairRequestTypeDef = { # (1)
"name": ...,
}
parent.KeyPair(**kwargs)
EC2ServiceResource.NetworkAcl method
Creates a NetworkAcl resource.
Type annotations and code completion for boto3.resource("ec2").NetworkAcl method.
boto3 documentation
kwargs: ServiceResourceNetworkAclRequestTypeDef = { # (1)
"id": ...,
}
parent.NetworkAcl(**kwargs)
EC2ServiceResource.NetworkInterface method
Creates a NetworkInterface resource.
Type annotations and code completion for boto3.resource("ec2").NetworkInterface method.
boto3 documentation
kwargs: ServiceResourceNetworkInterfaceRequestTypeDef = { # (1)
"id": ...,
}
parent.NetworkInterface(**kwargs)
EC2ServiceResource.NetworkInterfaceAssociation method
Creates a NetworkInterfaceAssociation resource.
Type annotations and code completion for boto3.resource("ec2").NetworkInterfaceAssociation method.
boto3 documentation
def NetworkInterfaceAssociation(
self,
id: str,
) -> NetworkInterfaceAssociation:
...
kwargs: ServiceResourceNetworkInterfaceAssociationRequestTypeDef = { # (1)
"id": ...,
}
parent.NetworkInterfaceAssociation(**kwargs)
EC2ServiceResource.PlacementGroup method
Creates a PlacementGroup resource.
Type annotations and code completion for boto3.resource("ec2").PlacementGroup method.
boto3 documentation
kwargs: ServiceResourcePlacementGroupRequestTypeDef = { # (1)
"name": ...,
}
parent.PlacementGroup(**kwargs)
EC2ServiceResource.Route method
Creates a Route resource.
Type annotations and code completion for boto3.resource("ec2").Route method.
boto3 documentation
kwargs: ServiceResourceRouteRequestTypeDef = { # (1)
"route_table_id": ...,
"destination_cidr_block": ...,
}
parent.Route(**kwargs)
EC2ServiceResource.RouteTable method
Creates a RouteTable resource.
Type annotations and code completion for boto3.resource("ec2").RouteTable method.
boto3 documentation
kwargs: ServiceResourceRouteTableRequestTypeDef = { # (1)
"id": ...,
}
parent.RouteTable(**kwargs)
EC2ServiceResource.RouteTableAssociation method
Creates a RouteTableAssociation resource.
Type annotations and code completion for boto3.resource("ec2").RouteTableAssociation method.
boto3 documentation
kwargs: ServiceResourceRouteTableAssociationRequestTypeDef = { # (1)
"id": ...,
}
parent.RouteTableAssociation(**kwargs)
EC2ServiceResource.SecurityGroup method
Creates a SecurityGroup resource.
Type annotations and code completion for boto3.resource("ec2").SecurityGroup method.
boto3 documentation
kwargs: ServiceResourceSecurityGroupRequestTypeDef = { # (1)
"id": ...,
}
parent.SecurityGroup(**kwargs)
EC2ServiceResource.Snapshot method
Creates a Snapshot resource.
Type annotations and code completion for boto3.resource("ec2").Snapshot method.
boto3 documentation
kwargs: ServiceResourceSnapshotRequestTypeDef = { # (1)
"id": ...,
}
parent.Snapshot(**kwargs)
EC2ServiceResource.Subnet method
Creates a Subnet resource.
Type annotations and code completion for boto3.resource("ec2").Subnet method.
boto3 documentation
kwargs: ServiceResourceSubnetRequestTypeDef = { # (1)
"id": ...,
}
parent.Subnet(**kwargs)
EC2ServiceResource.Tag method
Creates a Tag resource.
Type annotations and code completion for boto3.resource("ec2").Tag method.
boto3 documentation
kwargs: ServiceResourceTagRequestTypeDef = { # (1)
"resource_id": ...,
"key": ...,
"value": ...,
}
parent.Tag(**kwargs)
EC2ServiceResource.Volume method
Creates a Volume resource.
Type annotations and code completion for boto3.resource("ec2").Volume method.
boto3 documentation
kwargs: ServiceResourceVolumeRequestTypeDef = { # (1)
"id": ...,
}
parent.Volume(**kwargs)
EC2ServiceResource.Vpc method
Creates a Vpc resource.
Type annotations and code completion for boto3.resource("ec2").Vpc method.
boto3 documentation
kwargs: ServiceResourceVpcRequestTypeDef = { # (1)
"id": ...,
}
parent.Vpc(**kwargs)
EC2ServiceResource.VpcAddress method
Creates a VpcAddress resource.
Type annotations and code completion for boto3.resource("ec2").VpcAddress method.
boto3 documentation
kwargs: ServiceResourceVpcAddressRequestTypeDef = { # (1)
"allocation_id": ...,
}
parent.VpcAddress(**kwargs)
EC2ServiceResource.VpcPeeringConnection method
Creates a VpcPeeringConnection resource.
Type annotations and code completion for boto3.resource("ec2").VpcPeeringConnection method.
boto3 documentation
kwargs: ServiceResourceVpcPeeringConnectionRequestTypeDef = { # (1)
"id": ...,
}
parent.VpcPeeringConnection(**kwargs)
EC2ServiceResource.create_dhcp_options method
Creates a set of DHCP options for your VPC.
Type annotations and code completion for boto3.resource("ec2").create_dhcp_options method.
boto3 documentation
def create_dhcp_options(
self,
*,
DhcpConfigurations: Sequence[NewDhcpConfigurationTypeDef], # (1)
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
DryRun: bool = ...,
) -> DhcpOptions:
...
kwargs: CreateDhcpOptionsRequestServiceResourceCreateDhcpOptionsTypeDef = { # (1)
"DhcpConfigurations": ...,
}
parent.create_dhcp_options(**kwargs)
EC2ServiceResource.create_instances method
Launches the specified number of instances using an AMI for which you have permissions.
Type annotations and code completion for boto3.resource("ec2").create_instances method.
boto3 documentation
def create_instances(
self,
*,
MaxCount: int,
MinCount: int,
BlockDeviceMappings: Sequence[BlockDeviceMappingTypeDef] = ..., # (1)
ImageId: str = ...,
InstanceType: InstanceTypeType = ..., # (2)
Ipv6AddressCount: int = ...,
Ipv6Addresses: Sequence[InstanceIpv6AddressTypeDef] = ..., # (3)
KernelId: str = ...,
KeyName: str = ...,
Monitoring: RunInstancesMonitoringEnabledTypeDef = ..., # (4)
Placement: PlacementTypeDef = ..., # (5)
RamdiskId: str = ...,
SecurityGroupIds: Sequence[str] = ...,
SecurityGroups: Sequence[str] = ...,
SubnetId: str = ...,
UserData: str = ...,
AdditionalInfo: str = ...,
ClientToken: str = ...,
DisableApiTermination: bool = ...,
DryRun: bool = ...,
EbsOptimized: bool = ...,
IamInstanceProfile: IamInstanceProfileSpecificationTypeDef = ..., # (6)
InstanceInitiatedShutdownBehavior: ShutdownBehaviorType = ..., # (7)
NetworkInterfaces: Sequence[InstanceNetworkInterfaceSpecificationTypeDef] = ..., # (8)
PrivateIpAddress: str = ...,
ElasticGpuSpecification: Sequence[ElasticGpuSpecificationTypeDef] = ..., # (9)
ElasticInferenceAccelerators: Sequence[ElasticInferenceAcceleratorTypeDef] = ..., # (10)
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (11)
LaunchTemplate: LaunchTemplateSpecificationTypeDef = ..., # (12)
InstanceMarketOptions: InstanceMarketOptionsRequestTypeDef = ..., # (13)
CreditSpecification: CreditSpecificationRequestTypeDef = ..., # (14)
CpuOptions: CpuOptionsRequestTypeDef = ..., # (15)
CapacityReservationSpecification: CapacityReservationSpecificationTypeDef = ..., # (16)
HibernationOptions: HibernationOptionsRequestTypeDef = ..., # (17)
LicenseSpecifications: Sequence[LicenseConfigurationRequestTypeDef] = ..., # (18)
MetadataOptions: InstanceMetadataOptionsRequestTypeDef = ..., # (19)
EnclaveOptions: EnclaveOptionsRequestTypeDef = ..., # (20)
PrivateDnsNameOptions: PrivateDnsNameOptionsRequestTypeDef = ..., # (21)
MaintenanceOptions: InstanceMaintenanceOptionsRequestTypeDef = ..., # (22)
DisableApiStop: bool = ...,
) -> List[Instance]:
...
- See BlockDeviceMappingTypeDef
- See InstanceTypeType
- See InstanceIpv6AddressTypeDef
- See RunInstancesMonitoringEnabledTypeDef
- See PlacementTypeDef
- See IamInstanceProfileSpecificationTypeDef
- See ShutdownBehaviorType
- See InstanceNetworkInterfaceSpecificationTypeDef
- See ElasticGpuSpecificationTypeDef
- See ElasticInferenceAcceleratorTypeDef
- See TagSpecificationTypeDef
- See LaunchTemplateSpecificationTypeDef
- See InstanceMarketOptionsRequestTypeDef
- See CreditSpecificationRequestTypeDef
- See CpuOptionsRequestTypeDef
- See CapacityReservationSpecificationTypeDef
- See HibernationOptionsRequestTypeDef
- See LicenseConfigurationRequestTypeDef
- See InstanceMetadataOptionsRequestTypeDef
- See EnclaveOptionsRequestTypeDef
- See PrivateDnsNameOptionsRequestTypeDef
- See InstanceMaintenanceOptionsRequestTypeDef
kwargs: RunInstancesRequestServiceResourceCreateInstancesTypeDef = { # (1)
"MaxCount": ...,
"MinCount": ...,
}
parent.create_instances(**kwargs)
EC2ServiceResource.create_internet_gateway method
Creates an internet gateway for use with a VPC.
Type annotations and code completion for boto3.resource("ec2").create_internet_gateway method.
boto3 documentation
def create_internet_gateway(
self,
*,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
DryRun: bool = ...,
) -> InternetGateway:
...
kwargs: CreateInternetGatewayRequestServiceResourceCreateInternetGatewayTypeDef = { # (1)
"TagSpecifications": ...,
}
parent.create_internet_gateway(**kwargs)
EC2ServiceResource.create_key_pair method
Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the specified PEM or PPK format.
Type annotations and code completion for boto3.resource("ec2").create_key_pair method.
boto3 documentation
def create_key_pair(
self,
*,
KeyName: str,
DryRun: bool = ...,
KeyType: KeyTypeType = ..., # (1)
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
KeyFormat: KeyFormatType = ..., # (3)
) -> KeyPair:
...
- See KeyTypeType
- See TagSpecificationTypeDef
- See KeyFormatType
kwargs: CreateKeyPairRequestServiceResourceCreateKeyPairTypeDef = { # (1)
"KeyName": ...,
}
parent.create_key_pair(**kwargs)
EC2ServiceResource.create_network_acl method
Creates a network ACL in a VPC.
Type annotations and code completion for boto3.resource("ec2").create_network_acl method.
boto3 documentation
def create_network_acl(
self,
*,
VpcId: str,
DryRun: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
) -> NetworkAcl:
...
kwargs: CreateNetworkAclRequestServiceResourceCreateNetworkAclTypeDef = { # (1)
"VpcId": ...,
}
parent.create_network_acl(**kwargs)
EC2ServiceResource.create_network_interface method
Creates a network interface in the specified subnet.
Type annotations and code completion for boto3.resource("ec2").create_network_interface method.
boto3 documentation
def create_network_interface(
self,
*,
SubnetId: str,
Description: str = ...,
DryRun: bool = ...,
Groups: Sequence[str] = ...,
Ipv6AddressCount: int = ...,
Ipv6Addresses: Sequence[InstanceIpv6AddressTypeDef] = ..., # (1)
PrivateIpAddress: str = ...,
PrivateIpAddresses: Sequence[PrivateIpAddressSpecificationTypeDef] = ..., # (2)
SecondaryPrivateIpAddressCount: int = ...,
Ipv4Prefixes: Sequence[Ipv4PrefixSpecificationRequestTypeDef] = ..., # (3)
Ipv4PrefixCount: int = ...,
Ipv6Prefixes: Sequence[Ipv6PrefixSpecificationRequestTypeDef] = ..., # (4)
Ipv6PrefixCount: int = ...,
InterfaceType: NetworkInterfaceCreationTypeType = ..., # (5)
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (6)
ClientToken: str = ...,
) -> NetworkInterface:
...
- See InstanceIpv6AddressTypeDef
- See PrivateIpAddressSpecificationTypeDef
- See Ipv4PrefixSpecificationRequestTypeDef
- See Ipv6PrefixSpecificationRequestTypeDef
- See NetworkInterfaceCreationTypeType
- See TagSpecificationTypeDef
kwargs: CreateNetworkInterfaceRequestServiceResourceCreateNetworkInterfaceTypeDef = { # (1)
"SubnetId": ...,
}
parent.create_network_interface(**kwargs)
EC2ServiceResource.create_placement_group method
Creates a placement group in which to launch instances.
Type annotations and code completion for boto3.resource("ec2").create_placement_group method.
boto3 documentation
def create_placement_group(
self,
*,
DryRun: bool = ...,
GroupName: str = ...,
Strategy: PlacementStrategyType = ..., # (1)
PartitionCount: int = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
SpreadLevel: SpreadLevelType = ..., # (3)
) -> PlacementGroup:
...
kwargs: CreatePlacementGroupRequestServiceResourceCreatePlacementGroupTypeDef = { # (1)
"DryRun": ...,
}
parent.create_placement_group(**kwargs)
EC2ServiceResource.create_route_table method
Creates a route table for the specified VPC.
Type annotations and code completion for boto3.resource("ec2").create_route_table method.
boto3 documentation
def create_route_table(
self,
*,
VpcId: str,
DryRun: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
) -> RouteTable:
...
kwargs: CreateRouteTableRequestServiceResourceCreateRouteTableTypeDef = { # (1)
"VpcId": ...,
}
parent.create_route_table(**kwargs)
EC2ServiceResource.create_security_group method
Creates a security group.
Type annotations and code completion for boto3.resource("ec2").create_security_group method.
boto3 documentation
def create_security_group(
self,
*,
Description: str,
GroupName: str,
VpcId: str = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
DryRun: bool = ...,
) -> SecurityGroup:
...
kwargs: CreateSecurityGroupRequestServiceResourceCreateSecurityGroupTypeDef = { # (1)
"Description": ...,
"GroupName": ...,
}
parent.create_security_group(**kwargs)
EC2ServiceResource.create_snapshot method
Creates a snapshot of an EBS volume and stores it in Amazon S3.
Type annotations and code completion for boto3.resource("ec2").create_snapshot method.
boto3 documentation
def create_snapshot(
self,
*,
VolumeId: str,
Description: str = ...,
OutpostArn: str = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
DryRun: bool = ...,
) -> Snapshot:
...
kwargs: CreateSnapshotRequestServiceResourceCreateSnapshotTypeDef = { # (1)
"VolumeId": ...,
}
parent.create_snapshot(**kwargs)
EC2ServiceResource.create_subnet method
Creates a subnet in the specified VPC.
Type annotations and code completion for boto3.resource("ec2").create_subnet method.
boto3 documentation
def create_subnet(
self,
*,
VpcId: str,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
AvailabilityZone: str = ...,
AvailabilityZoneId: str = ...,
CidrBlock: str = ...,
Ipv6CidrBlock: str = ...,
OutpostArn: str = ...,
DryRun: bool = ...,
Ipv6Native: bool = ...,
) -> Subnet:
...
kwargs: CreateSubnetRequestServiceResourceCreateSubnetTypeDef = { # (1)
"VpcId": ...,
}
parent.create_subnet(**kwargs)
EC2ServiceResource.create_tags method
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Resources: Sequence[str],
Tags: Sequence[TagTypeDef], # (1)
DryRun: bool = ...,
) -> None:
...
- See TagTypeDef
kwargs: CreateTagsRequestServiceResourceCreateTagsTypeDef = { # (1)
"Resources": ...,
"Tags": ...,
}
parent.create_tags(**kwargs)
EC2ServiceResource.create_volume method
Creates an EBS volume that can be attached to an instance in the same Availability Zone.
Type annotations and code completion for boto3.resource("ec2").create_volume method.
boto3 documentation
def create_volume(
self,
*,
AvailabilityZone: str,
Encrypted: bool = ...,
Iops: int = ...,
KmsKeyId: str = ...,
OutpostArn: str = ...,
Size: int = ...,
SnapshotId: str = ...,
VolumeType: VolumeTypeType = ..., # (1)
DryRun: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
MultiAttachEnabled: bool = ...,
Throughput: int = ...,
ClientToken: str = ...,
) -> Volume:
...
kwargs: CreateVolumeRequestServiceResourceCreateVolumeTypeDef = { # (1)
"AvailabilityZone": ...,
}
parent.create_volume(**kwargs)
EC2ServiceResource.create_vpc method
Creates a VPC with the specified CIDR blocks.
Type annotations and code completion for boto3.resource("ec2").create_vpc method.
boto3 documentation
def create_vpc(
self,
*,
CidrBlock: str = ...,
AmazonProvidedIpv6CidrBlock: bool = ...,
Ipv6Pool: str = ...,
Ipv6CidrBlock: str = ...,
Ipv4IpamPoolId: str = ...,
Ipv4NetmaskLength: int = ...,
Ipv6IpamPoolId: str = ...,
Ipv6NetmaskLength: int = ...,
DryRun: bool = ...,
InstanceTenancy: TenancyType = ..., # (1)
Ipv6CidrBlockNetworkBorderGroup: str = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
) -> Vpc:
...
- See TenancyType
- See TagSpecificationTypeDef
kwargs: CreateVpcRequestServiceResourceCreateVpcTypeDef = { # (1)
"CidrBlock": ...,
}
parent.create_vpc(**kwargs)
EC2ServiceResource.create_vpc_peering_connection method
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection.
Type annotations and code completion for boto3.resource("ec2").create_vpc_peering_connection method.
boto3 documentation
def create_vpc_peering_connection(
self,
*,
VpcId: str,
DryRun: bool = ...,
PeerOwnerId: str = ...,
PeerVpcId: str = ...,
PeerRegion: str = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
) -> VpcPeeringConnection:
...
kwargs: CreateVpcPeeringConnectionRequestServiceResourceCreateVpcPeeringConnectionTypeDef = { # (1)
"VpcId": ...,
}
parent.create_vpc_peering_connection(**kwargs)
EC2ServiceResource.disassociate_route_table method
Disassociates a subnet or gateway from a route table.
Type annotations and code completion for boto3.resource("ec2").disassociate_route_table method.
boto3 documentation
def disassociate_route_table(
self,
*,
AssociationId: str,
DryRun: bool = ...,
) -> None:
...
kwargs: DisassociateRouteTableRequestServiceResourceDisassociateRouteTableTypeDef = { # (1)
"AssociationId": ...,
}
parent.disassociate_route_table(**kwargs)
EC2ServiceResource.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
EC2ServiceResource.import_key_pair method
Imports the public key from an RSA or ED25519 key pair that you created with a third-party tool.
Type annotations and code completion for boto3.resource("ec2").import_key_pair method.
boto3 documentation
def import_key_pair(
self,
*,
KeyName: str,
PublicKeyMaterial: Union[str, bytes, IO[Any], StreamingBody],
DryRun: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
) -> KeyPairInfo:
...
kwargs: ImportKeyPairRequestServiceResourceImportKeyPairTypeDef = { # (1)
"KeyName": ...,
"PublicKeyMaterial": ...,
}
parent.import_key_pair(**kwargs)
EC2ServiceResource.register_image method
Registers an AMI.
Type annotations and code completion for boto3.resource("ec2").register_image method.
boto3 documentation
def register_image(
self,
*,
Name: str,
ImageLocation: str = ...,
Architecture: ArchitectureValuesType = ..., # (1)
BlockDeviceMappings: Sequence[BlockDeviceMappingTypeDef] = ..., # (2)
Description: str = ...,
DryRun: bool = ...,
EnaSupport: bool = ...,
KernelId: str = ...,
BillingProducts: Sequence[str] = ...,
RamdiskId: str = ...,
RootDeviceName: str = ...,
SriovNetSupport: str = ...,
VirtualizationType: str = ...,
BootMode: BootModeValuesType = ..., # (3)
TpmSupport: TpmSupportValuesType = ..., # (4)
UefiData: str = ...,
ImdsSupport: ImdsSupportValuesType = ..., # (5)
) -> Image:
...
- See ArchitectureValuesType
- See BlockDeviceMappingTypeDef
- See BootModeValuesType
- See TpmSupportValuesType
- See ImdsSupportValuesType
kwargs: RegisterImageRequestServiceResourceRegisterImageTypeDef = { # (1)
"Name": ...,
}
parent.register_image(**kwargs)
ClassicAddress
Type annotations and code completion for boto3.resource("ec2").ClassicAddress class.
boto3 documentation
from mypy_boto3_ec2.service_resource import ClassicAddress
def get_resource() -> ClassicAddress:
return boto3.resource("ec2").ClassicAddress(...)
ClassicAddress attributes
instance_id:strallocation_id:strassociation_id:strdomain: DomainTypeTypenetwork_interface_id:strnetwork_interface_owner_id:strprivate_ip_address:strtags:List[TagTypeDef]public_ipv4_pool:strnetwork_border_group:strcustomer_owned_ip:strcustomer_owned_ipv4_pool:strcarrier_ip:strpublic_ip:str
ClassicAddress methods
ClassicAddress.associate method
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.resource("ec2").associate method.
boto3 documentation
def associate(
self,
*,
AllocationId: str = ...,
InstanceId: str = ...,
AllowReassociation: bool = ...,
DryRun: bool = ...,
NetworkInterfaceId: str = ...,
PrivateIpAddress: str = ...,
) -> AssociateAddressResultTypeDef: # (1)
...
kwargs: AssociateAddressRequestClassicAddressAssociateTypeDef = { # (1)
"AllocationId": ...,
}
parent.associate(**kwargs)
ClassicAddress.disassociate method
Disassociates an Elastic IP address from the instance or network interface it's associated with.
Type annotations and code completion for boto3.resource("ec2").disassociate method.
boto3 documentation
def disassociate(
self,
*,
AssociationId: str = ...,
PublicIp: str = ...,
DryRun: bool = ...,
) -> None:
...
kwargs: DisassociateAddressRequestClassicAddressDisassociateTypeDef = { # (1)
"AssociationId": ...,
}
parent.disassociate(**kwargs)
ClassicAddress.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
ClassicAddress.load method
Calls meth:
EC2.Client.describe_addresses to update the attributes of the
ClassicAddress resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
ClassicAddress.release method
Releases the specified Elastic IP address.
Type annotations and code completion for boto3.resource("ec2").release method.
boto3 documentation
def release(
self,
*,
AllocationId: str = ...,
PublicIp: str = ...,
NetworkBorderGroup: str = ...,
DryRun: bool = ...,
) -> None:
...
kwargs: ReleaseAddressRequestClassicAddressReleaseTypeDef = { # (1)
"AllocationId": ...,
}
parent.release(**kwargs)
ClassicAddress.reload method
Calls meth:
EC2.Client.describe_addresses to update the attributes of the
ClassicAddress resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
DhcpOptions
Type annotations and code completion for boto3.resource("ec2").DhcpOptions class.
boto3 documentation
from mypy_boto3_ec2.service_resource import DhcpOptions
def get_resource() -> DhcpOptions:
return boto3.resource("ec2").DhcpOptions(...)
DhcpOptions attributes
dhcp_configurations:List[DhcpConfigurationTypeDef]dhcp_options_id:strowner_id:strtags:List[TagTypeDef]id:str
DhcpOptions methods
DhcpOptions.associate_with_vpc method
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.resource("ec2").associate_with_vpc method.
boto3 documentation
kwargs: AssociateDhcpOptionsRequestDhcpOptionsAssociateWithVpcTypeDef = { # (1)
"VpcId": ...,
}
parent.associate_with_vpc(**kwargs)
DhcpOptions.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestDhcpOptionsCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
DhcpOptions.delete method
Deletes the specified set of DHCP options.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteDhcpOptionsRequestDhcpOptionsDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
DhcpOptions.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
DhcpOptions.load method
Calls meth:
EC2.Client.describe_dhcp_options to update the attributes of
the DhcpOptions resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
DhcpOptions.reload method
Calls meth:
EC2.Client.describe_dhcp_options to update the attributes of
the DhcpOptions resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Image
Type annotations and code completion for boto3.resource("ec2").Image class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Image
def get_resource() -> Image:
return boto3.resource("ec2").Image(...)
Image attributes
architecture: ArchitectureValuesTypecreation_date:strimage_id:strimage_location:strimage_type: ImageTypeValuesTypepublic:boolkernel_id:strowner_id:strplatform:Literal['Windows'](see PlatformValuesType)platform_details:strusage_operation:strproduct_codes:List[ProductCodeTypeDef]ramdisk_id:strstate: ImageStateTypeblock_device_mappings:List[BlockDeviceMappingTypeDef]description:strena_support:boolhypervisor: HypervisorTypeTypeimage_owner_alias:strname:strroot_device_name:strroot_device_type: DeviceTypeTypesriov_net_support:strstate_reason: StateReasonResponseMetadataTypeDeftags:List[TagTypeDef]virtualization_type: VirtualizationTypeTypeboot_mode: BootModeValuesTypetpm_support:Literal['v2.0'](see TpmSupportValuesType)deprecation_time:strimds_support:Literal['v2.0'](see ImdsSupportValuesType)id:str
Image methods
Image.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestImageCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
Image.deregister method
Deregisters the specified AMI.
Type annotations and code completion for boto3.resource("ec2").deregister method.
boto3 documentation
kwargs: DeregisterImageRequestImageDeregisterTypeDef = { # (1)
"DryRun": ...,
}
parent.deregister(**kwargs)
Image.describe_attribute method
Describes the specified attribute of the specified AMI.
Type annotations and code completion for boto3.resource("ec2").describe_attribute method.
boto3 documentation
def describe_attribute(
self,
*,
Attribute: ImageAttributeNameType, # (1)
DryRun: bool = ...,
) -> ImageAttributeTypeDef: # (2)
...
kwargs: DescribeImageAttributeRequestImageDescribeAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.describe_attribute(**kwargs)
Image.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Image.load method
Calls meth:
EC2.Client.describe_images to update the attributes of the
Image resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
Image.modify_attribute method
Modifies the specified attribute of the specified AMI.
Type annotations and code completion for boto3.resource("ec2").modify_attribute method.
boto3 documentation
def modify_attribute(
self,
*,
Attribute: str = ...,
Description: AttributeValueTypeDef = ..., # (1)
LaunchPermission: LaunchPermissionModificationsTypeDef = ..., # (2)
OperationType: OperationTypeType = ..., # (3)
ProductCodes: Sequence[str] = ...,
UserGroups: Sequence[str] = ...,
UserIds: Sequence[str] = ...,
Value: str = ...,
DryRun: bool = ...,
OrganizationArns: Sequence[str] = ...,
OrganizationalUnitArns: Sequence[str] = ...,
ImdsSupport: AttributeValueTypeDef = ..., # (1)
) -> None:
...
- See AttributeValueTypeDef
- See LaunchPermissionModificationsTypeDef
- See OperationTypeType
- See AttributeValueTypeDef
kwargs: ModifyImageAttributeRequestImageModifyAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.modify_attribute(**kwargs)
Image.reload method
Calls meth:
EC2.Client.describe_images to update the attributes of the
Image resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Image.reset_attribute method
Resets an attribute of an AMI to its default value.
Type annotations and code completion for boto3.resource("ec2").reset_attribute method.
boto3 documentation
def reset_attribute(
self,
*,
Attribute: ResetImageAttributeNameType, # (1)
DryRun: bool = ...,
) -> None:
...
kwargs: ResetImageAttributeRequestImageResetAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.reset_attribute(**kwargs)
Image.wait_until_exists method
Waits until this Image is exists.
Type annotations and code completion for boto3.resource("ec2").wait_until_exists method.
boto3 documentation
Instance
Type annotations and code completion for boto3.resource("ec2").Instance class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Instance
def get_resource() -> Instance:
return boto3.resource("ec2").Instance(...)
Instance attributes
ami_launch_index:intimage_id:strinstance_id:strinstance_type: InstanceTypeTypekernel_id:strkey_name:strlaunch_time:datetimemonitoring: MonitoringResponseMetadataTypeDefplacement: PlacementResponseMetadataTypeDefplatform:Literal['Windows'](see PlatformValuesType)private_dns_name:strprivate_ip_address:strproduct_codes:List[ProductCodeTypeDef]public_dns_name:strpublic_ip_address:strramdisk_id:strstate: InstanceStateResponseMetadataTypeDefstate_transition_reason:strsubnet_id:strvpc_id:strarchitecture: ArchitectureValuesTypeblock_device_mappings:List[InstanceBlockDeviceMappingTypeDef]client_token:strebs_optimized:boolena_support:boolhypervisor: HypervisorTypeTypeiam_instance_profile: IamInstanceProfileResponseMetadataTypeDefinstance_lifecycle: InstanceLifecycleTypeTypeelastic_gpu_associations:List[ElasticGpuAssociationTypeDef]elastic_inference_accelerator_associations:List[ElasticInferenceAcceleratorAssociationTypeDef]network_interfaces_attribute:List[InstanceNetworkInterfaceTypeDef]outpost_arn:strroot_device_name:strroot_device_type: DeviceTypeTypesecurity_groups:List[GroupIdentifierTypeDef]source_dest_check:boolspot_instance_request_id:strsriov_net_support:strstate_reason: StateReasonResponseMetadataTypeDeftags:List[TagTypeDef]virtualization_type: VirtualizationTypeTypecpu_options: CpuOptionsResponseMetadataTypeDefcapacity_reservation_id:strcapacity_reservation_specification: CapacityReservationSpecificationResponseResponseMetadataTypeDefhibernation_options: HibernationOptionsResponseMetadataTypeDeflicenses:List[LicenseConfigurationTypeDef]metadata_options: InstanceMetadataOptionsResponseResponseMetadataTypeDefenclave_options: EnclaveOptionsResponseMetadataTypeDefboot_mode: BootModeValuesTypeplatform_details:strusage_operation:strusage_operation_update_time:datetimeprivate_dns_name_options: PrivateDnsNameOptionsResponseResponseMetadataTypeDefipv6_address:strtpm_support:strmaintenance_options: InstanceMaintenanceOptionsResponseMetadataTypeDefcurrent_instance_boot_mode: InstanceBootModeValuesTypeid:strclassic_address: ClassicAddressimage: Imagekey_pair: KeyPairInfonetwork_interfaces:List[NetworkInterface]placement_group: PlacementGroupsubnet: Subnetvpc: Vpcvolumes: InstanceVolumesCollectionvpc_addresses: InstanceVpcAddressesCollection
Instance collections
Instance.volumes
Provides access to Volume resource.
Type annotations and code completion for boto3.resource("ec2").Instance(...).volumes collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import InstanceVolumesCollection
def get_collection() -> InstanceVolumesCollection:
resource = boto3.resource("ec2").Instance(...)
return resource.volumes
Instance.vpc_addresses
Provides access to VpcAddress resource.
Type annotations and code completion for boto3.resource("ec2").Instance(...).vpc_addresses collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import InstanceVpcAddressesCollection
def get_collection() -> InstanceVpcAddressesCollection:
resource = boto3.resource("ec2").Instance(...)
return resource.vpc_addresses
Instance methods
Instance.attach_classic_link_vpc method
.
Type annotations and code completion for boto3.resource("ec2").attach_classic_link_vpc method.
boto3 documentation
def attach_classic_link_vpc(
self,
*,
Groups: Sequence[str],
VpcId: str,
DryRun: bool = ...,
) -> AttachClassicLinkVpcResultTypeDef: # (1)
...
kwargs: AttachClassicLinkVpcRequestInstanceAttachClassicLinkVpcTypeDef = { # (1)
"Groups": ...,
"VpcId": ...,
}
parent.attach_classic_link_vpc(**kwargs)
Instance.attach_volume method
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.resource("ec2").attach_volume method.
boto3 documentation
def attach_volume(
self,
*,
Device: str,
VolumeId: str,
DryRun: bool = ...,
) -> VolumeAttachmentResponseMetadataTypeDef: # (1)
...
kwargs: AttachVolumeRequestInstanceAttachVolumeTypeDef = { # (1)
"Device": ...,
"VolumeId": ...,
}
parent.attach_volume(**kwargs)
Instance.console_output method
Gets the console output for the specified instance.
Type annotations and code completion for boto3.resource("ec2").console_output method.
boto3 documentation
def console_output(
self,
*,
DryRun: bool = ...,
Latest: bool = ...,
) -> GetConsoleOutputResultTypeDef: # (1)
...
kwargs: GetConsoleOutputRequestInstanceConsoleOutputTypeDef = { # (1)
"DryRun": ...,
}
parent.console_output(**kwargs)
Instance.create_image method
Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.
Type annotations and code completion for boto3.resource("ec2").create_image method.
boto3 documentation
def create_image(
self,
*,
Name: str,
BlockDeviceMappings: Sequence[BlockDeviceMappingTypeDef] = ..., # (1)
Description: str = ...,
DryRun: bool = ...,
NoReboot: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
) -> Image:
...
kwargs: CreateImageRequestInstanceCreateImageTypeDef = { # (1)
"Name": ...,
}
parent.create_image(**kwargs)
Instance.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestInstanceCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
Instance.delete_tags method
Deletes the specified set of tags from the specified set of resources.
Type annotations and code completion for boto3.resource("ec2").delete_tags method.
boto3 documentation
def delete_tags(
self,
Tags: Sequence[TagTypeDef] = ..., # (1)
DryRun: bool = ...,
) -> None:
...
- See TagTypeDef
kwargs: InstanceDeleteTagsRequestTypeDef = { # (1)
"Tags": ...,
}
parent.delete_tags(**kwargs)
Instance.describe_attribute method
Describes the specified attribute of the specified instance.
Type annotations and code completion for boto3.resource("ec2").describe_attribute method.
boto3 documentation
def describe_attribute(
self,
*,
Attribute: InstanceAttributeNameType, # (1)
DryRun: bool = ...,
) -> InstanceAttributeTypeDef: # (2)
...
kwargs: DescribeInstanceAttributeRequestInstanceDescribeAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.describe_attribute(**kwargs)
Instance.detach_classic_link_vpc method
.
Type annotations and code completion for boto3.resource("ec2").detach_classic_link_vpc method.
boto3 documentation
def detach_classic_link_vpc(
self,
*,
VpcId: str,
DryRun: bool = ...,
) -> DetachClassicLinkVpcResultTypeDef: # (1)
...
kwargs: DetachClassicLinkVpcRequestInstanceDetachClassicLinkVpcTypeDef = { # (1)
"VpcId": ...,
}
parent.detach_classic_link_vpc(**kwargs)
Instance.detach_volume method
Detaches an EBS volume from an instance.
Type annotations and code completion for boto3.resource("ec2").detach_volume method.
boto3 documentation
def detach_volume(
self,
*,
VolumeId: str,
Device: str = ...,
Force: bool = ...,
DryRun: bool = ...,
) -> VolumeAttachmentResponseMetadataTypeDef: # (1)
...
kwargs: DetachVolumeRequestInstanceDetachVolumeTypeDef = { # (1)
"VolumeId": ...,
}
parent.detach_volume(**kwargs)
Instance.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Instance.load method
Calls meth:
EC2.Client.describe_instances to update the attributes of the
Instance resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
Instance.modify_attribute method
Modifies the specified attribute of the specified instance.
Type annotations and code completion for boto3.resource("ec2").modify_attribute method.
boto3 documentation
def modify_attribute(
self,
*,
SourceDestCheck: AttributeBooleanValueTypeDef = ..., # (1)
Attribute: InstanceAttributeNameType = ..., # (2)
BlockDeviceMappings: Sequence[InstanceBlockDeviceMappingSpecificationTypeDef] = ..., # (3)
DisableApiTermination: AttributeBooleanValueTypeDef = ..., # (1)
DryRun: bool = ...,
EbsOptimized: AttributeBooleanValueTypeDef = ..., # (1)
EnaSupport: AttributeBooleanValueTypeDef = ..., # (1)
Groups: Sequence[str] = ...,
InstanceInitiatedShutdownBehavior: AttributeValueTypeDef = ..., # (7)
InstanceType: AttributeValueTypeDef = ..., # (7)
Kernel: AttributeValueTypeDef = ..., # (7)
Ramdisk: AttributeValueTypeDef = ..., # (7)
SriovNetSupport: AttributeValueTypeDef = ..., # (7)
UserData: BlobAttributeValueTypeDef = ..., # (12)
Value: str = ...,
DisableApiStop: AttributeBooleanValueTypeDef = ..., # (1)
) -> None:
...
- See AttributeBooleanValueTypeDef
- See InstanceAttributeNameType
- See InstanceBlockDeviceMappingSpecificationTypeDef
- See AttributeBooleanValueTypeDef
- See AttributeBooleanValueTypeDef
- See AttributeBooleanValueTypeDef
- See AttributeValueTypeDef
- See AttributeValueTypeDef
- See AttributeValueTypeDef
- See AttributeValueTypeDef
- See AttributeValueTypeDef
- See BlobAttributeValueTypeDef
- See AttributeBooleanValueTypeDef
kwargs: ModifyInstanceAttributeRequestInstanceModifyAttributeTypeDef = { # (1)
"SourceDestCheck": ...,
}
parent.modify_attribute(**kwargs)
Instance.monitor method
Enables detailed monitoring for a running instance.
Type annotations and code completion for boto3.resource("ec2").monitor method.
boto3 documentation
def monitor(
self,
*,
DryRun: bool = ...,
) -> MonitorInstancesResultTypeDef: # (1)
...
kwargs: MonitorInstancesRequestInstanceMonitorTypeDef = { # (1)
"DryRun": ...,
}
parent.monitor(**kwargs)
Instance.password_data method
Retrieves the encrypted administrator password for a running Windows instance.
Type annotations and code completion for boto3.resource("ec2").password_data method.
boto3 documentation
def password_data(
self,
*,
DryRun: bool = ...,
) -> GetPasswordDataResultTypeDef: # (1)
...
kwargs: GetPasswordDataRequestInstancePasswordDataTypeDef = { # (1)
"DryRun": ...,
}
parent.password_data(**kwargs)
Instance.reboot method
Requests a reboot of the specified instances.
Type annotations and code completion for boto3.resource("ec2").reboot method.
boto3 documentation
kwargs: RebootInstancesRequestInstanceRebootTypeDef = { # (1)
"DryRun": ...,
}
parent.reboot(**kwargs)
Instance.reload method
Calls meth:
EC2.Client.describe_instances to update the attributes of the
Instance resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Instance.report_status method
Submits feedback about the status of an instance.
Type annotations and code completion for boto3.resource("ec2").report_status method.
boto3 documentation
def report_status(
self,
*,
ReasonCodes: Sequence[ReportInstanceReasonCodesType], # (1)
Status: ReportStatusTypeType, # (2)
Description: str = ...,
DryRun: bool = ...,
EndTime: Union[datetime, str] = ...,
StartTime: Union[datetime, str] = ...,
) -> None:
...
kwargs: ReportInstanceStatusRequestInstanceReportStatusTypeDef = { # (1)
"ReasonCodes": ...,
"Status": ...,
}
parent.report_status(**kwargs)
Instance.reset_attribute method
Resets an attribute of an instance to its default value.
Type annotations and code completion for boto3.resource("ec2").reset_attribute method.
boto3 documentation
def reset_attribute(
self,
*,
Attribute: InstanceAttributeNameType, # (1)
DryRun: bool = ...,
) -> None:
...
kwargs: ResetInstanceAttributeRequestInstanceResetAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.reset_attribute(**kwargs)
Instance.reset_kernel method
Resets an attribute of an instance to its default value.
Type annotations and code completion for boto3.resource("ec2").reset_kernel method.
boto3 documentation
def reset_kernel(
self,
*,
Attribute: InstanceAttributeNameType = 'kernel', # (1)
DryRun: bool = ...,
) -> None:
...
kwargs: ResetInstanceAttributeRequestInstanceResetKernelTypeDef = { # (1)
"Attribute": ...,
}
parent.reset_kernel(**kwargs)
Instance.reset_ramdisk method
Resets an attribute of an instance to its default value.
Type annotations and code completion for boto3.resource("ec2").reset_ramdisk method.
boto3 documentation
def reset_ramdisk(
self,
*,
Attribute: InstanceAttributeNameType = 'ramdisk', # (1)
DryRun: bool = ...,
) -> None:
...
kwargs: ResetInstanceAttributeRequestInstanceResetRamdiskTypeDef = { # (1)
"Attribute": ...,
}
parent.reset_ramdisk(**kwargs)
Instance.reset_source_dest_check method
Resets an attribute of an instance to its default value.
Type annotations and code completion for boto3.resource("ec2").reset_source_dest_check method.
boto3 documentation
def reset_source_dest_check(
self,
*,
Attribute: InstanceAttributeNameType = 'sourceDestCheck', # (1)
DryRun: bool = ...,
) -> None:
...
kwargs: ResetInstanceAttributeRequestInstanceResetSourceDestCheckTypeDef = { # (1)
"Attribute": ...,
}
parent.reset_source_dest_check(**kwargs)
Instance.start method
Starts an Amazon EBS-backed instance that you've previously stopped.
Type annotations and code completion for boto3.resource("ec2").start method.
boto3 documentation
def start(
self,
*,
AdditionalInfo: str = ...,
DryRun: bool = ...,
) -> StartInstancesResultTypeDef: # (1)
...
kwargs: StartInstancesRequestInstanceStartTypeDef = { # (1)
"AdditionalInfo": ...,
}
parent.start(**kwargs)
Instance.stop method
Stops an Amazon EBS-backed instance.
Type annotations and code completion for boto3.resource("ec2").stop method.
boto3 documentation
def stop(
self,
*,
Hibernate: bool = ...,
DryRun: bool = ...,
Force: bool = ...,
) -> StopInstancesResultTypeDef: # (1)
...
kwargs: StopInstancesRequestInstanceStopTypeDef = { # (1)
"Hibernate": ...,
}
parent.stop(**kwargs)
Instance.terminate method
Shuts down the specified instances.
Type annotations and code completion for boto3.resource("ec2").terminate method.
boto3 documentation
def terminate(
self,
*,
DryRun: bool = ...,
) -> TerminateInstancesResultTypeDef: # (1)
...
kwargs: TerminateInstancesRequestInstanceTerminateTypeDef = { # (1)
"DryRun": ...,
}
parent.terminate(**kwargs)
Instance.unmonitor method
Disables detailed monitoring for a running instance.
Type annotations and code completion for boto3.resource("ec2").unmonitor method.
boto3 documentation
def unmonitor(
self,
*,
DryRun: bool = ...,
) -> UnmonitorInstancesResultTypeDef: # (1)
...
kwargs: UnmonitorInstancesRequestInstanceUnmonitorTypeDef = { # (1)
"DryRun": ...,
}
parent.unmonitor(**kwargs)
Instance.wait_until_exists method
Waits until this Instance is exists.
Type annotations and code completion for boto3.resource("ec2").wait_until_exists method.
boto3 documentation
Instance.wait_until_running method
Waits until this Instance is running.
Type annotations and code completion for boto3.resource("ec2").wait_until_running method.
boto3 documentation
Instance.wait_until_stopped method
Waits until this Instance is stopped.
Type annotations and code completion for boto3.resource("ec2").wait_until_stopped method.
boto3 documentation
Instance.wait_until_terminated method
Waits until this Instance is terminated.
Type annotations and code completion for boto3.resource("ec2").wait_until_terminated method.
boto3 documentation
InternetGateway
Type annotations and code completion for boto3.resource("ec2").InternetGateway class.
boto3 documentation
from mypy_boto3_ec2.service_resource import InternetGateway
def get_resource() -> InternetGateway:
return boto3.resource("ec2").InternetGateway(...)
InternetGateway attributes
attachments:List[InternetGatewayAttachmentTypeDef]internet_gateway_id:strowner_id:strtags:List[TagTypeDef]id:str
InternetGateway methods
InternetGateway.attach_to_vpc method
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.resource("ec2").attach_to_vpc method.
boto3 documentation
kwargs: AttachInternetGatewayRequestInternetGatewayAttachToVpcTypeDef = { # (1)
"VpcId": ...,
}
parent.attach_to_vpc(**kwargs)
InternetGateway.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestInternetGatewayCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
InternetGateway.delete method
Deletes the specified internet gateway.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteInternetGatewayRequestInternetGatewayDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
InternetGateway.detach_from_vpc method
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC.
Type annotations and code completion for boto3.resource("ec2").detach_from_vpc method.
boto3 documentation
kwargs: DetachInternetGatewayRequestInternetGatewayDetachFromVpcTypeDef = { # (1)
"VpcId": ...,
}
parent.detach_from_vpc(**kwargs)
InternetGateway.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
InternetGateway.load method
Calls meth:
EC2.Client.describe_internet_gateways to update the attributes
of the InternetGateway resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
InternetGateway.reload method
Calls meth:
EC2.Client.describe_internet_gateways to update the attributes
of the InternetGateway resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
KeyPair
Type annotations and code completion for boto3.resource("ec2").KeyPair class.
boto3 documentation
from mypy_boto3_ec2.service_resource import KeyPair
def get_resource() -> KeyPair:
return boto3.resource("ec2").KeyPair(...)
KeyPair attributes
key_fingerprint:strkey_material:strkey_name:strkey_pair_id:strtags:List[TagTypeDef]name:str
KeyPair methods
KeyPair.delete method
Deletes the specified key pair, by removing the public key from Amazon EC2.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteKeyPairRequestKeyPairDeleteTypeDef = { # (1)
"KeyPairId": ...,
}
parent.delete(**kwargs)
KeyPair.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
KeyPairInfo
Type annotations and code completion for boto3.resource("ec2").KeyPairInfo class.
boto3 documentation
from mypy_boto3_ec2.service_resource import KeyPairInfo
def get_resource() -> KeyPairInfo:
return boto3.resource("ec2").KeyPairInfo(...)
KeyPairInfo attributes
key_pair_id:strkey_fingerprint:strkey_name:strkey_type: KeyTypeTypetags:List[TagTypeDef]public_key:strcreate_time:datetimename:str
KeyPairInfo methods
KeyPairInfo.delete method
Deletes the specified key pair, by removing the public key from Amazon EC2.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteKeyPairRequestKeyPairInfoDeleteTypeDef = { # (1)
"KeyPairId": ...,
}
parent.delete(**kwargs)
KeyPairInfo.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
KeyPairInfo.load method
Calls meth:
EC2.Client.describe_key_pairs to update the attributes of the
KeyPairInfo resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
KeyPairInfo.reload method
Calls meth:
EC2.Client.describe_key_pairs to update the attributes of the
KeyPairInfo resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
NetworkAcl
Type annotations and code completion for boto3.resource("ec2").NetworkAcl class.
boto3 documentation
from mypy_boto3_ec2.service_resource import NetworkAcl
def get_resource() -> NetworkAcl:
return boto3.resource("ec2").NetworkAcl(...)
NetworkAcl attributes
associations:List[NetworkAclAssociationTypeDef]entries:List[NetworkAclEntryTypeDef]is_default:boolnetwork_acl_id:strtags:List[TagTypeDef]vpc_id:strowner_id:strid:strvpc: Vpc
NetworkAcl methods
NetworkAcl.create_entry method
Creates an entry (a rule) in a network ACL with the specified rule number.
Type annotations and code completion for boto3.resource("ec2").create_entry method.
boto3 documentation
def create_entry(
self,
*,
Egress: bool,
Protocol: str,
RuleAction: RuleActionType, # (1)
RuleNumber: int,
CidrBlock: str = ...,
DryRun: bool = ...,
IcmpTypeCode: IcmpTypeCodeTypeDef = ..., # (2)
Ipv6CidrBlock: str = ...,
PortRange: PortRangeTypeDef = ..., # (3)
) -> None:
...
- See RuleActionType
- See IcmpTypeCodeTypeDef
- See PortRangeTypeDef
kwargs: CreateNetworkAclEntryRequestNetworkAclCreateEntryTypeDef = { # (1)
"Egress": ...,
"Protocol": ...,
"RuleAction": ...,
"RuleNumber": ...,
}
parent.create_entry(**kwargs)
NetworkAcl.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestNetworkAclCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
NetworkAcl.delete method
Deletes the specified network ACL.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteNetworkAclRequestNetworkAclDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
NetworkAcl.delete_entry method
Deletes the specified ingress or egress entry (rule) from the specified network ACL.
Type annotations and code completion for boto3.resource("ec2").delete_entry method.
boto3 documentation
def delete_entry(
self,
*,
Egress: bool,
RuleNumber: int,
DryRun: bool = ...,
) -> None:
...
kwargs: DeleteNetworkAclEntryRequestNetworkAclDeleteEntryTypeDef = { # (1)
"Egress": ...,
"RuleNumber": ...,
}
parent.delete_entry(**kwargs)
NetworkAcl.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
NetworkAcl.load method
Calls meth:
EC2.Client.describe_network_acls to update the attributes of
the NetworkAcl resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
NetworkAcl.reload method
Calls meth:
EC2.Client.describe_network_acls to update the attributes of
the NetworkAcl resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
NetworkAcl.replace_association method
Changes which network ACL a subnet is associated with.
Type annotations and code completion for boto3.resource("ec2").replace_association method.
boto3 documentation
def replace_association(
self,
*,
AssociationId: str,
DryRun: bool = ...,
) -> ReplaceNetworkAclAssociationResultTypeDef: # (1)
...
kwargs: ReplaceNetworkAclAssociationRequestNetworkAclReplaceAssociationTypeDef = { # (1)
"AssociationId": ...,
}
parent.replace_association(**kwargs)
NetworkAcl.replace_entry method
Replaces an entry (rule) in a network ACL.
Type annotations and code completion for boto3.resource("ec2").replace_entry method.
boto3 documentation
def replace_entry(
self,
*,
Egress: bool,
Protocol: str,
RuleAction: RuleActionType, # (1)
RuleNumber: int,
CidrBlock: str = ...,
DryRun: bool = ...,
IcmpTypeCode: IcmpTypeCodeTypeDef = ..., # (2)
Ipv6CidrBlock: str = ...,
PortRange: PortRangeTypeDef = ..., # (3)
) -> None:
...
- See RuleActionType
- See IcmpTypeCodeTypeDef
- See PortRangeTypeDef
kwargs: ReplaceNetworkAclEntryRequestNetworkAclReplaceEntryTypeDef = { # (1)
"Egress": ...,
"Protocol": ...,
"RuleAction": ...,
"RuleNumber": ...,
}
parent.replace_entry(**kwargs)
NetworkInterface
Type annotations and code completion for boto3.resource("ec2").NetworkInterface class.
boto3 documentation
from mypy_boto3_ec2.service_resource import NetworkInterface
def get_resource() -> NetworkInterface:
return boto3.resource("ec2").NetworkInterface(...)
NetworkInterface attributes
association_attribute: NetworkInterfaceAssociationResponseMetadataTypeDefattachment: NetworkInterfaceAttachmentResponseMetadataTypeDefavailability_zone:strdescription:strgroups:List[GroupIdentifierTypeDef]interface_type: NetworkInterfaceTypeTypeipv6_addresses:List[NetworkInterfaceIpv6AddressTypeDef]mac_address:strnetwork_interface_id:stroutpost_arn:strowner_id:strprivate_dns_name:strprivate_ip_address:strprivate_ip_addresses:List[NetworkInterfacePrivateIpAddressTypeDef]ipv4_prefixes:List[Ipv4PrefixSpecificationTypeDef]ipv6_prefixes:List[Ipv6PrefixSpecificationTypeDef]requester_id:strrequester_managed:boolsource_dest_check:boolstatus: NetworkInterfaceStatusTypesubnet_id:strtag_set:List[TagTypeDef]vpc_id:strdeny_all_igw_traffic:boolipv6_native:boolipv6_address:strid:strassociation: NetworkInterfaceAssociationsubnet: Subnetvpc: Vpc
NetworkInterface methods
NetworkInterface.assign_private_ip_addresses method
Assigns one or more secondary private IP addresses to the specified network interface.
Type annotations and code completion for boto3.resource("ec2").assign_private_ip_addresses method.
boto3 documentation
def assign_private_ip_addresses(
self,
*,
AllowReassignment: bool = ...,
PrivateIpAddresses: Sequence[str] = ...,
SecondaryPrivateIpAddressCount: int = ...,
Ipv4Prefixes: Sequence[str] = ...,
Ipv4PrefixCount: int = ...,
) -> AssignPrivateIpAddressesResultTypeDef: # (1)
...
kwargs: AssignPrivateIpAddressesRequestNetworkInterfaceAssignPrivateIpAddressesTypeDef = { # (1)
"AllowReassignment": ...,
}
parent.assign_private_ip_addresses(**kwargs)
NetworkInterface.attach method
Attaches a network interface to an instance.
Type annotations and code completion for boto3.resource("ec2").attach method.
boto3 documentation
def attach(
self,
*,
DeviceIndex: int,
InstanceId: str,
DryRun: bool = ...,
NetworkCardIndex: int = ...,
EnaSrdSpecification: EnaSrdSpecificationTypeDef = ..., # (1)
) -> AttachNetworkInterfaceResultTypeDef: # (2)
...
kwargs: AttachNetworkInterfaceRequestNetworkInterfaceAttachTypeDef = { # (1)
"DeviceIndex": ...,
"InstanceId": ...,
}
parent.attach(**kwargs)
NetworkInterface.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestNetworkInterfaceCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
NetworkInterface.delete method
Deletes the specified network interface.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteNetworkInterfaceRequestNetworkInterfaceDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
NetworkInterface.describe_attribute method
Describes a network interface attribute.
Type annotations and code completion for boto3.resource("ec2").describe_attribute method.
boto3 documentation
def describe_attribute(
self,
*,
Attribute: NetworkInterfaceAttributeType = ..., # (1)
DryRun: bool = ...,
) -> DescribeNetworkInterfaceAttributeResultTypeDef: # (2)
...
kwargs: DescribeNetworkInterfaceAttributeRequestNetworkInterfaceDescribeAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.describe_attribute(**kwargs)
NetworkInterface.detach method
Detaches a network interface from an instance.
Type annotations and code completion for boto3.resource("ec2").detach method.
boto3 documentation
def detach(
self,
*,
AttachmentId: str,
DryRun: bool = ...,
Force: bool = ...,
) -> None:
...
kwargs: DetachNetworkInterfaceRequestNetworkInterfaceDetachTypeDef = { # (1)
"AttachmentId": ...,
}
parent.detach(**kwargs)
NetworkInterface.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
NetworkInterface.load method
Calls meth:
EC2.Client.describe_network_interfaces to update the attributes
of the NetworkInterface resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
NetworkInterface.modify_attribute method
Modifies the specified network interface attribute.
Type annotations and code completion for boto3.resource("ec2").modify_attribute method.
boto3 documentation
def modify_attribute(
self,
*,
Attachment: NetworkInterfaceAttachmentChangesTypeDef = ..., # (1)
Description: AttributeValueTypeDef = ..., # (2)
DryRun: bool = ...,
Groups: Sequence[str] = ...,
SourceDestCheck: AttributeBooleanValueTypeDef = ..., # (3)
EnaSrdSpecification: EnaSrdSpecificationTypeDef = ..., # (4)
) -> None:
...
- See NetworkInterfaceAttachmentChangesTypeDef
- See AttributeValueTypeDef
- See AttributeBooleanValueTypeDef
- See EnaSrdSpecificationTypeDef
kwargs: ModifyNetworkInterfaceAttributeRequestNetworkInterfaceModifyAttributeTypeDef = { # (1)
"Attachment": ...,
}
parent.modify_attribute(**kwargs)
NetworkInterface.reload method
Calls meth:
EC2.Client.describe_network_interfaces to update the attributes
of the NetworkInterface resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
NetworkInterface.reset_attribute method
Resets a network interface attribute.
Type annotations and code completion for boto3.resource("ec2").reset_attribute method.
boto3 documentation
def reset_attribute(
self,
*,
DryRun: bool = ...,
SourceDestCheck: str = ...,
) -> None:
...
kwargs: ResetNetworkInterfaceAttributeRequestNetworkInterfaceResetAttributeTypeDef = { # (1)
"DryRun": ...,
}
parent.reset_attribute(**kwargs)
NetworkInterface.unassign_private_ip_addresses method
Unassigns one or more secondary private IP addresses, or IPv4 Prefix Delegation prefixes from a network interface.
Type annotations and code completion for boto3.resource("ec2").unassign_private_ip_addresses method.
boto3 documentation
def unassign_private_ip_addresses(
self,
*,
PrivateIpAddresses: Sequence[str] = ...,
Ipv4Prefixes: Sequence[str] = ...,
) -> None:
...
kwargs: UnassignPrivateIpAddressesRequestNetworkInterfaceUnassignPrivateIpAddressesTypeDef = { # (1)
"PrivateIpAddresses": ...,
}
parent.unassign_private_ip_addresses(**kwargs)
NetworkInterfaceAssociation
Type annotations and code completion for boto3.resource("ec2").NetworkInterfaceAssociation class.
boto3 documentation
from mypy_boto3_ec2.service_resource import NetworkInterfaceAssociation
def get_resource() -> NetworkInterfaceAssociation:
return boto3.resource("ec2").NetworkInterfaceAssociation(...)
NetworkInterfaceAssociation attributes
carrier_ip:strcustomer_owned_ip:strip_owner_id:strpublic_dns_name:strpublic_ip:strid:straddress: VpcAddress
NetworkInterfaceAssociation methods
NetworkInterfaceAssociation.delete method
Disassociates an Elastic IP address from the instance or network interface it's associated with.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DisassociateAddressRequestNetworkInterfaceAssociationDeleteTypeDef = { # (1)
"PublicIp": ...,
}
parent.delete(**kwargs)
NetworkInterfaceAssociation.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
NetworkInterfaceAssociation.load method
Calls meth:
EC2.Client.describe_network_interfaces to update the attributes
of the NetworkInterfaceAssociation resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
NetworkInterfaceAssociation.reload method
Calls meth:
EC2.Client.describe_network_interfaces to update the attributes
of the NetworkInterfaceAssociation resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
PlacementGroup
Type annotations and code completion for boto3.resource("ec2").PlacementGroup class.
boto3 documentation
from mypy_boto3_ec2.service_resource import PlacementGroup
def get_resource() -> PlacementGroup:
return boto3.resource("ec2").PlacementGroup(...)
PlacementGroup attributes
group_name:strstate: PlacementGroupStateTypestrategy: PlacementStrategyTypepartition_count:intgroup_id:strtags:List[TagTypeDef]group_arn:strspread_level: SpreadLevelTypename:strinstances: PlacementGroupInstancesCollection
PlacementGroup collections
PlacementGroup.instances
Provides access to Instance resource.
Type annotations and code completion for boto3.resource("ec2").PlacementGroup(...).instances collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import PlacementGroupInstancesCollection
def get_collection() -> PlacementGroupInstancesCollection:
resource = boto3.resource("ec2").PlacementGroup(...)
return resource.instances
PlacementGroup methods
PlacementGroup.delete method
Deletes the specified placement group.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeletePlacementGroupRequestPlacementGroupDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
PlacementGroup.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
PlacementGroup.load method
Calls meth:
EC2.Client.describe_placement_groups to update the attributes
of the PlacementGroup resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
PlacementGroup.reload method
Calls meth:
EC2.Client.describe_placement_groups to update the attributes
of the PlacementGroup resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Route
Type annotations and code completion for boto3.resource("ec2").Route class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Route
def get_resource() -> Route:
return boto3.resource("ec2").Route(...)
Route attributes
destination_ipv6_cidr_block:strdestination_prefix_list_id:stregress_only_internet_gateway_id:strgateway_id:strinstance_id:strinstance_owner_id:strnat_gateway_id:strtransit_gateway_id:strlocal_gateway_id:strcarrier_gateway_id:strnetwork_interface_id:strorigin: RouteOriginTypestate: RouteStateTypevpc_peering_connection_id:strcore_network_arn:strroute_table_id:strdestination_cidr_block:str
Route methods
Route.RouteTable method
Creates a RouteTable resource.
Type annotations and code completion for boto3.resource("ec2").RouteTable method.
boto3 documentation
Route.delete method
Deletes the specified route from the specified route table.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
def delete(
self,
*,
DestinationIpv6CidrBlock: str = ...,
DestinationPrefixListId: str = ...,
DryRun: bool = ...,
) -> None:
...
kwargs: DeleteRouteRequestRouteDeleteTypeDef = { # (1)
"DestinationIpv6CidrBlock": ...,
}
parent.delete(**kwargs)
Route.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Route.replace method
Replaces an existing route within a route table in a VPC.
Type annotations and code completion for boto3.resource("ec2").replace method.
boto3 documentation
def replace(
self,
*,
DestinationIpv6CidrBlock: str = ...,
DestinationPrefixListId: str = ...,
DryRun: bool = ...,
VpcEndpointId: str = ...,
EgressOnlyInternetGatewayId: str = ...,
GatewayId: str = ...,
InstanceId: str = ...,
LocalTarget: bool = ...,
NatGatewayId: str = ...,
TransitGatewayId: str = ...,
LocalGatewayId: str = ...,
CarrierGatewayId: str = ...,
NetworkInterfaceId: str = ...,
VpcPeeringConnectionId: str = ...,
CoreNetworkArn: str = ...,
) -> None:
...
kwargs: ReplaceRouteRequestRouteReplaceTypeDef = { # (1)
"DestinationIpv6CidrBlock": ...,
}
parent.replace(**kwargs)
RouteTable
Type annotations and code completion for boto3.resource("ec2").RouteTable class.
boto3 documentation
from mypy_boto3_ec2.service_resource import RouteTable
def get_resource() -> RouteTable:
return boto3.resource("ec2").RouteTable(...)
RouteTable attributes
associations_attribute:List[RouteTableAssociationTypeDef]propagating_vgws:List[PropagatingVgwTypeDef]route_table_id:strroutes_attribute:List[RouteTypeDef]tags:List[TagTypeDef]vpc_id:strowner_id:strid:strassociations:List[RouteTableAssociation]routes:List[Route]vpc: Vpc
RouteTable methods
RouteTable.associate_with_subnet method
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.resource("ec2").associate_with_subnet method.
boto3 documentation
def associate_with_subnet(
self,
*,
DryRun: bool = ...,
SubnetId: str = ...,
GatewayId: str = ...,
) -> RouteTableAssociation:
...
kwargs: AssociateRouteTableRequestRouteTableAssociateWithSubnetTypeDef = { # (1)
"DryRun": ...,
}
parent.associate_with_subnet(**kwargs)
RouteTable.create_route method
Creates a route in a route table within a VPC.
Type annotations and code completion for boto3.resource("ec2").create_route method.
boto3 documentation
def create_route(
self,
*,
DestinationCidrBlock: str = ...,
DestinationIpv6CidrBlock: str = ...,
DestinationPrefixListId: str = ...,
DryRun: bool = ...,
VpcEndpointId: str = ...,
EgressOnlyInternetGatewayId: str = ...,
GatewayId: str = ...,
InstanceId: str = ...,
NatGatewayId: str = ...,
TransitGatewayId: str = ...,
LocalGatewayId: str = ...,
CarrierGatewayId: str = ...,
NetworkInterfaceId: str = ...,
VpcPeeringConnectionId: str = ...,
CoreNetworkArn: str = ...,
) -> Route:
...
kwargs: CreateRouteRequestRouteTableCreateRouteTypeDef = { # (1)
"DestinationCidrBlock": ...,
}
parent.create_route(**kwargs)
RouteTable.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestRouteTableCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
RouteTable.delete method
Deletes the specified route table.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteRouteTableRequestRouteTableDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
RouteTable.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
RouteTable.load method
Calls meth:
EC2.Client.describe_route_tables to update the attributes of
the RouteTable resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
RouteTable.reload method
Calls meth:
EC2.Client.describe_route_tables to update the attributes of
the RouteTable resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
RouteTableAssociation
Type annotations and code completion for boto3.resource("ec2").RouteTableAssociation class.
boto3 documentation
from mypy_boto3_ec2.service_resource import RouteTableAssociation
def get_resource() -> RouteTableAssociation:
return boto3.resource("ec2").RouteTableAssociation(...)
RouteTableAssociation attributes
main:boolroute_table_association_id:strroute_table_id:strsubnet_id:strgateway_id:strassociation_state: RouteTableAssociationStateResponseMetadataTypeDefid:strroute_table: RouteTablesubnet: Subnet
RouteTableAssociation methods
RouteTableAssociation.delete method
Disassociates a subnet or gateway from a route table.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DisassociateRouteTableRequestRouteTableAssociationDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
RouteTableAssociation.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
RouteTableAssociation.replace_subnet method
Changes the route table associated with a given subnet, internet gateway, or virtual private gateway in a VPC.
Type annotations and code completion for boto3.resource("ec2").replace_subnet method.
boto3 documentation
def replace_subnet(
self,
*,
RouteTableId: str,
DryRun: bool = ...,
) -> RouteTableAssociation:
...
kwargs: ReplaceRouteTableAssociationRequestRouteTableAssociationReplaceSubnetTypeDef = { # (1)
"RouteTableId": ...,
}
parent.replace_subnet(**kwargs)
SecurityGroup
Type annotations and code completion for boto3.resource("ec2").SecurityGroup class.
boto3 documentation
from mypy_boto3_ec2.service_resource import SecurityGroup
def get_resource() -> SecurityGroup:
return boto3.resource("ec2").SecurityGroup(...)
SecurityGroup attributes
description:strgroup_name:strip_permissions:List[IpPermissionTypeDef]owner_id:strgroup_id:strip_permissions_egress:List[IpPermissionTypeDef]tags:List[TagTypeDef]vpc_id:strid:str
SecurityGroup methods
SecurityGroup.authorize_egress method
Type annotations and code completion for boto3.resource("ec2").authorize_egress method.
boto3 documentation
def authorize_egress(
self,
*,
DryRun: bool = ...,
IpPermissions: Sequence[IpPermissionTypeDef] = ..., # (1)
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
CidrIp: str = ...,
FromPort: int = ...,
IpProtocol: str = ...,
ToPort: int = ...,
SourceSecurityGroupName: str = ...,
SourceSecurityGroupOwnerId: str = ...,
) -> AuthorizeSecurityGroupEgressResultTypeDef: # (3)
...
kwargs: AuthorizeSecurityGroupEgressRequestSecurityGroupAuthorizeEgressTypeDef = { # (1)
"DryRun": ...,
}
parent.authorize_egress(**kwargs)
SecurityGroup.authorize_ingress method
Adds the specified inbound (ingress) rules to a security group.
Type annotations and code completion for boto3.resource("ec2").authorize_ingress method.
boto3 documentation
def authorize_ingress(
self,
*,
CidrIp: str = ...,
FromPort: int = ...,
GroupName: str = ...,
IpPermissions: Sequence[IpPermissionTypeDef] = ..., # (1)
IpProtocol: str = ...,
SourceSecurityGroupName: str = ...,
SourceSecurityGroupOwnerId: str = ...,
ToPort: int = ...,
DryRun: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (2)
) -> AuthorizeSecurityGroupIngressResultTypeDef: # (3)
...
kwargs: AuthorizeSecurityGroupIngressRequestSecurityGroupAuthorizeIngressTypeDef = { # (1)
"CidrIp": ...,
}
parent.authorize_ingress(**kwargs)
SecurityGroup.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestSecurityGroupCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
SecurityGroup.delete method
Deletes a security group.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteSecurityGroupRequestSecurityGroupDeleteTypeDef = { # (1)
"GroupName": ...,
}
parent.delete(**kwargs)
SecurityGroup.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
SecurityGroup.load method
Calls meth:
EC2.Client.describe_security_groups to update the attributes of
the SecurityGroup resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
SecurityGroup.reload method
Calls meth:
EC2.Client.describe_security_groups to update the attributes of
the SecurityGroup resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
SecurityGroup.revoke_egress method
Type annotations and code completion for boto3.resource("ec2").revoke_egress method.
boto3 documentation
def revoke_egress(
self,
*,
DryRun: bool = ...,
IpPermissions: Sequence[IpPermissionTypeDef] = ..., # (1)
SecurityGroupRuleIds: Sequence[str] = ...,
CidrIp: str = ...,
FromPort: int = ...,
IpProtocol: str = ...,
ToPort: int = ...,
SourceSecurityGroupName: str = ...,
SourceSecurityGroupOwnerId: str = ...,
) -> RevokeSecurityGroupEgressResultTypeDef: # (2)
...
kwargs: RevokeSecurityGroupEgressRequestSecurityGroupRevokeEgressTypeDef = { # (1)
"DryRun": ...,
}
parent.revoke_egress(**kwargs)
SecurityGroup.revoke_ingress method
Removes the specified inbound (ingress) rules from a security group.
Type annotations and code completion for boto3.resource("ec2").revoke_ingress method.
boto3 documentation
def revoke_ingress(
self,
*,
CidrIp: str = ...,
FromPort: int = ...,
GroupName: str = ...,
IpPermissions: Sequence[IpPermissionTypeDef] = ..., # (1)
IpProtocol: str = ...,
SourceSecurityGroupName: str = ...,
SourceSecurityGroupOwnerId: str = ...,
ToPort: int = ...,
DryRun: bool = ...,
SecurityGroupRuleIds: Sequence[str] = ...,
) -> RevokeSecurityGroupIngressResultTypeDef: # (2)
...
kwargs: RevokeSecurityGroupIngressRequestSecurityGroupRevokeIngressTypeDef = { # (1)
"CidrIp": ...,
}
parent.revoke_ingress(**kwargs)
Snapshot
Type annotations and code completion for boto3.resource("ec2").Snapshot class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Snapshot
def get_resource() -> Snapshot:
return boto3.resource("ec2").Snapshot(...)
Snapshot attributes
data_encryption_key_id:strdescription:strencrypted:boolkms_key_id:strowner_id:strprogress:strsnapshot_id:strstart_time:datetimestate: SnapshotStateTypestate_message:strvolume_id:strvolume_size:intowner_alias:stroutpost_arn:strtags:List[TagTypeDef]storage_tier: StorageTierTyperestore_expiry_time:datetimeid:strvolume: Volume
Snapshot methods
Snapshot.copy method
Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3.
Type annotations and code completion for boto3.resource("ec2").copy method.
boto3 documentation
def copy(
self,
*,
SourceRegion: str,
Description: str = ...,
DestinationOutpostArn: str = ...,
DestinationRegion: str = ...,
Encrypted: bool = ...,
KmsKeyId: str = ...,
PresignedUrl: str = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
DryRun: bool = ...,
) -> CopySnapshotResultTypeDef: # (2)
...
kwargs: CopySnapshotRequestSnapshotCopyTypeDef = { # (1)
"SourceRegion": ...,
}
parent.copy(**kwargs)
Snapshot.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestSnapshotCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
Snapshot.delete method
Deletes the specified snapshot.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteSnapshotRequestSnapshotDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
Snapshot.describe_attribute method
Describes the specified attribute of the specified snapshot.
Type annotations and code completion for boto3.resource("ec2").describe_attribute method.
boto3 documentation
def describe_attribute(
self,
*,
Attribute: SnapshotAttributeNameType, # (1)
DryRun: bool = ...,
) -> DescribeSnapshotAttributeResultTypeDef: # (2)
...
kwargs: DescribeSnapshotAttributeRequestSnapshotDescribeAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.describe_attribute(**kwargs)
Snapshot.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Snapshot.load method
Calls meth:
EC2.Client.describe_snapshots to update the attributes of the
Snapshot resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
Snapshot.modify_attribute method
Adds or removes permission settings for the specified snapshot.
Type annotations and code completion for boto3.resource("ec2").modify_attribute method.
boto3 documentation
def modify_attribute(
self,
*,
Attribute: SnapshotAttributeNameType = ..., # (1)
CreateVolumePermission: CreateVolumePermissionModificationsTypeDef = ..., # (2)
GroupNames: Sequence[str] = ...,
OperationType: OperationTypeType = ..., # (3)
UserIds: Sequence[str] = ...,
DryRun: bool = ...,
) -> None:
...
kwargs: ModifySnapshotAttributeRequestSnapshotModifyAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.modify_attribute(**kwargs)
Snapshot.reload method
Calls meth:
EC2.Client.describe_snapshots to update the attributes of the
Snapshot resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Snapshot.reset_attribute method
Resets permission settings for the specified snapshot.
Type annotations and code completion for boto3.resource("ec2").reset_attribute method.
boto3 documentation
def reset_attribute(
self,
*,
Attribute: SnapshotAttributeNameType, # (1)
DryRun: bool = ...,
) -> None:
...
kwargs: ResetSnapshotAttributeRequestSnapshotResetAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.reset_attribute(**kwargs)
Snapshot.wait_until_completed method
Waits until this Snapshot is completed.
Type annotations and code completion for boto3.resource("ec2").wait_until_completed method.
boto3 documentation
Subnet
Type annotations and code completion for boto3.resource("ec2").Subnet class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Subnet
def get_resource() -> Subnet:
return boto3.resource("ec2").Subnet(...)
Subnet attributes
availability_zone:stravailability_zone_id:stravailable_ip_address_count:intcidr_block:strdefault_for_az:boolenable_lni_at_device_index:intmap_public_ip_on_launch:boolmap_customer_owned_ip_on_launch:boolcustomer_owned_ipv4_pool:strstate: SubnetStateTypesubnet_id:strvpc_id:strowner_id:strassign_ipv6_address_on_creation:boolipv6_cidr_block_association_set:List[SubnetIpv6CidrBlockAssociationTypeDef]tags:List[TagTypeDef]subnet_arn:stroutpost_arn:strenable_dns64:boolipv6_native:boolprivate_dns_name_options_on_launch: PrivateDnsNameOptionsOnLaunchResponseMetadataTypeDefid:strvpc: Vpcinstances: SubnetInstancesCollectionnetwork_interfaces: SubnetNetworkInterfacesCollection
Subnet collections
Subnet.instances
Provides access to Instance resource.
Type annotations and code completion for boto3.resource("ec2").Subnet(...).instances collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import SubnetInstancesCollection
def get_collection() -> SubnetInstancesCollection:
resource = boto3.resource("ec2").Subnet(...)
return resource.instances
Subnet.network_interfaces
Provides access to NetworkInterface resource.
Type annotations and code completion for boto3.resource("ec2").Subnet(...).network_interfaces collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import SubnetNetworkInterfacesCollection
def get_collection() -> SubnetNetworkInterfacesCollection:
resource = boto3.resource("ec2").Subnet(...)
return resource.network_interfaces
Subnet methods
Subnet.create_instances method
Launches the specified number of instances using an AMI for which you have permissions.
Type annotations and code completion for boto3.resource("ec2").create_instances method.
boto3 documentation
def create_instances(
self,
*,
MaxCount: int,
MinCount: int,
BlockDeviceMappings: Sequence[BlockDeviceMappingTypeDef] = ..., # (1)
ImageId: str = ...,
InstanceType: InstanceTypeType = ..., # (2)
Ipv6AddressCount: int = ...,
Ipv6Addresses: Sequence[InstanceIpv6AddressTypeDef] = ..., # (3)
KernelId: str = ...,
KeyName: str = ...,
Monitoring: RunInstancesMonitoringEnabledTypeDef = ..., # (4)
Placement: PlacementTypeDef = ..., # (5)
RamdiskId: str = ...,
SecurityGroupIds: Sequence[str] = ...,
SecurityGroups: Sequence[str] = ...,
UserData: str = ...,
AdditionalInfo: str = ...,
ClientToken: str = ...,
DisableApiTermination: bool = ...,
DryRun: bool = ...,
EbsOptimized: bool = ...,
IamInstanceProfile: IamInstanceProfileSpecificationTypeDef = ..., # (6)
InstanceInitiatedShutdownBehavior: ShutdownBehaviorType = ..., # (7)
NetworkInterfaces: Sequence[InstanceNetworkInterfaceSpecificationTypeDef] = ..., # (8)
PrivateIpAddress: str = ...,
ElasticGpuSpecification: Sequence[ElasticGpuSpecificationTypeDef] = ..., # (9)
ElasticInferenceAccelerators: Sequence[ElasticInferenceAcceleratorTypeDef] = ..., # (10)
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (11)
LaunchTemplate: LaunchTemplateSpecificationTypeDef = ..., # (12)
InstanceMarketOptions: InstanceMarketOptionsRequestTypeDef = ..., # (13)
CreditSpecification: CreditSpecificationRequestTypeDef = ..., # (14)
CpuOptions: CpuOptionsRequestTypeDef = ..., # (15)
CapacityReservationSpecification: CapacityReservationSpecificationTypeDef = ..., # (16)
HibernationOptions: HibernationOptionsRequestTypeDef = ..., # (17)
LicenseSpecifications: Sequence[LicenseConfigurationRequestTypeDef] = ..., # (18)
MetadataOptions: InstanceMetadataOptionsRequestTypeDef = ..., # (19)
EnclaveOptions: EnclaveOptionsRequestTypeDef = ..., # (20)
PrivateDnsNameOptions: PrivateDnsNameOptionsRequestTypeDef = ..., # (21)
MaintenanceOptions: InstanceMaintenanceOptionsRequestTypeDef = ..., # (22)
DisableApiStop: bool = ...,
) -> List[Instance]:
...
- See BlockDeviceMappingTypeDef
- See InstanceTypeType
- See InstanceIpv6AddressTypeDef
- See RunInstancesMonitoringEnabledTypeDef
- See PlacementTypeDef
- See IamInstanceProfileSpecificationTypeDef
- See ShutdownBehaviorType
- See InstanceNetworkInterfaceSpecificationTypeDef
- See ElasticGpuSpecificationTypeDef
- See ElasticInferenceAcceleratorTypeDef
- See TagSpecificationTypeDef
- See LaunchTemplateSpecificationTypeDef
- See InstanceMarketOptionsRequestTypeDef
- See CreditSpecificationRequestTypeDef
- See CpuOptionsRequestTypeDef
- See CapacityReservationSpecificationTypeDef
- See HibernationOptionsRequestTypeDef
- See LicenseConfigurationRequestTypeDef
- See InstanceMetadataOptionsRequestTypeDef
- See EnclaveOptionsRequestTypeDef
- See PrivateDnsNameOptionsRequestTypeDef
- See InstanceMaintenanceOptionsRequestTypeDef
kwargs: RunInstancesRequestSubnetCreateInstancesTypeDef = { # (1)
"MaxCount": ...,
"MinCount": ...,
}
parent.create_instances(**kwargs)
Subnet.create_network_interface method
Creates a network interface in the specified subnet.
Type annotations and code completion for boto3.resource("ec2").create_network_interface method.
boto3 documentation
def create_network_interface(
self,
*,
Description: str = ...,
DryRun: bool = ...,
Groups: Sequence[str] = ...,
Ipv6AddressCount: int = ...,
Ipv6Addresses: Sequence[InstanceIpv6AddressTypeDef] = ..., # (1)
PrivateIpAddress: str = ...,
PrivateIpAddresses: Sequence[PrivateIpAddressSpecificationTypeDef] = ..., # (2)
SecondaryPrivateIpAddressCount: int = ...,
Ipv4Prefixes: Sequence[Ipv4PrefixSpecificationRequestTypeDef] = ..., # (3)
Ipv4PrefixCount: int = ...,
Ipv6Prefixes: Sequence[Ipv6PrefixSpecificationRequestTypeDef] = ..., # (4)
Ipv6PrefixCount: int = ...,
InterfaceType: NetworkInterfaceCreationTypeType = ..., # (5)
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (6)
ClientToken: str = ...,
) -> NetworkInterface:
...
- See InstanceIpv6AddressTypeDef
- See PrivateIpAddressSpecificationTypeDef
- See Ipv4PrefixSpecificationRequestTypeDef
- See Ipv6PrefixSpecificationRequestTypeDef
- See NetworkInterfaceCreationTypeType
- See TagSpecificationTypeDef
kwargs: CreateNetworkInterfaceRequestSubnetCreateNetworkInterfaceTypeDef = { # (1)
"Description": ...,
}
parent.create_network_interface(**kwargs)
Subnet.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestSubnetCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
Subnet.delete method
Deletes the specified subnet.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteSubnetRequestSubnetDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
Subnet.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Subnet.load method
Calls meth:
EC2.Client.describe_subnets to update the attributes of the
Subnet resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
Subnet.reload method
Calls meth:
EC2.Client.describe_subnets to update the attributes of the
Subnet resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Tag
Type annotations and code completion for boto3.resource("ec2").Tag class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Tag
def get_resource() -> Tag:
return boto3.resource("ec2").Tag(...)
Tag attributes
resource_type: ResourceTypeTyperesource_id:strkey:strvalue:str
Tag methods
Tag.delete method
Deletes the specified set of tags from the specified set of resources.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteTagsRequestTagDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
Tag.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Tag.load method
Calls meth:
EC2.Client.describe_tags to update the attributes of the Tag
resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
Tag.reload method
Calls meth:
EC2.Client.describe_tags to update the attributes of the Tag
resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Volume
Type annotations and code completion for boto3.resource("ec2").Volume class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Volume
def get_resource() -> Volume:
return boto3.resource("ec2").Volume(...)
Volume attributes
attachments:List[VolumeAttachmentTypeDef]availability_zone:strcreate_time:datetimeencrypted:boolkms_key_id:stroutpost_arn:strsize:intsnapshot_id:strstate: VolumeStateTypevolume_id:striops:inttags:List[TagTypeDef]volume_type: VolumeTypeTypefast_restored:boolmulti_attach_enabled:boolthroughput:intid:strsnapshots: VolumeSnapshotsCollection
Volume collections
Volume.snapshots
Provides access to Snapshot resource.
Type annotations and code completion for boto3.resource("ec2").Volume(...).snapshots collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VolumeSnapshotsCollection
def get_collection() -> VolumeSnapshotsCollection:
resource = boto3.resource("ec2").Volume(...)
return resource.snapshots
Volume methods
Volume.attach_to_instance method
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.resource("ec2").attach_to_instance method.
boto3 documentation
def attach_to_instance(
self,
*,
Device: str,
InstanceId: str,
DryRun: bool = ...,
) -> VolumeAttachmentResponseMetadataTypeDef: # (1)
...
kwargs: AttachVolumeRequestVolumeAttachToInstanceTypeDef = { # (1)
"Device": ...,
"InstanceId": ...,
}
parent.attach_to_instance(**kwargs)
Volume.create_snapshot method
Creates a snapshot of an EBS volume and stores it in Amazon S3.
Type annotations and code completion for boto3.resource("ec2").create_snapshot method.
boto3 documentation
def create_snapshot(
self,
*,
Description: str = ...,
OutpostArn: str = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
DryRun: bool = ...,
) -> Snapshot:
...
kwargs: CreateSnapshotRequestVolumeCreateSnapshotTypeDef = { # (1)
"Description": ...,
}
parent.create_snapshot(**kwargs)
Volume.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestVolumeCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
Volume.delete method
Deletes the specified EBS volume.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteVolumeRequestVolumeDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
Volume.describe_attribute method
Describes the specified attribute of the specified volume.
Type annotations and code completion for boto3.resource("ec2").describe_attribute method.
boto3 documentation
def describe_attribute(
self,
*,
Attribute: VolumeAttributeNameType, # (1)
DryRun: bool = ...,
) -> DescribeVolumeAttributeResultTypeDef: # (2)
...
kwargs: DescribeVolumeAttributeRequestVolumeDescribeAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.describe_attribute(**kwargs)
Volume.describe_status method
Describes the status of the specified volumes.
Type annotations and code completion for boto3.resource("ec2").describe_status method.
boto3 documentation
def describe_status(
self,
*,
Filters: Sequence[FilterTypeDef] = ..., # (1)
MaxResults: int = ...,
NextToken: str = ...,
DryRun: bool = ...,
) -> DescribeVolumeStatusResultTypeDef: # (2)
...
kwargs: DescribeVolumeStatusRequestVolumeDescribeStatusTypeDef = { # (1)
"Filters": ...,
}
parent.describe_status(**kwargs)
Volume.detach_from_instance method
Detaches an EBS volume from an instance.
Type annotations and code completion for boto3.resource("ec2").detach_from_instance method.
boto3 documentation
def detach_from_instance(
self,
*,
Device: str = ...,
Force: bool = ...,
InstanceId: str = ...,
DryRun: bool = ...,
) -> VolumeAttachmentResponseMetadataTypeDef: # (1)
...
kwargs: DetachVolumeRequestVolumeDetachFromInstanceTypeDef = { # (1)
"Device": ...,
}
parent.detach_from_instance(**kwargs)
Volume.enable_io method
Enables I/O operations for a volume that had I/O operations disabled because the data on the volume was potentially inconsistent.
Type annotations and code completion for boto3.resource("ec2").enable_io method.
boto3 documentation
kwargs: EnableVolumeIORequestVolumeEnableIoTypeDef = { # (1)
"DryRun": ...,
}
parent.enable_io(**kwargs)
Volume.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Volume.load method
Calls meth:
EC2.Client.describe_volumes to update the attributes of the
Volume resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
Volume.modify_attribute method
Modifies a volume attribute.
Type annotations and code completion for boto3.resource("ec2").modify_attribute method.
boto3 documentation
def modify_attribute(
self,
*,
AutoEnableIO: AttributeBooleanValueTypeDef = ..., # (1)
DryRun: bool = ...,
) -> None:
...
kwargs: ModifyVolumeAttributeRequestVolumeModifyAttributeTypeDef = { # (1)
"AutoEnableIO": ...,
}
parent.modify_attribute(**kwargs)
Volume.reload method
Calls meth:
EC2.Client.describe_volumes to update the attributes of the
Volume resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Vpc
Type annotations and code completion for boto3.resource("ec2").Vpc class.
boto3 documentation
from mypy_boto3_ec2.service_resource import Vpc
def get_resource() -> Vpc:
return boto3.resource("ec2").Vpc(...)
Vpc attributes
cidr_block:strdhcp_options_id:strstate: VpcStateTypevpc_id:strowner_id:strinstance_tenancy: TenancyTypeipv6_cidr_block_association_set:List[VpcIpv6CidrBlockAssociationTypeDef]cidr_block_association_set:List[VpcCidrBlockAssociationTypeDef]is_default:booltags:List[TagTypeDef]id:strdhcp_options: DhcpOptionsaccepted_vpc_peering_connections: VpcAcceptedVpcPeeringConnectionsCollectioninstances: VpcInstancesCollectioninternet_gateways: VpcInternetGatewaysCollectionnetwork_acls: VpcNetworkAclsCollectionnetwork_interfaces: VpcNetworkInterfacesCollectionrequested_vpc_peering_connections: VpcRequestedVpcPeeringConnectionsCollectionroute_tables: VpcRouteTablesCollectionsecurity_groups: VpcSecurityGroupsCollectionsubnets: VpcSubnetsCollection
Vpc collections
Vpc.accepted_vpc_peering_connections
Provides access to VpcPeeringConnection resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).accepted_vpc_peering_connections collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcAcceptedVpcPeeringConnectionsCollection
def get_collection() -> VpcAcceptedVpcPeeringConnectionsCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.accepted_vpc_peering_connections
Vpc.instances
Provides access to Instance resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).instances collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcInstancesCollection
def get_collection() -> VpcInstancesCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.instances
Vpc.internet_gateways
Provides access to InternetGateway resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).internet_gateways collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcInternetGatewaysCollection
def get_collection() -> VpcInternetGatewaysCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.internet_gateways
Vpc.network_acls
Provides access to NetworkAcl resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).network_acls collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcNetworkAclsCollection
def get_collection() -> VpcNetworkAclsCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.network_acls
Vpc.network_interfaces
Provides access to NetworkInterface resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).network_interfaces collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcNetworkInterfacesCollection
def get_collection() -> VpcNetworkInterfacesCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.network_interfaces
Vpc.requested_vpc_peering_connections
Provides access to VpcPeeringConnection resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).requested_vpc_peering_connections collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcRequestedVpcPeeringConnectionsCollection
def get_collection() -> VpcRequestedVpcPeeringConnectionsCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.requested_vpc_peering_connections
Vpc.route_tables
Provides access to RouteTable resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).route_tables collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcRouteTablesCollection
def get_collection() -> VpcRouteTablesCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.route_tables
Vpc.security_groups
Provides access to SecurityGroup resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).security_groups collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcSecurityGroupsCollection
def get_collection() -> VpcSecurityGroupsCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.security_groups
Vpc.subnets
Provides access to Subnet resource.
Type annotations and code completion for boto3.resource("ec2").Vpc(...).subnets collection.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcSubnetsCollection
def get_collection() -> VpcSubnetsCollection:
resource = boto3.resource("ec2").Vpc(...)
return resource.subnets
Vpc methods
Vpc.associate_dhcp_options method
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.resource("ec2").associate_dhcp_options method.
boto3 documentation
def associate_dhcp_options(
self,
*,
DhcpOptionsId: str,
DryRun: bool = ...,
) -> None:
...
kwargs: AssociateDhcpOptionsRequestVpcAssociateDhcpOptionsTypeDef = { # (1)
"DhcpOptionsId": ...,
}
parent.associate_dhcp_options(**kwargs)
Vpc.attach_classic_link_instance method
.
Type annotations and code completion for boto3.resource("ec2").attach_classic_link_instance method.
boto3 documentation
def attach_classic_link_instance(
self,
*,
Groups: Sequence[str],
InstanceId: str,
DryRun: bool = ...,
) -> AttachClassicLinkVpcResultTypeDef: # (1)
...
kwargs: AttachClassicLinkVpcRequestVpcAttachClassicLinkInstanceTypeDef = { # (1)
"Groups": ...,
"InstanceId": ...,
}
parent.attach_classic_link_instance(**kwargs)
Vpc.attach_internet_gateway method
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.resource("ec2").attach_internet_gateway method.
boto3 documentation
def attach_internet_gateway(
self,
*,
InternetGatewayId: str,
DryRun: bool = ...,
) -> None:
...
kwargs: AttachInternetGatewayRequestVpcAttachInternetGatewayTypeDef = { # (1)
"InternetGatewayId": ...,
}
parent.attach_internet_gateway(**kwargs)
Vpc.create_network_acl method
Creates a network ACL in a VPC.
Type annotations and code completion for boto3.resource("ec2").create_network_acl method.
boto3 documentation
def create_network_acl(
self,
*,
DryRun: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
) -> NetworkAcl:
...
kwargs: CreateNetworkAclRequestVpcCreateNetworkAclTypeDef = { # (1)
"DryRun": ...,
}
parent.create_network_acl(**kwargs)
Vpc.create_route_table method
Creates a route table for the specified VPC.
Type annotations and code completion for boto3.resource("ec2").create_route_table method.
boto3 documentation
def create_route_table(
self,
*,
DryRun: bool = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
) -> RouteTable:
...
kwargs: CreateRouteTableRequestVpcCreateRouteTableTypeDef = { # (1)
"DryRun": ...,
}
parent.create_route_table(**kwargs)
Vpc.create_security_group method
Creates a security group.
Type annotations and code completion for boto3.resource("ec2").create_security_group method.
boto3 documentation
def create_security_group(
self,
*,
Description: str,
GroupName: str,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
DryRun: bool = ...,
) -> SecurityGroup:
...
kwargs: CreateSecurityGroupRequestVpcCreateSecurityGroupTypeDef = { # (1)
"Description": ...,
"GroupName": ...,
}
parent.create_security_group(**kwargs)
Vpc.create_subnet method
Creates a subnet in the specified VPC.
Type annotations and code completion for boto3.resource("ec2").create_subnet method.
boto3 documentation
def create_subnet(
self,
*,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
AvailabilityZone: str = ...,
AvailabilityZoneId: str = ...,
CidrBlock: str = ...,
Ipv6CidrBlock: str = ...,
OutpostArn: str = ...,
DryRun: bool = ...,
Ipv6Native: bool = ...,
) -> Subnet:
...
kwargs: CreateSubnetRequestVpcCreateSubnetTypeDef = { # (1)
"TagSpecifications": ...,
}
parent.create_subnet(**kwargs)
Vpc.create_tags method
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources.
Type annotations and code completion for boto3.resource("ec2").create_tags method.
boto3 documentation
def create_tags(
self,
*,
Tags: Optional[Sequence[TagTypeDef]], # (1)
DryRun: bool = ...,
) -> Tag:
...
- See TagTypeDef
kwargs: CreateTagsRequestVpcCreateTagsTypeDef = { # (1)
"Tags": ...,
}
parent.create_tags(**kwargs)
Vpc.delete method
Deletes the specified VPC.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
kwargs: DeleteVpcRequestVpcDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
Vpc.describe_attribute method
Describes the specified attribute of the specified VPC.
Type annotations and code completion for boto3.resource("ec2").describe_attribute method.
boto3 documentation
def describe_attribute(
self,
*,
Attribute: VpcAttributeNameType, # (1)
DryRun: bool = ...,
) -> DescribeVpcAttributeResultTypeDef: # (2)
...
kwargs: DescribeVpcAttributeRequestVpcDescribeAttributeTypeDef = { # (1)
"Attribute": ...,
}
parent.describe_attribute(**kwargs)
Vpc.detach_classic_link_instance method
.
Type annotations and code completion for boto3.resource("ec2").detach_classic_link_instance method.
boto3 documentation
def detach_classic_link_instance(
self,
*,
InstanceId: str,
DryRun: bool = ...,
) -> DetachClassicLinkVpcResultTypeDef: # (1)
...
kwargs: DetachClassicLinkVpcRequestVpcDetachClassicLinkInstanceTypeDef = { # (1)
"InstanceId": ...,
}
parent.detach_classic_link_instance(**kwargs)
Vpc.detach_internet_gateway method
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC.
Type annotations and code completion for boto3.resource("ec2").detach_internet_gateway method.
boto3 documentation
def detach_internet_gateway(
self,
*,
InternetGatewayId: str,
DryRun: bool = ...,
) -> None:
...
kwargs: DetachInternetGatewayRequestVpcDetachInternetGatewayTypeDef = { # (1)
"InternetGatewayId": ...,
}
parent.detach_internet_gateway(**kwargs)
Vpc.disable_classic_link method
Disables ClassicLink for a VPC.
Type annotations and code completion for boto3.resource("ec2").disable_classic_link method.
boto3 documentation
def disable_classic_link(
self,
*,
DryRun: bool = ...,
) -> DisableVpcClassicLinkResultTypeDef: # (1)
...
kwargs: DisableVpcClassicLinkRequestVpcDisableClassicLinkTypeDef = { # (1)
"DryRun": ...,
}
parent.disable_classic_link(**kwargs)
Vpc.enable_classic_link method
.
Type annotations and code completion for boto3.resource("ec2").enable_classic_link method.
boto3 documentation
def enable_classic_link(
self,
*,
DryRun: bool = ...,
) -> EnableVpcClassicLinkResultTypeDef: # (1)
...
kwargs: EnableVpcClassicLinkRequestVpcEnableClassicLinkTypeDef = { # (1)
"DryRun": ...,
}
parent.enable_classic_link(**kwargs)
Vpc.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
Vpc.load method
Calls meth:
EC2.Client.describe_vpcs to update the attributes of the Vpc
resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
Vpc.modify_attribute method
Modifies the specified attribute of the specified VPC.
Type annotations and code completion for boto3.resource("ec2").modify_attribute method.
boto3 documentation
def modify_attribute(
self,
*,
EnableDnsHostnames: AttributeBooleanValueTypeDef = ..., # (1)
EnableDnsSupport: AttributeBooleanValueTypeDef = ..., # (1)
EnableNetworkAddressUsageMetrics: AttributeBooleanValueTypeDef = ..., # (1)
) -> None:
...
kwargs: ModifyVpcAttributeRequestVpcModifyAttributeTypeDef = { # (1)
"EnableDnsHostnames": ...,
}
parent.modify_attribute(**kwargs)
Vpc.reload method
Calls meth:
EC2.Client.describe_vpcs to update the attributes of the Vpc
resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
Vpc.request_vpc_peering_connection method
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection.
Type annotations and code completion for boto3.resource("ec2").request_vpc_peering_connection method.
boto3 documentation
def request_vpc_peering_connection(
self,
*,
DryRun: bool = ...,
PeerOwnerId: str = ...,
PeerVpcId: str = ...,
PeerRegion: str = ...,
TagSpecifications: Sequence[TagSpecificationTypeDef] = ..., # (1)
) -> VpcPeeringConnection:
...
kwargs: CreateVpcPeeringConnectionRequestVpcRequestVpcPeeringConnectionTypeDef = { # (1)
"DryRun": ...,
}
parent.request_vpc_peering_connection(**kwargs)
Vpc.wait_until_available method
Waits until this Vpc is available.
Type annotations and code completion for boto3.resource("ec2").wait_until_available method.
boto3 documentation
Vpc.wait_until_exists method
Waits until this Vpc is exists.
Type annotations and code completion for boto3.resource("ec2").wait_until_exists method.
boto3 documentation
VpcPeeringConnection
Type annotations and code completion for boto3.resource("ec2").VpcPeeringConnection class.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcPeeringConnection
def get_resource() -> VpcPeeringConnection:
return boto3.resource("ec2").VpcPeeringConnection(...)
VpcPeeringConnection attributes
accepter_vpc_info: VpcPeeringConnectionVpcInfoResponseMetadataTypeDefexpiration_time:datetimerequester_vpc_info: VpcPeeringConnectionVpcInfoResponseMetadataTypeDefstatus: VpcPeeringConnectionStateReasonResponseMetadataTypeDeftags:List[TagTypeDef]vpc_peering_connection_id:strid:straccepter_vpc: Vpcrequester_vpc: Vpc
VpcPeeringConnection methods
VpcPeeringConnection.accept method
Accept a VPC peering connection request.
Type annotations and code completion for boto3.resource("ec2").accept method.
boto3 documentation
def accept(
self,
*,
DryRun: bool = ...,
) -> AcceptVpcPeeringConnectionResultTypeDef: # (1)
...
kwargs: AcceptVpcPeeringConnectionRequestVpcPeeringConnectionAcceptTypeDef = { # (1)
"DryRun": ...,
}
parent.accept(**kwargs)
VpcPeeringConnection.delete method
Deletes a VPC peering connection.
Type annotations and code completion for boto3.resource("ec2").delete method.
boto3 documentation
def delete(
self,
*,
DryRun: bool = ...,
) -> DeleteVpcPeeringConnectionResultTypeDef: # (1)
...
kwargs: DeleteVpcPeeringConnectionRequestVpcPeeringConnectionDeleteTypeDef = { # (1)
"DryRun": ...,
}
parent.delete(**kwargs)
VpcPeeringConnection.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
VpcPeeringConnection.load method
Calls meth:
EC2.Client.describe_vpc_peering_connections to update the
attributes of the VpcPeeringConnection resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
VpcPeeringConnection.reject method
Rejects a VPC peering connection request.
Type annotations and code completion for boto3.resource("ec2").reject method.
boto3 documentation
def reject(
self,
*,
DryRun: bool = ...,
) -> RejectVpcPeeringConnectionResultTypeDef: # (1)
...
kwargs: RejectVpcPeeringConnectionRequestVpcPeeringConnectionRejectTypeDef = { # (1)
"DryRun": ...,
}
parent.reject(**kwargs)
VpcPeeringConnection.reload method
Calls meth:
EC2.Client.describe_vpc_peering_connections to update the
attributes of the VpcPeeringConnection resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation
VpcPeeringConnection.wait_until_exists method
Waits until this VpcPeeringConnection is exists.
Type annotations and code completion for boto3.resource("ec2").wait_until_exists method.
boto3 documentation
VpcAddress
Type annotations and code completion for boto3.resource("ec2").VpcAddress class.
boto3 documentation
from mypy_boto3_ec2.service_resource import VpcAddress
def get_resource() -> VpcAddress:
return boto3.resource("ec2").VpcAddress(...)
VpcAddress attributes
instance_id:strpublic_ip:strassociation_id:strdomain: DomainTypeTypenetwork_interface_id:strnetwork_interface_owner_id:strprivate_ip_address:strtags:List[TagTypeDef]public_ipv4_pool:strnetwork_border_group:strcustomer_owned_ip:strcustomer_owned_ipv4_pool:strcarrier_ip:strallocation_id:strassociation: NetworkInterfaceAssociation
VpcAddress methods
VpcAddress.associate method
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.resource("ec2").associate method.
boto3 documentation
def associate(
self,
*,
InstanceId: str = ...,
PublicIp: str = ...,
AllowReassociation: bool = ...,
DryRun: bool = ...,
NetworkInterfaceId: str = ...,
PrivateIpAddress: str = ...,
) -> AssociateAddressResultTypeDef: # (1)
...
kwargs: AssociateAddressRequestVpcAddressAssociateTypeDef = { # (1)
"InstanceId": ...,
}
parent.associate(**kwargs)
VpcAddress.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("ec2").get_available_subresources method.
boto3 documentation
VpcAddress.load method
Calls meth:
EC2.Client.describe_addresses to update the attributes of the
VpcAddress resource.
Type annotations and code completion for boto3.resource("ec2").load method.
boto3 documentation
VpcAddress.release method
Releases the specified Elastic IP address.
Type annotations and code completion for boto3.resource("ec2").release method.
boto3 documentation
def release(
self,
*,
AllocationId: str = ...,
PublicIp: str = ...,
NetworkBorderGroup: str = ...,
DryRun: bool = ...,
) -> None:
...
kwargs: ReleaseAddressRequestVpcAddressReleaseTypeDef = { # (1)
"AllocationId": ...,
}
parent.release(**kwargs)
VpcAddress.reload method
Calls meth:
EC2.Client.describe_addresses to update the attributes of the
VpcAddress resource.
Type annotations and code completion for boto3.resource("ec2").reload method.
boto3 documentation