Class ApplicationMultipleTargetGroupsFargateService
A Fargate service running on an ECS cluster fronted by an application load balancer.
Inheritance
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApplicationMultipleTargetGroupsFargateService : ApplicationMultipleTargetGroupsServiceBase
Syntax (vb)
Public Class ApplicationMultipleTargetGroupsFargateService
Inherits ApplicationMultipleTargetGroupsServiceBase
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CertificateManager;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.ElasticLoadBalancingV2;
using Amazon.CDK.AWS.Route53;
var vpc = new Vpc(this, "Vpc", new VpcProps { MaxAzs = 1 });
var loadBalancedFargateService = new ApplicationMultipleTargetGroupsFargateService(this, "myService", new ApplicationMultipleTargetGroupsFargateServiceProps {
Cluster = new Cluster(this, "EcsCluster", new ClusterProps { Vpc = vpc }),
MemoryLimitMiB = 256,
TaskImageOptions = new ApplicationLoadBalancedTaskImageProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
},
EnableExecuteCommand = true,
LoadBalancers = new [] { new ApplicationLoadBalancerProps {
Name = "lb",
IdleTimeout = Duration.Seconds(400),
DomainName = "api.example.com",
DomainZone = new PublicHostedZone(this, "HostedZone", new PublicHostedZoneProps { ZoneName = "example.com" }),
Listeners = new [] { new ApplicationListenerProps {
Name = "listener",
Protocol = ApplicationProtocol.HTTPS,
Certificate = Certificate.FromCertificateArn(this, "Cert", "helloworld"),
SslPolicy = SslPolicy.TLS12_EXT
} }
}, new ApplicationLoadBalancerProps {
Name = "lb2",
IdleTimeout = Duration.Seconds(120),
DomainName = "frontend.com",
DomainZone = new PublicHostedZone(this, "HostedZone", new PublicHostedZoneProps { ZoneName = "frontend.com" }),
Listeners = new [] { new ApplicationListenerProps {
Name = "listener2",
Protocol = ApplicationProtocol.HTTPS,
Certificate = Certificate.FromCertificateArn(this, "Cert2", "helloworld"),
SslPolicy = SslPolicy.TLS12_EXT
} }
} },
TargetGroups = new [] { new ApplicationTargetProps {
ContainerPort = 80,
Listener = "listener"
}, new ApplicationTargetProps {
ContainerPort = 90,
PathPattern = "a/b/c",
Priority = 10,
Listener = "listener"
}, new ApplicationTargetProps {
ContainerPort = 443,
Listener = "listener2"
}, new ApplicationTargetProps {
ContainerPort = 80,
PathPattern = "a/b/c",
Priority = 10,
Listener = "listener2"
} }
});
Synopsis
Constructors
ApplicationMultipleTargetGroupsFargateService(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ApplicationMultipleTargetGroupsFargateService(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ApplicationMultipleTargetGroupsFargateService(Construct, String, IApplicationMultipleTargetGroupsFargateServiceProps) | Constructs a new instance of the ApplicationMultipleTargetGroupsFargateService class. |
Properties
AssignPublicIp | Determines whether the service will be assigned a public IP address. |
Service | The Fargate service in this construct. |
TargetGroup | (deprecated) The default target group for the service. |
TaskDefinition | The Fargate task definition in this construct. |
Constructors
ApplicationMultipleTargetGroupsFargateService(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ApplicationMultipleTargetGroupsFargateService(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ApplicationMultipleTargetGroupsFargateService(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ApplicationMultipleTargetGroupsFargateService(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ApplicationMultipleTargetGroupsFargateService(Construct, String, IApplicationMultipleTargetGroupsFargateServiceProps)
Constructs a new instance of the ApplicationMultipleTargetGroupsFargateService class.
public ApplicationMultipleTargetGroupsFargateService(Construct scope, string id, IApplicationMultipleTargetGroupsFargateServiceProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IApplicationMultipleTargetGroupsFargateServiceProps
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
(deprecated) The default target group for the service.
public virtual ApplicationTargetGroup TargetGroup { get; }
Property Value
Remarks
Stability: Deprecated
TaskDefinition
The Fargate task definition in this construct.
public virtual FargateTaskDefinition TaskDefinition { get; }
Property Value