pub struct Ec2InstanceDefinition { /* private fields */ }Expand description
Defines an instance that can be launched via crate::Aws::create_ec2_instance
Implementations§
Source§impl Ec2InstanceDefinition
impl Ec2InstanceDefinition
Sourcepub fn new(instance_type: InstanceType) -> Self
pub fn new(instance_type: InstanceType) -> Self
Start defining an instance with the specified instance type
pub fn volume_size_gigabytes(self, size_gb: u32) -> Self
Sourcepub fn network_interface_count(self, count: u32) -> Self
pub fn network_interface_count(self, count: u32) -> Self
Sets the amount of network interfaces to use on this instance. Defaults to 1
Setting this to a value other than 1 will result in the creation of an elastic ip to point at your instance. This is an unfortunate requirement of AWS ECS, instances with multiple network interfaces do not get the automatically assigned ipv4 address given to instances with 1 network interface. For most users there is a hard limit of 5 elastic ip addresses allowed at one time.
pub fn os(self, os: InstanceOs) -> Self
Sourcepub fn override_ami(self, ami: Option<String>) -> Self
pub fn override_ami(self, ami: Option<String>) -> Self
Override the AMI used.
When used together with the os setting, the os setting is used to determine how to configure the instance while the specified AMI is used as the instances image.
Defaults to None which indicates that the appropriate AMI should be looked up via SSM.
This option is useful when you have custom variation of the configured OS or if your user does not have access to SSM. AMI’s are region specific so be careful in picking your AMI.
Auto Trait Implementations§
impl Freeze for Ec2InstanceDefinition
impl RefUnwindSafe for Ec2InstanceDefinition
impl Send for Ec2InstanceDefinition
impl Sync for Ec2InstanceDefinition
impl Unpin for Ec2InstanceDefinition
impl UnwindSafe for Ec2InstanceDefinition
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
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>
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>
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 more