Amazon.ElasticLoadBalancing.AmazonElasticLoadBalancingClient.CreateLoadBalancer C# (CSharp) Метод

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

Creates a Classic load balancer.

You can add listeners, security groups, subnets, and tags when you create your load balancer, or you can add them later using CreateLoadBalancerListeners, ApplySecurityGroupsToLoadBalancer, AttachLoadBalancerToSubnets, and AddTags.

To describe your current load balancers, see DescribeLoadBalancers. When you are finished with a load balancer, you can delete it using DeleteLoadBalancer.

You can create up to 20 load balancers per region per account. You can request an increase for the number of load balancers for your account. For more information, see Limits for Your Classic Load Balancer in the Classic Load Balancers Guide.

/// The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access /// Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded /// the certificate to IAM, this error might indicate that the certificate is not fully /// available yet. /// /// The specified load balancer name already exists for this account. /// /// A tag key was specified more than once. /// /// The requested configuration change is not valid. /// /// The specified value for the schema is not valid. You can only specify a scheme for /// load balancers in a VPC. /// /// One or more of the specified security groups do not exist. /// /// The specified VPC has no associated Internet gateway. /// /// One or more of the specified subnets do not exist. /// /// The quota for the number of load balancers has been reached. /// /// The quota for the number of tags that can be assigned to a load balancer has been /// reached. /// /// ///
public CreateLoadBalancer ( CreateLoadBalancerRequest request ) : CreateLoadBalancerResponse
request Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerRequest Container for the necessary parameters to execute the CreateLoadBalancer service method.
Результат Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerResponse
        public CreateLoadBalancerResponse CreateLoadBalancer(CreateLoadBalancerRequest request)
        {
            var marshaller = new CreateLoadBalancerRequestMarshaller();
            var unmarshaller = CreateLoadBalancerResponseUnmarshaller.Instance;

            return Invoke<CreateLoadBalancerRequest,CreateLoadBalancerResponse>(request, marshaller, unmarshaller);
        }

Usage Example

Пример #1
0
		protected override void OnCreate (Bundle bundle)
		{
			const string ACCESS_KEY = "";
			const string SECRET_KEY = "";
			AmazonElasticLoadBalancingClient sLBClient = new AmazonElasticLoadBalancingClient(ACCESS_KEY, SECRET_KEY, Amazon.RegionEndpoint.USEast1);

			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 {
				var request = new Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerRequest ("newLoadBalancer");
				request.AvailabilityZones = new System.Collections.Generic.List<string>{ "us-east-1b", "us-east-1c" };
				var listener = new Amazon.ElasticLoadBalancing.Model.Listener ("HTTP", 80, 45);
				request.Listeners = new System.Collections.Generic.List<Amazon.ElasticLoadBalancing.Model.Listener>{ listener };

				var response = sLBClient.CreateLoadBalancer (request);
				var status   = FindViewById<EditText>(Resource.Id.status);
				status.Text = String.Format ("Load balancer {0} was created.", response.DNSName);
			};
		}
AmazonElasticLoadBalancingClient