Struct aws_throwaway::Ec2InstanceDefinition
source · pub struct Ec2InstanceDefinition { /* private fields */ }Expand description
Defines an instance that can be launched via [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.