コード例 #1
0
 public MyStack()
 {
     var foo = new Aws.Ec2.TrafficMirrorFilter("foo", new Aws.Ec2.TrafficMirrorFilterArgs
     {
         Description     = "traffic mirror filter - example",
         NetworkServices =
         {
             "amazon-dns",
         },
     });
 }
コード例 #2
0
 public MyStack()
 {
     var filter = new Aws.Ec2.TrafficMirrorFilter("filter", new Aws.Ec2.TrafficMirrorFilterArgs
     {
         Description     = "traffic mirror filter - example",
         NetworkServices =
         {
             "amazon-dns",
         },
     });
     var ruleout = new Aws.Ec2.TrafficMirrorFilterRule("ruleout", new Aws.Ec2.TrafficMirrorFilterRuleArgs
     {
         Description           = "test rule",
         DestinationCidrBlock  = "10.0.0.0/8",
         RuleAction            = "accept",
         RuleNumber            = 1,
         SourceCidrBlock       = "10.0.0.0/8",
         TrafficDirection      = "egress",
         TrafficMirrorFilterId = filter.Id,
     });
     var rulein = new Aws.Ec2.TrafficMirrorFilterRule("rulein", new Aws.Ec2.TrafficMirrorFilterRuleArgs
     {
         Description          = "test rule",
         DestinationCidrBlock = "10.0.0.0/8",
         DestinationPortRange = new Aws.Ec2.Inputs.TrafficMirrorFilterRuleDestinationPortRangeArgs
         {
             FromPort = 22,
             ToPort   = 53,
         },
         Protocol        = 6,
         RuleAction      = "accept",
         RuleNumber      = 1,
         SourceCidrBlock = "10.0.0.0/8",
         SourcePortRange = new Aws.Ec2.Inputs.TrafficMirrorFilterRuleSourcePortRangeArgs
         {
             FromPort = 0,
             ToPort   = 10,
         },
         TrafficDirection      = "ingress",
         TrafficMirrorFilterId = filter.Id,
     });
 }
コード例 #3
0
 public MyStack()
 {
     var filter = new Aws.Ec2.TrafficMirrorFilter("filter", new Aws.Ec2.TrafficMirrorFilterArgs
     {
         Description     = "traffic mirror filter - example",
         NetworkServices =
         {
             "amazon-dns",
         },
     });
     var target = new Aws.Ec2.TrafficMirrorTarget("target", new Aws.Ec2.TrafficMirrorTargetArgs
     {
         NetworkLoadBalancerArn = aws_lb.Lb.Arn,
     });
     var session = new Aws.Ec2.TrafficMirrorSession("session", new Aws.Ec2.TrafficMirrorSessionArgs
     {
         Description           = "traffic mirror session - example",
         NetworkInterfaceId    = aws_instance.Test.Primary_network_interface_id,
         TrafficMirrorFilterId = filter.Id,
         TrafficMirrorTargetId = target.Id,
     });
 }