ApplicationTargetProps

class aws_cdk.aws_ecs_patterns.ApplicationTargetProps(*, container_port, host_header=None, listener=None, path_pattern=None, priority=None, protocol=None)

Bases: object

Properties to define an application target group.

Parameters:
  • container_port (Union[int, float]) – The port number of the container. Only applicable when using application/network load balancers.

  • host_header (Optional[str]) – Rule applies if the requested host matches the indicated host. May contain up to three ‘*’ wildcards. Requires that priority is set. Default: No host condition

  • listener (Optional[str]) – Name of the listener the target group attached to. Default: - default listener (first added listener)

  • path_pattern (Optional[str]) – Rule applies if the requested path matches the given path pattern. May contain up to three ‘*’ wildcards. Requires that priority is set. Default: No path condition

  • priority (Union[int, float, None]) – 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: Target groups are used as defaults

  • protocol (Optional[Protocol]) – The protocol used for the port mapping. Only applicable when using application load balancers. Default: ecs.Protocol.TCP

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_ecs_patterns as ecs_patterns

application_target_props = ecs_patterns.ApplicationTargetProps(
    container_port=123,

    # the properties below are optional
    host_header="hostHeader",
    listener="listener",
    path_pattern="pathPattern",
    priority=123,
    protocol=ecs.Protocol.TCP
)

Attributes

container_port

The port number of the container.

Only applicable when using application/network load balancers.

host_header

Rule applies if the requested host matches the indicated host.

May contain up to three ‘*’ wildcards.

Requires that priority is set.

Default:

No host condition

See:

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

listener

Name of the listener the target group attached to.

Default:
  • default listener (first added listener)

path_pattern

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

May contain up to three ‘*’ wildcards.

Requires that priority is set.

Default:

No path condition

See:

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

priority

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:

Target groups are used as defaults

protocol

The protocol used for the port mapping.

Only applicable when using application load balancers.

Default:

ecs.Protocol.TCP