AddFixedResponseProps

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

Bases: AddRuleProps, FixedResponse

(deprecated) Properties for adding a fixed response to a listener.

Parameters:
  • conditions (Optional[Sequence[ListenerCondition]]) – Rule applies if matches the conditions. Default: - No conditions.

  • host_header (Optional[str]) – (deprecated) 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]) – (deprecated) 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

  • path_patterns (Optional[Sequence[str]]) – (deprecated) Rule applies if the requested path matches any of the given patterns. 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) – (deprecated) The HTTP response code (2XX, 4XX or 5XX).

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

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

Deprecated:

Use ApplicationListener.addAction instead.

Stability:

deprecated

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_elasticloadbalancingv2 as elbv2

# listener_condition: elbv2.ListenerCondition

add_fixed_response_props = elbv2.AddFixedResponseProps(
    status_code="statusCode",

    # the properties below are optional
    conditions=[listener_condition],
    content_type=elbv2.ContentType.TEXT_PLAIN,
    host_header="hostHeader",
    message_body="messageBody",
    path_pattern="pathPattern",
    path_patterns=["pathPatterns"],
    priority=123
)

Attributes

conditions

Rule applies if matches the conditions.

Default:
  • No conditions.

See:

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

content_type

(deprecated) The content type.

Default:

text/plain

Stability:

deprecated

host_header

(deprecated) 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

Deprecated:

Use conditions instead.

See:

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

Stability:

deprecated

message_body

(deprecated) The message.

Default:

no message

Stability:

deprecated

path_pattern

(deprecated) 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

Deprecated:

Use conditions instead.

See:

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

Stability:

deprecated

path_patterns

(deprecated) Rule applies if the requested path matches any of the given patterns.

May contain up to three ‘*’ wildcards.

Requires that priority is set.

Default:
  • No path condition.

Deprecated:

Use conditions instead.

See:

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

Stability:

deprecated

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

status_code

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

Stability:

deprecated