# NOT RUN {
# This example creates an HTTP listener for the specified load balancer
# that forwards requests to the specified target group.
# }
# NOT RUN {
svc$create_listener(
DefaultActions = list(
list(
TargetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-t...",
Type = "forward"
)
),
LoadBalancerArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my...",
Port = 80L,
Protocol = "HTTP"
)
# }
# NOT RUN {
# This example creates an HTTPS listener for the specified load balancer
# that forwards requests to the specified target group. Note that you must
# specify an SSL certificate for an HTTPS listener. You can create and
# manage certificates using AWS Certificate Manager (ACM). Alternatively,
# you can create a certificate using SSL/TLS tools, get the certificate
# signed by a certificate authority (CA), and upload the certificate to
# AWS Identity and Access Management (IAM).
# }
# NOT RUN {
svc$create_listener(
Certificates = list(
list(
CertificateArn = "arn:aws:iam::123456789012:server-certificate/my-server-cert"
)
),
DefaultActions = list(
list(
TargetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-t...",
Type = "forward"
)
),
LoadBalancerArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my...",
Port = 443L,
Protocol = "HTTPS",
SslPolicy = "ELBSecurityPolicy-2015-05"
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataCamp Workspace