· 7 years ago · Jan 15, 2019, 10:36 AM
1String accesskeyid = args[0];
2 String secretkey = args[1];
3 String group = args[2];
4 String command = args[3];
5 String name = args[5];
6
7 Properties props = new Properties();
8
9 props.setProperty(AWSEC2Constants.PROPERTY_EC2_AMI_QUERY,
10 "owner-id=136317238326;state=available;image-type=machine");
11
12 // Init
13 ComputeService compute = new ComputeServiceContextFactory()
14 .createContext("aws-ec2", accesskeyid, secretkey,
15 ImmutableSet.<Module> of(new JschSshClientModule()),
16 props).getComputeService();