Skip to content
v2.274.0

ApplicationTargetProps Struct ​

Properties to define an application target group.

Example ​

ts
// 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 ​

containerPortnumbercontainer_portint | floatcontainerPortNumberContainerPortdoubleContainerPort*float64required#
The port number of the container.

Only applicable when using application/network load balancers.

hostHeaderstringhost_headerstrhostHeaderStringHostHeaderstringHostHeader*string= No host condition#
Rule applies if the requested host matches the indicated host.

May contain up to three '*' wildcards.

Requires that priority is set.

listenerstringlistenerstrlistenerStringListenerstringListener*string= default listener (first added li…#
Name of the listener the target group attached to.
default

Default: default listener (first added listener)

pathPatternstringpath_patternstrpathPatternStringPathPatternstringPathPattern*string= 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.

prioritynumberpriorityint | floatpriorityNumberPrioritydoublePriority*float64= Target groups are used as defaul…#
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.

default

Default: Target groups are used as defaults

protocolProtocolprotocolProtocolprotocolProtocolProtocolProtocolProtocolProtocol= ecs.Protocol.TCP#
The protocol used for the port mapping.

Only applicable when using application load balancers.