RedirectResponse

class aws_cdk.aws_elasticloadbalancingv2.RedirectResponse(*, status_code, host=None, path=None, port=None, protocol=None, query=None)

Bases: object

__init__(*, status_code, host=None, path=None, port=None, protocol=None, query=None)

A redirect response.

Parameters
  • status_code (str) – The HTTP redirect code (HTTP_301 or HTTP_302).

  • host (Optional[str]) – The hostname. This component is not percent-encoded. The hostname can contain #{host}. Default: origin host of request

  • path (Optional[str]) – The absolute path, starting with the leading “/”. This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}. Default: origin path of request

  • port (Optional[str]) – The port. You can specify a value from 1 to 65535 or #{port}. Default: origin port of request

  • protocol (Optional[str]) – The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You cannot redirect HTTPS to HTTP. Default: origin protocol of request

  • query (Optional[str]) – The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading “?”, as it is automatically added. You can specify any of the reserved keywords. Default: origin query string of request

Attributes

host

The hostname.

This component is not percent-encoded. The hostname can contain #{host}.

default :default: origin host of request

Return type

Optional[str]

path

The absolute path, starting with the leading “/”.

This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.

default :default: origin path of request

Return type

Optional[str]

port

The port.

You can specify a value from 1 to 65535 or #{port}.

default :default: origin port of request

Return type

Optional[str]

protocol

The protocol.

You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You cannot redirect HTTPS to HTTP.

default :default: origin protocol of request

Return type

Optional[str]

query

The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading “?”, as it is automatically added. You can specify any of the reserved keywords.

default :default: origin query string of request

Return type

Optional[str]

status_code

The HTTP redirect code (HTTP_301 or HTTP_302).

Return type

str