Struct tsunami::MachineSetup [−][src]
pub struct MachineSetup { /* fields omitted */ }
A template for a particular machine setup in a tsunami.
Methods
impl MachineSetup
[src]
impl MachineSetup
pub fn new<F>(instance_type: &str, ami: &str, setup: F) -> Self where
F: Fn(&mut Session) -> Result<(), Error> + 'static + Sync,
[src]
pub fn new<F>(instance_type: &str, ami: &str, setup: F) -> Self where
F: Fn(&mut Session) -> Result<(), Error> + 'static + Sync,
Define a new template for a tsunami machine setup.
The given AWS EC2 instance type will be used. Note that only EC2 Defined Duration Spot Instance types are allowed.
The setup
argument is called once for every spawned instances of this type with a handle
to the target machine. Use Machine::ssh
to issue
commands on the host in question.
The new instance will start out in the state dictated by the Amazon Machine Image specified
in ami
.
MachineSetup::new("m5.large", "ami-e18aa89b", |ssh| { ssh.cmd("cat /etc/hostname").map(|out| { println!("{}", out); }) });
pub fn as_user(self, username: &str) -> Self
[src]
pub fn as_user(self, username: &str) -> Self
Set the username to SSH into this machine type as.
Defaults to ec2-user
.
Auto Trait Implementations
impl !Send for MachineSetup
impl !Send for MachineSetup
impl Sync for MachineSetup
impl Sync for MachineSetup