Class: AWSCDK::S3::CfnBucket::RoutingRuleProperty

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

Overview

Specifies the redirect behavior and when a redirect is applied.

For more information about routing rules, see Configuring advanced conditional redirects in the Amazon S3 User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(redirect_rule:, routing_rule_condition: nil) ⇒ RoutingRuleProperty

Returns a new instance of RoutingRuleProperty.

Parameters:



3867
3868
3869
3870
3871
3872
# File 's3/cfn_bucket.rb', line 3867

def initialize(redirect_rule:, routing_rule_condition: nil)
  @redirect_rule = redirect_rule.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::RedirectRuleProperty.new(**redirect_rule.transform_keys(&:to_sym)) : redirect_rule
  Jsii::Type.check_type(@redirect_rule, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuUmVkaXJlY3RSdWxlUHJvcGVydHkifV19fQ==")), "redirectRule")
  @routing_rule_condition = routing_rule_condition.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::RoutingRuleConditionProperty.new(**routing_rule_condition.transform_keys(&:to_sym)) : routing_rule_condition
  Jsii::Type.check_type(@routing_rule_condition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuUm91dGluZ1J1bGVDb25kaXRpb25Qcm9wZXJ0eSJ9XX19")), "routingRuleCondition") unless @routing_rule_condition.nil?
end

Instance Attribute Details

#redirect_ruleAWSCDK::IResolvable, AWSCDK::S3::CfnBucket::RedirectRuleProperty (readonly)

Container for redirect information.

You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.



3880
3881
3882
# File 's3/cfn_bucket.rb', line 3880

def redirect_rule
  @redirect_rule
end

#routing_rule_conditionAWSCDK::IResolvable, ... (readonly)

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.



3887
3888
3889
# File 's3/cfn_bucket.rb', line 3887

def routing_rule_condition
  @routing_rule_condition
end

Class Method Details

.jsii_propertiesObject



3889
3890
3891
3892
3893
3894
# File 's3/cfn_bucket.rb', line 3889

def self.jsii_properties
  {
    :redirect_rule => "redirectRule",
    :routing_rule_condition => "routingRuleCondition",
  }
end

Instance Method Details

#to_jsiiObject



3896
3897
3898
3899
3900
3901
3902
3903
# File 's3/cfn_bucket.rb', line 3896

def to_jsii
  result = {}
  result.merge!({
    "redirectRule" => @redirect_rule,
    "routingRuleCondition" => @routing_rule_condition,
  })
  result.compact
end