AddFixedResponseProps

class aws_cdk.aws_elasticloadbalancingv2.AddFixedResponseProps(*, host_header=None, path_pattern=None, priority=None, status_code, content_type=None, message_body=None)

Bases: aws_cdk.aws_elasticloadbalancingv2.AddRuleProps, aws_cdk.aws_elasticloadbalancingv2.FixedResponse

__init__(*, host_header=None, path_pattern=None, priority=None, status_code, content_type=None, message_body=None)

Properties for adding a fixed response to a listener.

Parameters
  • 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

  • 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

  • status_code (str) – The HTTP response code (2XX, 4XX or 5XX).

  • content_type (Optional[ContentType]) – The content type. Default: text/plain

  • message_body (Optional[str]) – The message. Default: no message

Attributes

content_type

The content type.

default :default: text/plain

Return type

Optional[ContentType]

host_header

Rule applies if the requested host matches the indicated host.

May contain up to three ‘*’ wildcards.

Requires that priority is set.

default :default: No host condition

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

Return type

Optional[str]

message_body

The message.

default :default: no message

Return type

Optional[str]

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 :default: No path condition

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

Return type

Optional[str]

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 :default: Target groups are used as defaults

Return type

Union[int, float, None]

status_code

The HTTP response code (2XX, 4XX or 5XX).

Return type

str