Skip to content

EC2ServiceResource

Index > EC2 > 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

Usage example
from mypy_boto3_ec2.service_resource import EC2ServiceResource

def get_ec2_resource() -> EC2ServiceResource:
    return boto3.resource("ec2")

Attributes

Collections

ServiceResourceClassicAddressesCollection

Provides access to ClassicAddress resource.

Type annotations and code completion for boto3.resource("ec2").classic_addresses collection. boto3 documentation

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Usage example
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

Method definition
def ClassicAddress(
    self,
    public_ip: str,
) -> ClassicAddress:
    ...
Usage example with kwargs
kwargs: ServiceResourceClassicAddressRequestTypeDef = {  # (1)
    "public_ip": ...,
}

parent.ClassicAddress(**kwargs)
  1. See ServiceResourceClassicAddressRequestTypeDef

EC2ServiceResource.DhcpOptions method

Creates a DhcpOptions resource.

Type annotations and code completion for boto3.resource("ec2").DhcpOptions method. boto3 documentation

Method definition
def DhcpOptions(
    self,
    id: str,
) -> DhcpOptions:
    ...
Usage example with kwargs
kwargs: ServiceResourceDhcpOptionsRequestTypeDef = {  # (1)
    "id": ...,
}

parent.DhcpOptions(**kwargs)
  1. See ServiceResourceDhcpOptionsRequestTypeDef

EC2ServiceResource.Image method

Creates a Image resource.

Type annotations and code completion for boto3.resource("ec2").Image method. boto3 documentation

Method definition
def Image(
    self,
    id: str,
) -> Image:
    ...
Usage example with kwargs
kwargs: ServiceResourceImageRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Image(**kwargs)
  1. See ServiceResourceImageRequestTypeDef

EC2ServiceResource.Instance method

Creates a Instance resource.

Type annotations and code completion for boto3.resource("ec2").Instance method. boto3 documentation

Method definition
def Instance(
    self,
    id: str,
) -> Instance:
    ...
Usage example with kwargs
kwargs: ServiceResourceInstanceRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Instance(**kwargs)
  1. See ServiceResourceInstanceRequestTypeDef

EC2ServiceResource.InternetGateway method

Creates a InternetGateway resource.

Type annotations and code completion for boto3.resource("ec2").InternetGateway method. boto3 documentation

Method definition
def InternetGateway(
    self,
    id: str,
) -> InternetGateway:
    ...
Usage example with kwargs
kwargs: ServiceResourceInternetGatewayRequestTypeDef = {  # (1)
    "id": ...,
}

parent.InternetGateway(**kwargs)
  1. See ServiceResourceInternetGatewayRequestTypeDef

EC2ServiceResource.KeyPair method

Creates a KeyPairInfo resource.

Type annotations and code completion for boto3.resource("ec2").KeyPair method. boto3 documentation

Method definition
def KeyPair(
    self,
    name: str,
) -> KeyPairInfo:
    ...
Usage example with kwargs
kwargs: ServiceResourceKeyPairRequestTypeDef = {  # (1)
    "name": ...,
}

parent.KeyPair(**kwargs)
  1. See ServiceResourceKeyPairRequestTypeDef

EC2ServiceResource.NetworkAcl method

Creates a NetworkAcl resource.

Type annotations and code completion for boto3.resource("ec2").NetworkAcl method. boto3 documentation

Method definition
def NetworkAcl(
    self,
    id: str,
) -> NetworkAcl:
    ...
Usage example with kwargs
kwargs: ServiceResourceNetworkAclRequestTypeDef = {  # (1)
    "id": ...,
}

parent.NetworkAcl(**kwargs)
  1. See ServiceResourceNetworkAclRequestTypeDef

EC2ServiceResource.NetworkInterface method

Creates a NetworkInterface resource.

Type annotations and code completion for boto3.resource("ec2").NetworkInterface method. boto3 documentation

Method definition
def NetworkInterface(
    self,
    id: str,
) -> NetworkInterface:
    ...
Usage example with kwargs
kwargs: ServiceResourceNetworkInterfaceRequestTypeDef = {  # (1)
    "id": ...,
}

parent.NetworkInterface(**kwargs)
  1. See ServiceResourceNetworkInterfaceRequestTypeDef

