Class: AWSCDK::ElasticLoadBalancingv2::RedirectOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ElasticLoadBalancingv2::RedirectOptions
- Defined in:
- elastic_load_balancingv2/redirect_options.rb
Overview
Options for ListenerAction.redirect().
A URI consists of the following components: protocol://hostname:port/path?query. You must modify at least one of the following components to avoid a redirect loop: protocol, hostname, port, or path. Any components that you do not modify retain their original values.
You can reuse URI components using the following reserved keywords:
#{protocol}#{host}#{port}#{path}(the leading "/" is removed)#{query}
For example, you can change the path to "/new/##path", the hostname to "example.##host", or the query to "##query&value=xyz".
Instance Attribute Summary collapse
-
#host ⇒ String?
readonly
The hostname.
-
#path ⇒ String?
readonly
The absolute path, starting with the leading "/".
-
#permanent ⇒ Boolean?
readonly
The HTTP redirect code.
-
#port ⇒ String?
readonly
The port.
-
#protocol ⇒ String?
readonly
The protocol.
-
#query ⇒ String?
readonly
The query parameters, URL-encoded when necessary, but not percent-encoded.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host: nil, path: nil, permanent: nil, port: nil, protocol: nil, query: nil) ⇒ RedirectOptions
constructor
A new instance of RedirectOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(host: nil, path: nil, permanent: nil, port: nil, protocol: nil, query: nil) ⇒ RedirectOptions
Returns a new instance of RedirectOptions.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 29 def initialize(host: nil, path: nil, permanent: nil, port: nil, protocol: nil, query: nil) @host = host Jsii::Type.check_type(@host, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "host") unless @host.nil? @path = path Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless @path.nil? @permanent = permanent Jsii::Type.check_type(@permanent, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "permanent") unless @permanent.nil? @port = port Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "port") unless @port.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "protocol") unless @protocol.nil? @query = query Jsii::Type.check_type(@query, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "query") unless @query.nil? end |
Instance Attribute Details
#host ⇒ String? (readonly)
Default: - No change
The hostname.
This component is not percent-encoded. The hostname can contain ##host.
50 51 52 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 50 def host @host end |
#path ⇒ String? (readonly)
57 58 59 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 57 def path @path end |
#permanent ⇒ Boolean? (readonly)
Default: false
The HTTP redirect code.
The redirect is either permanent (HTTP 301) or temporary (HTTP 302).
64 65 66 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 64 def permanent @permanent end |
#port ⇒ String? (readonly)
71 72 73 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 71 def port @port end |
#protocol ⇒ String? (readonly)
Default: - No change
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.
78 79 80 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 78 def protocol @protocol end |
#query ⇒ String? (readonly)
Default: - No change
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.
85 86 87 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 85 def query @query end |
Class Method Details
.jsii_properties ⇒ Object
87 88 89 90 91 92 93 94 95 96 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 87 def self.jsii_properties { :host => "host", :path => "path", :permanent => "permanent", :port => "port", :protocol => "protocol", :query => "query", } end |
Instance Method Details
#to_jsii ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'elastic_load_balancingv2/redirect_options.rb', line 98 def to_jsii result = {} result.merge!({ "host" => @host, "path" => @path, "permanent" => @permanent, "port" => @port, "protocol" => @protocol, "query" => @query, }) result.compact end |