public void ElasticLoadBalancingCreateLoadBalancerListeners() { #region elb-create-load-balancer-listeners-1 var response = client.CreateLoadBalancerListeners(new CreateLoadBalancerListenersRequest { Listeners = new List <Listener> { new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 80, Protocol = "HTTP" } }, LoadBalancerName = "my-load-balancer" }); #endregion }
private Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerListenersResponse CallAWSServiceOperation(IAmazonElasticLoadBalancing client, Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerListenersRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing", "CreateLoadBalancerListeners"); try { #if DESKTOP return(client.CreateLoadBalancerListeners(request)); #elif CORECLR return(client.CreateLoadBalancerListenersAsync(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; } }