EC2ServiceResource.NetworkInterfaceAssociation method

Creates a NetworkInterfaceAssociation resource.

Type annotations and code completion for boto3.resource("ec2").NetworkInterfaceAssociation method. boto3 documentation

Method definition
def NetworkInterfaceAssociation(
    self,
    id: str,
) -> NetworkInterfaceAssociation:
    ...
Usage example with kwargs
kwargs: ServiceResourceNetworkInterfaceAssociationRequestTypeDef = {  # (1)
    "id": ...,
}

parent.NetworkInterfaceAssociation(**kwargs)
  1. See ServiceResourceNetworkInterfaceAssociationRequestTypeDef

EC2ServiceResource.PlacementGroup method

Creates a PlacementGroup resource.

Type annotations and code completion for boto3.resource("ec2").PlacementGroup method. boto3 documentation

Method definition
def PlacementGroup(
    self,
    name: str,
) -> PlacementGroup:
    ...
Usage example with kwargs
kwargs: ServiceResourcePlacementGroupRequestTypeDef = {  # (1)
    "name": ...,
}

parent.PlacementGroup(**kwargs)
  1. See ServiceResourcePlacementGroupRequestTypeDef

EC2ServiceResource.Route method

Creates a Route resource.

Type annotations and code completion for boto3.resource("ec2").Route method. boto3 documentation

Method definition
def Route(
    self,
    route_table_id: str,
    destination_cidr_block: str,
) -> Route:
    ...
Usage example with kwargs
kwargs: ServiceResourceRouteRequestTypeDef = {  # (1)
    "route_table_id": ...,
    "destination_cidr_block": ...,
}

parent.Route(**kwargs)
  1. See ServiceResourceRouteRequestTypeDef

EC2ServiceResource.RouteTable method

Creates a RouteTable resource.

Type annotations and code completion for boto3.resource("ec2").RouteTable method. boto3 documentation

Method definition
def RouteTable(
    self,
    id: str,
) -> RouteTable:
    ...
Usage example with kwargs
kwargs: ServiceResourceRouteTableRequestTypeDef = {  # (1)
    "id": ...,
}

parent.RouteTable(**kwargs)
  1. See ServiceResourceRouteTableRequestTypeDef

EC2ServiceResource.RouteTableAssociation method

Creates a RouteTableAssociation resource.

Type annotations and code completion for boto3.resource("ec2").RouteTableAssociation method. boto3 documentation

Method definition
def RouteTableAssociation(
    self,
    id: str,
) -> RouteTableAssociation:
    ...
Usage example with kwargs
kwargs: ServiceResourceRouteTableAssociationRequestTypeDef = {  # (1)
    "id": ...,
}

parent.RouteTableAssociation(**kwargs)
  1. See ServiceResourceRouteTableAssociationRequestTypeDef

EC2ServiceResource.SecurityGroup method

Creates a SecurityGroup resource.

Type annotations and code completion for boto3.resource("ec2").SecurityGroup method. boto3 documentation

Method definition
def SecurityGroup(
    self,
    id: str,
) -> SecurityGroup:
    ...
Usage example with kwargs
kwargs: ServiceResourceSecurityGroupRequestTypeDef = {  # (1)
    "id": ...,
}

parent.SecurityGroup(**kwargs)
  1. See ServiceResourceSecurityGroupRequestTypeDef

EC2ServiceResource.Snapshot method

Creates a Snapshot resource.

Type annotations and code completion for boto3.resource("ec2").Snapshot method. boto3 documentation

Method definition
def Snapshot(
    self,
    id: str,
) -> Snapshot:
    ...
Usage example with kwargs
kwargs: ServiceResourceSnapshotRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Snapshot(**kwargs)
  1. See ServiceResourceSnapshotRequestTypeDef

EC2ServiceResource.Subnet method

Creates a Subnet resource.

Type annotations and code completion for boto3.resource("ec2").Subnet method. boto3 documentation

Method definition
def Subnet(
    self,
    id: str,
) -> Subnet:
    ...
Usage example with kwargs
kwargs: ServiceResourceSubnetRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Subnet(**kwargs)
  1. See ServiceResourceSubnetRequestTypeDef

EC2ServiceResource.Tag method

Creates a Tag resource.

Type annotations and code completion for boto3.resource("ec2").Tag method. boto3 documentation

