Exemplo n.º 1
0
 public MyStack()
 {
     var main = new Aws.Elb.LoadBalancer("main", new Aws.Elb.LoadBalancerArgs
     {
         AvailabilityZones =
         {
             "us-east-1c",
         },
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 80,
                 InstanceProtocol = "http",
                 LbPort           = 80,
                 LbProtocol       = "http",
             },
         },
     });
     var www = new Aws.Route53.Record("www", new Aws.Route53.RecordArgs
     {
         Aliases =
         {
             new Aws.Route53.Inputs.RecordAliasArgs
             {
                 EvaluateTargetHealth = true,
                 Name   = main.DnsName,
                 ZoneId = main.ZoneId,
             },
         },
         Name   = "example.com",
         Type   = "A",
         ZoneId = aws_route53_zone.Primary.Zone_id,
     });
 }
Exemplo n.º 2
0
 public MyStack()
 {
     var lb = new Aws.Elb.LoadBalancer("lb", new Aws.Elb.LoadBalancerArgs
     {
         AvailabilityZones =
         {
             "us-east-1a",
         },
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 8000,
                 InstanceProtocol = "http",
                 LbPort           = 80,
                 LbProtocol       = "http",
             },
         },
     });
     var foo = new Aws.Elb.AppCookieStickinessPolicy("foo", new Aws.Elb.AppCookieStickinessPolicyArgs
     {
         CookieName   = "MyAppCookie",
         LbPort       = 80,
         LoadBalancer = lb.Name,
     });
 }
Exemplo n.º 3
0
 public MyStack()
 {
     // Create a new load balancer
     var bar = new Aws.Elb.LoadBalancer("bar", new Aws.Elb.LoadBalancerArgs
     {
         AccessLogs = new Aws.Elb.Inputs.LoadBalancerAccessLogsArgs
         {
             Bucket       = "foo",
             BucketPrefix = "bar",
             Interval     = 60,
         },
         AvailabilityZones =
         {
             "us-west-2a",
             "us-west-2b",
             "us-west-2c",
         },
         ConnectionDraining        = true,
         ConnectionDrainingTimeout = 400,
         CrossZoneLoadBalancing    = true,
         HealthCheck = new Aws.Elb.Inputs.LoadBalancerHealthCheckArgs
         {
             HealthyThreshold   = 2,
             Interval           = 30,
             Target             = "HTTP:8000/",
             Timeout            = 3,
             UnhealthyThreshold = 2,
         },
         IdleTimeout = 400,
         Instances   =
         {
             aws_instance.Foo.Id,
         },
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 8000,
                 InstanceProtocol = "http",
                 LbPort           = 80,
                 LbProtocol       = "http",
             },
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 8000,
                 InstanceProtocol = "http",
                 LbPort           = 443,
                 LbProtocol       = "https",
                 SslCertificateId = "arn:aws:iam::123456789012:server-certificate/certName",
             },
         },
         Tags =
         {
             { "Name", "foobar-elb" },
         },
     });
 }
Exemplo n.º 4
0
 public MyStack()
 {
     var wu_tang = new Aws.Elb.LoadBalancer("wu-tang", new Aws.Elb.LoadBalancerArgs
     {
         AvailabilityZones =
         {
             "us-east-1a",
         },
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 443,
                 InstanceProtocol = "http",
                 LbPort           = 443,
                 LbProtocol       = "https",
                 SslCertificateId = "arn:aws:iam::000000000000:server-certificate/wu-tang.net",
             },
         },
         Tags =
         {
             { "Name", "wu-tang" },
         },
     });
     var wu_tang_ssl = new Aws.Elb.LoadBalancerPolicy("wu-tang-ssl", new Aws.Elb.LoadBalancerPolicyArgs
     {
         LoadBalancerName = wu_tang.Name,
         PolicyAttributes =
         {
             new Aws.Elb.Inputs.LoadBalancerPolicyPolicyAttributeArgs
             {
                 Name  = "ECDHE-ECDSA-AES128-GCM-SHA256",
                 Value = "true",
             },
             new Aws.Elb.Inputs.LoadBalancerPolicyPolicyAttributeArgs
             {
                 Name  = "Protocol-TLSv1.2",
                 Value = "true",
             },
         },
         PolicyName     = "wu-tang-ssl",
         PolicyTypeName = "SSLNegotiationPolicyType",
     });
     var wu_tang_listener_policies_443 = new Aws.Elb.ListenerPolicy("wu-tang-listener-policies-443", new Aws.Elb.ListenerPolicyArgs
     {
         LoadBalancerName = wu_tang.Name,
         LoadBalancerPort = 443,
         PolicyNames      =
         {
             wu_tang_ssl.PolicyName,
         },
     });
 }
