Amazon.AutoScaling.AmazonAutoScalingClient.AttachInstances C# (CSharp) Метод

AttachInstances() публичный Метод

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.
Результат Amazon.AutoScaling.Model.AttachInstancesResponse
        public AttachInstancesResponse AttachInstances(AttachInstancesRequest request)
        {
            var marshaller = new AttachInstancesRequestMarshaller();
            var unmarshaller = AttachInstancesResponseUnmarshaller.Instance;

            return Invoke<AttachInstancesRequest,AttachInstancesResponse>(request, marshaller, unmarshaller);
        }

Usage Example

		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);
		}
All Usage Examples Of Amazon.AutoScaling.AmazonAutoScalingClient::AttachInstances
AmazonAutoScalingClient