AttachInstances() public method

Attaches one or more EC2 instances to the specified Auto Scaling group.

When you attach instances, Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails.

If there is a Classic load balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups.

For more information, see Attach EC2 Instances to Your Auto Scaling Group in the Auto Scaling User Guide.

/// You already have a pending update to an Auto Scaling resource (for example, a group, /// instance, or load balancer). ///
public AttachInstances ( AttachInstancesRequest request ) : Amazon.AutoScaling.Model.AttachInstancesResponse
request Amazon.AutoScaling.Model.AttachInstancesRequest Container for the necessary parameters to execute the AttachInstances service method.
return Amazon.AutoScaling.Model.AttachInstancesResponse
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			var client = new AmazonAutoScalingClient (new BasicAWSCredentials (ACCESS_KEY, SECRET_KEY), Amazon.RegionEndpoint.USEast1);

			// Attach specified instance.
			var request = new AttachInstancesRequest ();
			request.AutoScalingGroupName = "TestGroup";
			request.InstanceIds = new System.Collections.Generic.List<string> { INSTANCE_ID };
			client.AttachInstances (request);
		}
Example #2
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			// Get our button from the layout resource,
			// and attach an event to it
			Button button = FindViewById<Button> (Resource.Id.myButton);
			
			button.Click += delegate
			{
				button.Text = string.Format ("{0} clicks!", count++);
			};
				
			var client = new AmazonAutoScalingClient (new BasicAWSCredentials (ACCESS_KEY, SECRET_KEY), Amazon.RegionEndpoint.USEast1);

			// Attach specified instance.
			var request = new AttachInstancesRequest ();
			request.AutoScalingGroupName = "TestGroup";
			request.InstanceIds = new System.Collections.Generic.List<string> { INSTANCE_ID };
			client.AttachInstances (request);
		}