public void ElasticLoadBalancingV2CreateRule()
        {
            #region elbv2-create-rule-1

            var response = client.CreateRule(new CreateRuleRequest
            {
                Actions = new List <Action> {
                    new Action {
                        TargetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067",
                        Type           = "forward"
                    }
                },
                Conditions = new List <RuleCondition> {
                    new RuleCondition {
                        Field  = "path-pattern",
                        Values = new List <string> {
                            "/img/*"
                        }
                    }
                },
                ListenerArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2",
                Priority    = 10
            });

            List <Rule> rules = response.Rules;

            #endregion
        }
Exemple #2
0
 private Amazon.ElasticLoadBalancingV2.Model.CreateRuleResponse CallAWSServiceOperation(IAmazonElasticLoadBalancingV2 client, Amazon.ElasticLoadBalancingV2.Model.CreateRuleRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing V2", "CreateRule");
     try
     {
         #if DESKTOP
         return(client.CreateRule(request));
         #elif CORECLR
         return(client.CreateRuleAsync(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;
     }
 }