Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7178155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:51:50+00:00 2026-05-28T16:51:50+00:00

I am writing my first ever code for AWS. I have downloaded the AWS

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:51:51+00:00Added an answer on May 28, 2026 at 4:51 pm

    After going crazy all day, I was able to create/launch an instance with this code:

    using System;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.Configuration;
    using System.Linq;
    using System.Text;
    using Amazon;
    using Amazon.EC2;
    using Amazon.EC2.Model;
    using Amazon.AutoScaling;
    using Amazon.AutoScaling.Model;
    
    
    namespace HG.AWS
    {
        public class AutoScale
        {
            public static Boolean LaunchInstance()
            {
    
    
                AmazonEC2Config EC2Config = new AmazonEC2Config()
                .WithServiceURL("https://ec2.eu-west-1.amazonaws.com");
    
    
                NameValueCollection appConfig = ConfigurationManager.AppSettings;
    
    
                AmazonEC2 ec2 = AWSClientFactory.CreateAmazonEC2Client(
                    appConfig["AWSAccessKey"], 
                    appConfig["AWSSecretKey"],
                    EC2Config);
    
                try
                {
    
                    RunInstancesRequest EC2R = new RunInstancesRequest();
                    EC2R.ImageId = "ami-885b6bfc";
                    EC2R.InstanceType = "m1.large";
                    EC2R.MaxCount = 1;
                    EC2R.MinCount = 1;
                    RunInstancesResponse r = ec2.RunInstances(EC2R);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing my first ever Shell script today. I think I have found
I'm writing my first Windows CE app using the .NET Compact Framework v3.5. I
I'm writing my first app with ASP.NET MVP (attempting Supervisory Controller) and Unit Testing
This is my first ever attempt at writing a recursive function in c. The
Morning All, I have been writing an ever so simple IRC client in visual
This is my first post ever :). I have quite a bit of experience
I am writing my very first asp.net application and am trying to use the
I'm writing my first ever C# application, for Windows Phone Mango. It's designed to
I am writing my first shell-script ever and I am trying to connect to
I am writing my first ever plugin for rails. The plugin is supposed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.