Method definition
def Tag(
    self,
    resource_id: str,
    key: str,
    value: str,
) -> Tag:
    ...
Usage example with kwargs
kwargs: ServiceResourceTagRequestTypeDef = {  # (1)
    "resource_id": ...,
    "key": ...,
    "value": ...,
}

parent.Tag(**kwargs)
  1. See ServiceResourceTagRequestTypeDef

EC2ServiceResource.Volume method

Creates a Volume resource.

Type annotations and code completion for boto3.resource("ec2").Volume method. boto3 documentation

Method definition
def Volume(
    self,
    id: str,
) -> Volume:
    ...
Usage example with kwargs
kwargs: ServiceResourceVolumeRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Volume(**kwargs)
  1. See ServiceResourceVolumeRequestTypeDef

EC2ServiceResource.Vpc method

Creates a Vpc resource.

Type annotations and code completion for boto3.resource("ec2").Vpc method. boto3 documentation

Method definition
def Vpc(
    self,
    id: str,
) -> Vpc:
    ...
Usage example with kwargs
kwargs: ServiceResourceVpcRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Vpc(**kwargs)
  1. See ServiceResourceVpcRequestTypeDef

EC2ServiceResource.VpcAddress method

Creates a VpcAddress resource.

Type annotations and code completion for boto3.resource("ec2").VpcAddress method. boto3 documentation

Method definition
def VpcAddress(
    self,
    allocation_id: str,
) -> VpcAddress:
    ...
Usage example with kwargs
kwargs: ServiceResourceVpcAddressRequestTypeDef = {  # (1)
    "allocation_id": ...,
}

parent.VpcAddress(**kwargs)
  1. See ServiceResourceVpcAddressRequestTypeDef

EC2ServiceResource.VpcPeeringConnection method

Creates a VpcPeeringConnection resource.

Type annotations and code completion for boto3.resource("ec2").VpcPeeringConnection method. boto3 documentation

Method definition
def VpcPeeringConnection(
    self,
    id: str,
) -> VpcPeeringConnection:
    ...
Usage example with kwargs
kwargs: ServiceResourceVpcPeeringConnectionRequestTypeDef = {  # (1)
    "id": ...,
}

parent.VpcPeeringConnection(**kwargs)
  1. See ServiceResourceVpcPeeringConnectionRequestTypeDef

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

Method definition
def create_dhcp_options(
    self,
    *,
    DhcpConfigurations: Sequence[NewDhcpConfigurationTypeDef],  # (1)
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (2)
    DryRun: bool = ...,
) -> DhcpOptions:
    ...
  1. See NewDhcpConfigurationTypeDef
  2. See TagSpecificationTypeDef
Usage example with kwargs
kwargs: CreateDhcpOptionsRequestServiceResourceCreateDhcpOptionsTypeDef = {  # (1)
    "DhcpConfigurations": ...,
}

parent.create_dhcp_options(**kwargs)
  1. See CreateDhcpOptionsRequestServiceResourceCreateDhcpOptionsTypeDef

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

Method definition
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]:
    ...
  1. See BlockDeviceMappingTypeDef
  2. See InstanceTypeType
  3. See InstanceIpv6AddressTypeDef
  4. See RunInstancesMonitoringEnabledTypeDef
  5. See PlacementTypeDef
  6. See IamInstanceProfileSpecificationTypeDef
  7. See ShutdownBehaviorType
  8. See InstanceNetworkInterfaceSpecificationTypeDef
  9. See ElasticGpuSpecificationTypeDef
  10. See ElasticInferenceAcceleratorTypeDef
  11. See TagSpecificationTypeDef
  12. See LaunchTemplateSpecificationTypeDef
  13. See InstanceMarketOptionsRequestTypeDef
  14. See CreditSpecificationRequestTypeDef
  15. See CpuOptionsRequestTypeDef
  16. See CapacityReservationSpecificationTypeDef
  17. See HibernationOptionsRequestTypeDef
  18. See LicenseConfigurationRequestTypeDef
  19. See InstanceMetadataOptionsRequestTypeDef
  20. See EnclaveOptionsRequestTypeDef
  21. See PrivateDnsNameOptionsRequestTypeDef
  22. See InstanceMaintenanceOptionsRequestTypeDef
Usage example with kwargs
kwargs: RunInstancesRequestServiceResourceCreateInstancesTypeDef = {  # (1)
    "MaxCount": ...,
    "MinCount": ...,
}

parent.create_instances(**kwargs)
  1. See RunInstancesRequestServiceResourceCreateInstancesTypeDef

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

Method definition
def create_internet_gateway(
    self,
    *,
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (1)
    DryRun: bool = ...,
) -> InternetGateway:
    ...
  1. See TagSpecificationTypeDef
Usage example with kwargs
kwargs: CreateInternetGatewayRequestServiceResourceCreateInternetGatewayTypeDef = {  # (1)
    "TagSpecifications": ...,
}

parent.create_internet_gateway(**kwargs)
  1. See CreateInternetGatewayRequestServiceResourceCreateInternetGatewayTypeDef

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

Method definition
def create_key_pair(
    self,
    *,
    KeyName: str,
    DryRun: bool = ...,
    KeyType: KeyTypeType = ...,  # (1)
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (2)
    KeyFormat: KeyFormatType = ...,  # (3)
) -> KeyPair:
    ...
  1. See KeyTypeType
  2. See TagSpecificationTypeDef
  3. See KeyFormatType
Usage example with kwargs
kwargs: CreateKeyPairRequestServiceResourceCreateKeyPairTypeDef = {  # (1)
    "KeyName": ...,
}

parent.create_key_pair(**kwargs)
  1. See CreateKeyPairRequestServiceResourceCreateKeyPairTypeDef

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

Method definition
def create_network_acl(
    self,
    *,
    VpcId: str,
    DryRun: bool = ...,
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (1)
) -> NetworkAcl:
    ...
  1. See TagSpecificationTypeDef
Usage example with kwargs
kwargs: CreateNetworkAclRequestServiceResourceCreateNetworkAclTypeDef = {  # (1)
    "VpcId": ...,
}

parent.create_network_acl(**kwargs)
  1. See CreateNetworkAclRequestServiceResourceCreateNetworkAclTypeDef

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

Method definition
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:
    ...
  1. See InstanceIpv6AddressTypeDef
  2. See PrivateIpAddressSpecificationTypeDef
  3. See Ipv4PrefixSpecificationRequestTypeDef
  4. See Ipv6PrefixSpecificationRequestTypeDef
  5. See NetworkInterfaceCreationTypeType
  6. See TagSpecificationTypeDef
Usage example with kwargs
kwargs: CreateNetworkInterfaceRequestServiceResourceCreateNetworkInterfaceTypeDef = {  # (1)
    "SubnetId": ...,
}

parent.create_network_interface(**kwargs)
  1. See CreateNetworkInterfaceRequestServiceResourceCreateNetworkInterfaceTypeDef

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

Method definition
def create_placement_group(
    self,
    *,
    DryRun: bool = ...,
    GroupName: str = ...,
    Strategy: PlacementStrategyType = ...,  # (1)
    PartitionCount: int = ...,
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (2)
    SpreadLevel: SpreadLevelType = ...,  # (3)
) -> PlacementGroup:
    ...
  1. See PlacementStrategyType
  2. See TagSpecificationTypeDef
  3. See SpreadLevelType
Usage example with kwargs
kwargs: CreatePlacementGroupRequestServiceResourceCreatePlacementGroupTypeDef = {  # (1)
    "DryRun": ...,
}

parent.create_placement_group(**kwargs)
  1. See CreatePlacementGroupRequestServiceResourceCreatePlacementGroupTypeDef

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

Method definition
def create_route_table(
    self,
    *,
    VpcId: str,
    DryRun: bool = ...,
    TagSpecifications: Sequence[TagSpecificationTypeDef] = ...,  # (1)
) -> RouteTable:
    ...
  1. See TagSpecificationTypeDef
Usage example with kwargs
kwargs: CreateRouteTableRequestServiceResourceCreateRouteTableTypeDef = {  # (1)
    "VpcId": ...,
}

parent.create_route_table(**kwargs)
  1. See CreateRouteTableRequestServiceResourceCreateRouteTableTypeDef

EC2ServiceResource.create_security_group method

Creates a security group.

Type annotations and code completion for boto3.resource("ec2").create_security_group method.