I am writing my first ever code for AWS.
I have downloaded the AWS .NET SDK.
I need to programmatically Create/Launch/Terminate an EC2 instance.
I was able to write the following lines of code, but have no idea what do from here:
public static Boolean LaunchInstance()
{
NameValueCollection appConfig = ConfigurationManager.AppSettings;
AmazonAutoScaling autoscaling = AWSClientFactory.CreateAmazonAutoScalingClient(
appConfig["AWSAccessKey"],
appConfig["AWSSecretKey"]
);
CreateLaunchConfigurationResponse ccResponse = autoscaling.CreateLaunchConfiguration(new CreateLaunchConfigurationRequest());
return true;
}
I am stuck because I can’t understand how to use the CreateLaunchConfigurationResponse and can’t find any example on the internet.
Do you have any example how to use this?
After going crazy all day, I was able to create/launch an instance with this code: