Class NetworkMultipleTargetGroupsEc2Service
An EC2 service running on an ECS cluster fronted by a network load balancer.
Inheritance
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class NetworkMultipleTargetGroupsEc2Service : NetworkMultipleTargetGroupsServiceBase
Syntax (vb)
Public Class NetworkMultipleTargetGroupsEc2Service
Inherits NetworkMultipleTargetGroupsServiceBase
Remarks
ExampleMetadata: infused
Examples
// Two network load balancers, each with their own listener and target group.
Cluster cluster;
var loadBalancedEc2Service = new NetworkMultipleTargetGroupsEc2Service(this, "Service", new NetworkMultipleTargetGroupsEc2ServiceProps {
Cluster = cluster,
MemoryLimitMiB = 256,
TaskImageOptions = new NetworkLoadBalancedTaskImageProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
},
LoadBalancers = new [] { new NetworkLoadBalancerProps {
Name = "lb1",
Listeners = new [] { new NetworkListenerProps {
Name = "listener1"
} }
}, new NetworkLoadBalancerProps {
Name = "lb2",
Listeners = new [] { new NetworkListenerProps {
Name = "listener2"
} }
} },
TargetGroups = new [] { new NetworkTargetProps {
ContainerPort = 80,
Listener = "listener1"
}, new NetworkTargetProps {
ContainerPort = 90,
Listener = "listener2"
} }
});
Synopsis
Constructors
NetworkMultipleTargetGroupsEc2Service(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
NetworkMultipleTargetGroupsEc2Service(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
NetworkMultipleTargetGroupsEc2Service(Construct, String, INetworkMultipleTargetGroupsEc2ServiceProps) | Constructs a new instance of the NetworkMultipleTargetGroupsEc2Service class. |
Properties
Service | The EC2 service in this construct. |
TargetGroup | (deprecated) The default target group for the service. |
TaskDefinition | The EC2 Task Definition in this construct. |
Constructors
NetworkMultipleTargetGroupsEc2Service(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected NetworkMultipleTargetGroupsEc2Service(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
NetworkMultipleTargetGroupsEc2Service(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected NetworkMultipleTargetGroupsEc2Service(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
NetworkMultipleTargetGroupsEc2Service(Construct, String, INetworkMultipleTargetGroupsEc2ServiceProps)
Constructs a new instance of the NetworkMultipleTargetGroupsEc2Service class.
public NetworkMultipleTargetGroupsEc2Service(Construct scope, string id, INetworkMultipleTargetGroupsEc2ServiceProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props INetworkMultipleTargetGroupsEc2ServiceProps
Properties
Service
The EC2 service in this construct.
public virtual Ec2Service Service { get; }
Property Value
TargetGroup
(deprecated) The default target group for the service.
public virtual NetworkTargetGroup TargetGroup { get; }
Property Value
Remarks
Stability: Deprecated
TaskDefinition
The EC2 Task Definition in this construct.
public virtual Ec2TaskDefinition TaskDefinition { get; }
Property Value