aws-cdk-lib.aws_ecs_patterns.ApplicationTargetProps

interface ApplicationTargetProps

LanguageType name
.NETAmazon.CDK.AWS.ECS.Patterns.ApplicationTargetProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecspatterns#ApplicationTargetProps
Javasoftware.amazon.awscdk.services.ecs.patterns.ApplicationTargetProps
Pythonaws_cdk.aws_ecs_patterns.ApplicationTargetProps
TypeScript (source)aws-cdk-lib » aws_ecs_patterns » ApplicationTargetProps

Properties to define an application target group.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_ecs_patterns as ecs_patterns } from 'aws-cdk-lib';
const applicationTargetProps: ecs_patterns.ApplicationTargetProps = {
  containerPort: 123,

  // the properties below are optional
  hostHeader: 'hostHeader',
  listener: 'listener',
  pathPattern: 'pathPattern',
  priority: 123,
  protocol: ecs.Protocol.TCP,
};

Properties

NameTypeDescription
containerPortnumberThe port number of the container.
hostHeader?stringRule applies if the requested host matches the indicated host.
listener?stringName of the listener the target group attached to.
pathPattern?stringRule applies if the requested path matches the given path pattern.
priority?numberPriority of this target group.
protocol?ProtocolThe protocol used for the port mapping.

containerPort

Type: number

The port number of the container.

Only applicable when using application/network load balancers.


hostHeader?

Type: string (optional, default: No host condition)

Rule applies if the requested host matches the indicated host.

May contain up to three '*' wildcards.

Requires that priority is set.

See also: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#host-conditions


listener?

Type: string (optional, default: default listener (first added listener))

Name of the listener the target group attached to.


pathPattern?

Type: string (optional, default: No path condition)

Rule applies if the requested path matches the given path pattern.

May contain up to three '*' wildcards.

Requires that priority is set.

See also: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#path-conditions


priority?

Type: number (optional, default: Target groups are used as defaults)

Priority of this target group.

The rule with the lowest priority will be used for every request. If priority is not given, these target groups will be added as defaults, and must not have conditions.

Priorities must be unique.


protocol?

Type: Protocol (optional, default: ecs.Protocol.TCP)

The protocol used for the port mapping.

Only applicable when using application load balancers.