AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

This is the response object from the CreateAutoScalingGroup operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.AutoScaling.Model.CreateAutoScalingGroupResponse

Namespace: Amazon.AutoScaling.Model
Assembly: AWSSDK.AutoScaling.dll
Version: 3.x.y.z

Syntax

C#
public class CreateAutoScalingGroupResponse : AmazonWebServiceResponse

The CreateAutoScalingGroupResponse type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.

Examples

This example creates an Auto Scaling group.

To create an Auto Scaling group


var response = client.CreateAutoScalingGroup(new CreateAutoScalingGroupRequest 
{
    AutoScalingGroupName = "my-auto-scaling-group",
    LaunchConfigurationName = "my-launch-config",
    MaxSize = 3,
    MinSize = 1,
    VPCZoneIdentifier = "subnet-4176792c"
});


            

This example creates an Auto Scaling group and attaches the specified Classic Load Balancer.

To create an Auto Scaling group with an attached load balancer


var response = client.CreateAutoScalingGroup(new CreateAutoScalingGroupRequest 
{
    AutoScalingGroupName = "my-auto-scaling-group",
    AvailabilityZones = new List {
        "us-west-2c"
    },
    HealthCheckGracePeriod = 120,
    HealthCheckType = "ELB",
    LaunchConfigurationName = "my-launch-config",
    LoadBalancerNames = new List {
        "my-load-balancer"
    },
    MaxSize = 3,
    MinSize = 1
});


            

This example creates an Auto Scaling group and attaches the specified target group.

To create an Auto Scaling group with an attached target group


var response = client.CreateAutoScalingGroup(new CreateAutoScalingGroupRequest 
{
    AutoScalingGroupName = "my-auto-scaling-group",
    HealthCheckGracePeriod = 120,
    HealthCheckType = "ELB",
    LaunchConfigurationName = "my-launch-config",
    MaxSize = 3,
    MinSize = 1,
    TargetGroupARNs = new List {
        "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
    },
    VPCZoneIdentifier = "subnet-4176792c, subnet-65ea5f08"
});


            

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms