public void ElasticLoadBalancingCreateLoadBalancer() { #region elb-create-load-balancer-1 var response = client.CreateLoadBalancer(new CreateLoadBalancerRequest { Listeners = new List <Listener> { new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 80, Protocol = "HTTP" } }, LoadBalancerName = "my-load-balancer", SecurityGroups = new List <string> { "sg-a61988c3" }, Subnets = new List <string> { "subnet-15aaab61" } }); string dnsName = response.DNSName; #endregion }
private Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerResponse CallAWSServiceOperation(IAmazonElasticLoadBalancing client, Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing", "CreateLoadBalancer"); try { #if DESKTOP return(client.CreateLoadBalancer(request)); #elif CORECLR return(client.CreateLoadBalancerAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }