Skip to main content

Module ec2

Module ec2 

Source
Expand description

AWS EC2 SDK function wrappers

Structs§

Ec2Client
Client for Amazon Elastic Compute Cloud
IpPermission

Describes the permissions for a security group rule.

IpRange

Describes an IPv4 address range.

Region
The region to send requests to.
UserIdGroupPair

Describes a security group and Amazon Web Services account ID pair.

Enums§

InstanceType
When writing a match expression against InstanceType, it is important to ensure your code is forward-compatible. That is, if a match arm handles a case for a feature that is supported by the service but has not been represented as an enum variant in a current version of SDK, your code should continue to work when you upgrade SDK to a future version in which the enum does include a variant for that feature.
VolumeType
When writing a match expression against VolumeType, it is important to ensure your code is forward-compatible. That is, if a match arm handles a case for a feature that is supported by the service but has not been represented as an enum variant in a current version of SDK, your code should continue to work when you upgrade SDK to a future version in which the enum does include a variant for that feature.

Functions§

accept_vpc_peering_connection
Accepts a VPC peering connection in the peer region
add_monitoring_ingress
Adds monitoring IP ingress rules to a binary security group for Prometheus scraping
add_route
Adds a route to a route table for VPC peering
create_and_attach_igw
Creates an Internet Gateway and attaches it to the specified VPC
create_client
Creates an EC2 client for the specified AWS region
create_route_table
Creates a route table for the VPC and sets up a default route to the Internet Gateway
create_security_group_binary
Creates a security group for binary instances with access from deployer and custom ports Note: monitoring IP rules are added separately via add_monitoring_ingress after monitoring instance launches
create_security_group_monitoring
Creates a security group for the monitoring instance with access from the deployer IP
create_subnet
Creates a subnet within the VPC and associates it with the route table
create_vpc
Creates a VPC with the specified CIDR block and tag
create_vpc_peering_connection
Creates a VPC peering connection between two VPCs
delete_igw
Deletes an Internet Gateway
delete_key_pair
Deletes an SSH key pair from the specified region
delete_route_table
Deletes a route table
delete_security_group
Deletes a security group
delete_subnet
Deletes a subnet
delete_vpc
Deletes a VPC
delete_vpc_peering
Deletes a VPC peering connection
detach_igw
Detaches an Internet Gateway from a VPC
find_az_instance_support
Returns a map of AZ -> set of supported instance types for the given instance types.
find_igws_by_tag
Finds Internet Gateways by deployer tag
find_instances_by_tag
Finds instances by deployer tag
find_route_tables_by_tag
Finds route tables by deployer tag
find_security_groups_by_tag
Finds security groups by deployer tag
find_subnets_by_tag
Finds subnets by deployer tag
find_vpc_by_igw
Finds the VPC ID attached to an Internet Gateway, if any
find_vpc_peering_by_tag
Finds VPC peering connections by deployer tag
find_vpcs_by_tag
Finds VPCs by deployer tag
get_enabled_regions
Returns the set of regions that are enabled for the AWS account
get_private_ip
Retrieves the private IP address of an instance
import_key_pair
Imports an SSH public key into the specified region
launch_instances
Launches EC2 instances with specified configurations. Filters subnets to those supporting the instance type, distributes across them starting at start_idx, and falls back to other subnets on capacity errors.
terminate_instances
Terminates specified instances
wait_for_enis_deleted
Waits until all network interfaces associated with a security group are deleted
wait_for_instances_ready
wait_for_instances_running
Waits for instances to reach the “running” state and returns their public IPs in the same order as the input instance IDs.
wait_for_instances_terminated
Waits for instances to be terminated
wait_for_vpc_peering_connection
Waits for a VPC peering connection to reach the “pending-acceptance” state
wait_for_vpc_peering_deletion
Waits for a VPC peering connection to be deleted