Class: AWSCDK::S3::CfnBucket::RedirectRuleProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::S3::CfnBucket::RedirectRuleProperty
- Defined in:
- s3/cfn_bucket.rb
Overview
Specifies how requests are redirected.
In the event of an error, you can specify a different error code to return.
Instance Attribute Summary collapse
-
#host_name ⇒ String?
readonly
The host name to use in the redirect request.
-
#http_redirect_code ⇒ String?
readonly
The HTTP redirect code to use on the response.
-
#protocol ⇒ String?
readonly
Protocol to use when redirecting requests.
-
#replace_key_prefix_with ⇒ String?
readonly
The object key prefix to use in the redirect request.
-
#replace_key_with ⇒ String?
readonly
The specific object key to use in the redirect request.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host_name: nil, http_redirect_code: nil, protocol: nil, replace_key_prefix_with: nil, replace_key_with: nil) ⇒ RedirectRuleProperty
constructor
A new instance of RedirectRuleProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(host_name: nil, http_redirect_code: nil, protocol: nil, replace_key_prefix_with: nil, replace_key_with: nil) ⇒ RedirectRuleProperty
Returns a new instance of RedirectRuleProperty.
3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 |
# File 's3/cfn_bucket.rb', line 3220 def initialize(host_name: nil, http_redirect_code: nil, protocol: nil, replace_key_prefix_with: nil, replace_key_with: nil) @host_name = host_name Jsii::Type.check_type(@host_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostName") unless @host_name.nil? @http_redirect_code = http_redirect_code Jsii::Type.check_type(@http_redirect_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpRedirectCode") unless @http_redirect_code.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "protocol") unless @protocol.nil? @replace_key_prefix_with = replace_key_prefix_with Jsii::Type.check_type(@replace_key_prefix_with, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "replaceKeyPrefixWith") unless @replace_key_prefix_with.nil? @replace_key_with = replace_key_with Jsii::Type.check_type(@replace_key_with, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "replaceKeyWith") unless @replace_key_with.nil? end |
Instance Attribute Details
#host_name ⇒ String? (readonly)
The host name to use in the redirect request.
3237 3238 3239 |
# File 's3/cfn_bucket.rb', line 3237 def host_name @host_name end |
#http_redirect_code ⇒ String? (readonly)
The HTTP redirect code to use on the response.
Not required if one of the siblings is present.
3244 3245 3246 |
# File 's3/cfn_bucket.rb', line 3244 def http_redirect_code @http_redirect_code end |
#protocol ⇒ String? (readonly)
Protocol to use when redirecting requests.
The default is the protocol that is used in the original request.
3251 3252 3253 |
# File 's3/cfn_bucket.rb', line 3251 def protocol @protocol end |
#replace_key_prefix_with ⇒ String? (readonly)
The object key prefix to use in the redirect request.
For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/ , you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
3260 3261 3262 |
# File 's3/cfn_bucket.rb', line 3260 def replace_key_prefix_with @replace_key_prefix_with end |
#replace_key_with ⇒ String? (readonly)
The specific object key to use in the redirect request.
For example, redirect request to error.html . Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
3269 3270 3271 |
# File 's3/cfn_bucket.rb', line 3269 def replace_key_with @replace_key_with end |
Class Method Details
.jsii_properties ⇒ Object
3271 3272 3273 3274 3275 3276 3277 3278 3279 |
# File 's3/cfn_bucket.rb', line 3271 def self.jsii_properties { :host_name => "hostName", :http_redirect_code => "httpRedirectCode", :protocol => "protocol", :replace_key_prefix_with => "replaceKeyPrefixWith", :replace_key_with => "replaceKeyWith", } end |
Instance Method Details
#to_jsii ⇒ Object
3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 |
# File 's3/cfn_bucket.rb', line 3281 def to_jsii result = {} result.merge!({ "hostName" => @host_name, "httpRedirectCode" => @http_redirect_code, "protocol" => @protocol, "replaceKeyPrefixWith" => @replace_key_prefix_with, "replaceKeyWith" => @replace_key_with, }) result.compact end |