pub struct EC2Impl {
pub client: Client,
/* private fields */
}Fields§
§client: ClientAWS sdk client to access EC2 resources.
Implementations§
Source§impl EC2Impl
impl EC2Impl
pub fn new(client: EC2Client, custom_tag: Option<String>) -> Self
pub fn create_tag(&self, res_type: ResourceType) -> TagSpecification
pub async fn create_key_pair( &self, name: &str, key_type: KeyType, key_format: KeyFormat, ) -> Result<(KeyPairInfo, String), EC2Error>
pub async fn list_key_pair( &self, key_names: &str, ) -> Result<Vec<KeyPairInfo>, EC2Error>
pub async fn delete_key_pair(&self, key_pair_id: &str) -> Result<(), EC2Error>
pub async fn create_security_group( &self, name: &str, description: &str, ) -> Result<SecurityGroup, EC2Error>
Sourcepub async fn describe_security_group(
&self,
group_name: &str,
) -> Result<Option<SecurityGroup>, EC2Error>
pub async fn describe_security_group( &self, group_name: &str, ) -> Result<Option<SecurityGroup>, EC2Error>
Find a single security group, by name. Returns Err if multiple groups are found.
Add an ingress rule to a security group explicitly allowing IPv4 address as {ip}/32 over TCP port 22.
pub async fn delete_security_group( &self, group_id: &str, ) -> Result<(), EC2Error>
pub async fn create_instances<'a>( &self, instance_name: &str, image_id: &'a str, instance_type: InstanceType, key_pair: &'a KeyPairInfo, security_groups: Vec<&'a SecurityGroup>, user_data: Option<String>, ) -> Result<Vec<String>, EC2Error>
Sourcepub async fn wait_for_instance_ready(
&self,
instance_id: &str,
duration: Option<Duration>,
) -> Result<(), EC2Error>
pub async fn wait_for_instance_ready( &self, instance_id: &str, duration: Option<Duration>, ) -> Result<(), EC2Error>
Wait for an instance to be ready and status ok (default wait 60 seconds)
Sourcepub async fn describe_instance(
&self,
statuses: Vec<InstanceStateName>,
) -> Result<Vec<Instance>, EC2Error>
pub async fn describe_instance( &self, statuses: Vec<InstanceStateName>, ) -> Result<Vec<Instance>, EC2Error>
List instances that are “active” (non-terminated) and are tagged by this tool.
If statuses is an empty Vec, return all non-terminated instances as the default.
pub async fn start_instances(&self, instance_id: &str) -> Result<(), EC2Error>
pub async fn stop_instances( &self, instance_ids: &str, wait: bool, ) -> Result<(), EC2Error>
pub async fn reboot_instance(&self, instance_id: &str) -> Result<(), EC2Error>
pub async fn wait_for_instance_stopped( &self, instance_ids: &str, duration: Option<Duration>, ) -> Result<(), EC2Error>
pub async fn delete_instances( &self, instance_ids: &str, wait: bool, ) -> Result<(), EC2Error>
Sourcepub async fn get_ssh_security_group(&self) -> Result<SecurityGroup, EC2Error>
pub async fn get_ssh_security_group(&self) -> Result<SecurityGroup, EC2Error>
Call this function to update local IP in inbound group.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EC2Impl
impl !RefUnwindSafe for EC2Impl
impl Send for EC2Impl
impl Sync for EC2Impl
impl Unpin for EC2Impl
impl !UnwindSafe for EC2Impl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.