Listener
Manage an ELB Listener.
Example
Http listener
exports.createResources = () => [
{
type: "Listener",
group: "ElasticLoadBalancingV2",
properties: ({}) => ({
Port: 80,
Protocol: "HTTP",
}),
dependencies: () => ({
loadBalancer: "load-balancer",
targetGroup: "target-group-web",
}),
},
{
type: "Listener",
group: "ElasticLoadBalancingV2",
properties: ({}) => ({
Port: 443,
Protocol: "HTTPS",
}),
dependencies: () => ({
loadBalancer: "load-balancer",
targetGroup: "target-group-rest",
certificate: "grucloud.org",
}),
},
];
Properties
The list of properties are defined in CreateListenerCommandInput
Source Code
Dependencies
Used By
List
gc l -t Listener
Listing resources on 1 provider: aws
✓ aws
✓ Initialising
✓ Listing 8/8
┌─────────────────────────────────────────────────────────────────────────────┐
│ 2 ElasticLoadBalancingV2::Listener from aws │
├─────────────────────────────────────────────────────────────────────────────┤
│ name: listener::load-balancer::HTTP::80 │
│ managedByUs: Yes │
│ live: │
│ ListenerArn: arn:aws:elasticloadbalancing:us-east-1:840541460064:listene… │
│ LoadBalancerArn: arn:aws:elasticloadbalancing:us-east-1:840541460064:loa… │
│ Port: 80 │
│ Protocol: HTTP │
│ Certificates: [] │
│ DefaultActions: │
│ - Type: forward │
│ TargetGroupArn: arn:aws:elasticloadbalancing:us-east-1:840541460064:… │
│ ForwardConfig: │
│ TargetGroups: │
│ - TargetGroupArn: arn:aws:elasticloadbalancing:us-east-1:8405414… │
│ Weight: 1 │
│ TargetGroupStickinessConfig: │
│ Enabled: false │
│ AlpnPolicy: [] │
│ Tags: │
│ - Key: gc-created-by-provider │
│ Value: aws │
│ - Key: gc-managed-by │
│ Value: grucloud │
│ - Key: gc-project-name │
│ Value: @grucloud/example-aws-elbv2-loadbalancer │
│ - Key: gc-stage │
│ Value: dev │
│ - Key: Name │
│ Value: listener::load-balancer::HTTP::80 │
│ │
├─────────────────────────────────────────────────────────────────────────────┤
│ name: listener::load-balancer::HTTPS::443 │
│ managedByUs: Yes │
│ live: │
│ ListenerArn: arn:aws:elasticloadbalancing:us-east-1:840541460064:listene… │
│ LoadBalancerArn: arn:aws:elasticloadbalancing:us-east-1:840541460064:loa… │
│ Port: 443 │
│ Protocol: HTTPS │
│ Certificates: │
│ - CertificateArn: arn:aws:acm:us-east-1:840541460064:certificate/bc419… │
│ SslPolicy: ELBSecurityPolicy-2016-08 │
│ DefaultActions: │
│ - Type: forward │
│ TargetGroupArn: arn:aws:elasticloadbalancing:us-east-1:840541460064:… │
│ ForwardConfig: │
│ TargetGroups: │
│ - TargetGroupArn: arn:aws:elasticloadbalancing:us-east-1:8405414… │
│ Weight: 1 │
│ TargetGroupStickinessConfig: │
│ Enabled: false │
│ AlpnPolicy: [] │
│ Tags: │
│ - Key: gc-created-by-provider │
│ Value: aws │
│ - Key: gc-managed-by │
│ Value: grucloud │
│ - Key: gc-project-name │
│ Value: @grucloud/example-aws-elbv2-loadbalancer │
│ - Key: gc-stage │
│ Value: dev │
│ - Key: Name │
│ Value: listener::load-balancer::HTTPS::443 │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
List Summary:
Provider: aws
┌────────────────────────────────────────────────────────────────────────────┐
│ aws │
├─────────────────┬──────────────────────────────────────────────────────────┤
│ ElasticLoadBalancingV2::Listener │ listener::load-balancer::HTTP::80 │
│ │ listener::load-balancer::HTTPS::443 │
└─────────────────┴──────────────────────────────────────────────────────────┘
2 resources, 1 type, 1 provider
Command "gc l -t Listener" executed in 6s