Class: AWSCDK::S3::CfnBucket::RoutingRuleConditionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3/cfn_bucket.rb

Overview

A container for describing a condition that must be met for the specified redirect to apply.

For example, 1. If request is for pages in the /docs folder, redirect to the /documents folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_error_code_returned_equals: nil, key_prefix_equals: nil) ⇒ RoutingRuleConditionProperty

Returns a new instance of RoutingRuleConditionProperty.

Parameters:

  • http_error_code_returned_equals (String, nil) (defaults to: nil)

    The HTTP error code when the redirect is applied.

  • key_prefix_equals (String, nil) (defaults to: nil)

    The object key name prefix when the redirect is applied.



3814
3815
3816
3817
3818
3819
# File 's3/cfn_bucket.rb', line 3814

def initialize(http_error_code_returned_equals: nil, key_prefix_equals: nil)
  @http_error_code_returned_equals = http_error_code_returned_equals
  Jsii::Type.check_type(@http_error_code_returned_equals, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpErrorCodeReturnedEquals") unless @http_error_code_returned_equals.nil?
  @key_prefix_equals = key_prefix_equals
  Jsii::Type.check_type(@key_prefix_equals, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyPrefixEquals") unless @key_prefix_equals.nil?
end

Instance Attribute Details

#http_error_code_returned_equalsString? (readonly)

The HTTP error code when the redirect is applied.

In the event of an error, if the error code equals this value, then the specified redirect is applied.

Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied.



3829
3830
3831
# File 's3/cfn_bucket.rb', line 3829

def http_error_code_returned_equals
  @http_error_code_returned_equals
end

#key_prefix_equalsString? (readonly)

The object key name prefix when the redirect is applied.

For example, to redirect requests for ExamplePage.html , the key prefix will be ExamplePage.html . To redirect request for all pages with the prefix docs/ , the key prefix will be docs/ , which identifies all objects in the docs/ folder.

Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied.



3838
3839
3840
# File 's3/cfn_bucket.rb', line 3838

def key_prefix_equals
  @key_prefix_equals
end

Class Method Details

.jsii_propertiesObject



3840
3841
3842
3843
3844
3845
# File 's3/cfn_bucket.rb', line 3840

def self.jsii_properties
  {
    :http_error_code_returned_equals => "httpErrorCodeReturnedEquals",
    :key_prefix_equals => "keyPrefixEquals",
  }
end

Instance Method Details

#to_jsiiObject



3847
3848
3849
3850
3851
3852
3853
3854
# File 's3/cfn_bucket.rb', line 3847

def to_jsii
  result = {}
  result.merge!({
    "httpErrorCodeReturnedEquals" => @http_error_code_returned_equals,
    "keyPrefixEquals" => @key_prefix_equals,
  })
  result.compact
end