Struct aws_throwaway::Ec2Instance
source · pub struct Ec2Instance { /* private fields */ }Expand description
Represents a currently running EC2 instance and provides various methods for interacting with the instance.
Implementations§
source§impl Ec2Instance
impl Ec2Instance
sourcepub fn public_ip(&self) -> IpAddr
pub fn public_ip(&self) -> IpAddr
Use this address to connect to this instance from outside of AWS
sourcepub fn private_ip(&self) -> IpAddr
pub fn private_ip(&self) -> IpAddr
Use this address to connect to this instance from within AWS
sourcepub fn network_interfaces(&self) -> &[NetworkInterface]
pub fn network_interfaces(&self) -> &[NetworkInterface]
List of all network interfaces attached to this instance.
Includes the primary interface that has the ip returned by Ec2Instance::private_ip as well as all other interfaces attached to this instance at the time it was created.
sourcepub fn client_private_key(&self) -> &str
pub fn client_private_key(&self) -> &str
Use this as the private key of your machine when connecting to this instance
sourcepub fn host_public_key_bytes(&self) -> &[u8] ⓘ
pub fn host_public_key_bytes(&self) -> &[u8] ⓘ
Use this for authenticating a host programmatically
sourcepub fn openssh_known_hosts_line(&self) -> String
pub fn openssh_known_hosts_line(&self) -> String
Insert this into your known_hosts file to avoid errors due to unknown fingerprints
sourcepub fn ssh_instructions(&self) -> String
pub fn ssh_instructions(&self) -> String
Get a list of commands that the user can paste into bash to manually open an ssh connection to this instance.