Exemplo n.º 5
0
 public MyStack()
 {
     var wu_tang = new Aws.Elb.LoadBalancer("wu-tang", new Aws.Elb.LoadBalancerArgs
     {
         AvailabilityZones =
         {
             "us-east-1a",
         },
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 443,
                 InstanceProtocol = "http",
                 LbPort           = 443,
                 LbProtocol       = "https",
                 SslCertificateId = "arn:aws:iam::000000000000:server-certificate/wu-tang.net",
             },
         },
         Tags =
         {
             { "Name", "wu-tang" },
         },
     });
     var wu_tang_ssl_tls_1_1 = new Aws.Elb.LoadBalancerPolicy("wu-tang-ssl-tls-1-1", new Aws.Elb.LoadBalancerPolicyArgs
     {
         LoadBalancerName = wu_tang.Name,
         PolicyAttributes =
         {
             new Aws.Elb.Inputs.LoadBalancerPolicyPolicyAttributeArgs
             {
                 Name  = "Reference-Security-Policy",
                 Value = "ELBSecurityPolicy-TLS-1-1-2017-01",
             },
         },
         PolicyName     = "wu-tang-ssl",
         PolicyTypeName = "SSLNegotiationPolicyType",
     });
     var wu_tang_listener_policies_443 = new Aws.Elb.ListenerPolicy("wu-tang-listener-policies-443", new Aws.Elb.ListenerPolicyArgs
     {
         LoadBalancerName = wu_tang.Name,
         LoadBalancerPort = 443,
         PolicyNames      =
         {
             wu_tang_ssl_tls_1_1.PolicyName,
         },
     });
 }
Exemplo n.º 6
0
 public MyStack()
 {
     var my_domain = Output.Create(Aws.Iam.GetServerCertificate.InvokeAsync(new Aws.Iam.GetServerCertificateArgs
     {
         Latest     = true,
         NamePrefix = "my-domain.org",
     }));
     var elb = new Aws.Elb.LoadBalancer("elb", new Aws.Elb.LoadBalancerArgs
     {
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 8000,
                 InstanceProtocol = "https",
                 LbPort           = 443,
                 LbProtocol       = "https",
                 SslCertificateId = my_domain.Apply(my_domain => my_domain.Arn),
             },
         },
     });
 }
Exemplo n.º 7
0
 public MyStack()
 {
     var lb = new Aws.Elb.LoadBalancer("lb", new Aws.Elb.LoadBalancerArgs
     {
         AvailabilityZones =
         {
             "us-east-1a",
         },
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 25,
                 InstanceProtocol = "tcp",
                 LbPort           = 25,
                 LbProtocol       = "tcp",
             },
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 587,
                 InstanceProtocol = "tcp",
                 LbPort           = 587,
                 LbProtocol       = "tcp",
             },
         },
     });
     var smtp = new Aws.Ec2.ProxyProtocolPolicy("smtp", new Aws.Ec2.ProxyProtocolPolicyArgs
     {
         InstancePorts =
         {
             "25",
             "587",
         },
         LoadBalancer = lb.Name,
     });
 }
Exemplo n.º 8
0
 public MyStack()
 {
     var lb = new Aws.Elb.LoadBalancer("lb", new Aws.Elb.LoadBalancerArgs
     {
         AvailabilityZones =
         {
             "us-east-1a",
         },
         Listeners =
         {
             new Aws.Elb.Inputs.LoadBalancerListenerArgs
             {
                 InstancePort     = 8000,
                 InstanceProtocol = "https",
                 LbPort           = 443,
                 LbProtocol       = "https",
                 SslCertificateId = "arn:aws:iam::123456789012:server-certificate/certName",
             },
         },
     });
     var foo = new Aws.Elb.SslNegotiationPolicy("foo", new Aws.Elb.SslNegotiationPolicyArgs
     {
         Attributes =
         {
             new Aws.Elb.Inputs.SslNegotiationPolicyAttributeArgs
             {
                 Name  = "Protocol-TLSv1",
                 Value = "false",
             },
             new Aws.Elb.Inputs.SslNegotiationPolicyAttributeArgs
             {
                 Name  = "Protocol-TLSv1.1",
                 Value = "false",
             },
             new Aws.Elb.Inputs.SslNegotiationPolicyAttributeArgs
             {
                 Name  = "Protocol-TLSv1.2",
                 Value = "true",
             },
             new Aws.Elb.Inputs.SslNegotiationPolicyAttributeArgs
             {
                 Name  = "Server-Defined-Cipher-Order",
                 Value = "true",
             },
             new Aws.Elb.Inputs.SslNegotiationPolicyAttributeArgs
             {
                 Name  = "ECDHE-RSA-AES128-GCM-SHA256",
                 Value = "true",
             },
             new Aws.Elb.Inputs.SslNegotiationPolicyAttributeArgs
             {
                 Name  = "AES128-GCM-SHA256",
                 Value = "true",
             },
             new Aws.Elb.Inputs.SslNegotiationPolicyAttributeArgs
             {
                 Name  = "EDH-RSA-DES-CBC3-SHA",
                 Value = "false",
             },
         },
         LbPort       = 443,
         LoadBalancer = lb.Id,
     });
 }