Esempio n. 1
0
        private static void LaunchInstance()
        {
            try
            {
                AmazonEC2 ec2 = AWSClientFactory.CreateAmazonEC2Client(_awsKey, _awsSecretKey);

                StartInstancesRequest request = new StartInstancesRequest();
                request.WithInstanceId(new string[] { _instanceId });

                ec2.StartInstances(request);
                Mail(string.Format("Successfully started EC2 instance {0}", _instanceId));
            }
            catch (Exception e)
            {
                MailError("Error launching instance", e);
            }
        }