Class NetworkMultipleTargetGroupsFargateService
A Fargate service running on an ECS cluster fronted by a network load balancer.
Inheritance
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.AWS.ECS.Patterns.dll
Syntax (csharp)
public class NetworkMultipleTargetGroupsFargateService : NetworkMultipleTargetGroupsServiceBase, IConstruct, IDependable
Syntax (vb)
Public Class NetworkMultipleTargetGroupsFargateService
Inherits NetworkMultipleTargetGroupsServiceBase
Implements IConstruct, IDependable
Remarks
ExampleMetadata: infused
Examples
// Two network load balancers, each with their own listener and target group.
Cluster cluster;
var loadBalancedFargateService = new NetworkMultipleTargetGroupsFargateService(this, "Service", new NetworkMultipleTargetGroupsFargateServiceProps {
Cluster = cluster,
MemoryLimitMiB = 512,
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
NetworkMultipleTargetGroupsFargateService(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
NetworkMultipleTargetGroupsFargateService(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
NetworkMultipleTargetGroupsFargateService(Construct, String, INetworkMultipleTargetGroupsFargateServiceProps) | Constructs a new instance of the NetworkMultipleTargetGroupsFargateService class. |
Properties
AssignPublicIp | Determines whether the service will be assigned a public IP address. |
Service | The Fargate service in this construct. |
TargetGroup | The default target group for the service. |
TaskDefinition | The Fargate task definition in this construct. |
Constructors
NetworkMultipleTargetGroupsFargateService(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected NetworkMultipleTargetGroupsFargateService(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
NetworkMultipleTargetGroupsFargateService(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected NetworkMultipleTargetGroupsFargateService(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
NetworkMultipleTargetGroupsFargateService(Construct, String, INetworkMultipleTargetGroupsFargateServiceProps)
Constructs a new instance of the NetworkMultipleTargetGroupsFargateService class.
public NetworkMultipleTargetGroupsFargateService(Construct scope, string id, INetworkMultipleTargetGroupsFargateServiceProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props INetworkMultipleTargetGroupsFargateServiceProps
Properties
AssignPublicIp
Determines whether the service will be assigned a public IP address.
public virtual bool AssignPublicIp { get; }
Property Value
System.Boolean
Service
The Fargate service in this construct.
public virtual FargateService Service { get; }
Property Value
TargetGroup
The default target group for the service.
public virtual NetworkTargetGroup TargetGroup { get; }
Property Value
TaskDefinition
The Fargate task definition in this construct.
public virtual FargateTaskDefinition TaskDefinition { get; }
Property Value