Class: AWS::S3::WebsiteConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/s3/website_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ WebsiteConfiguration

Returns a new instance of WebsiteConfiguration.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :redirect_all_requests_to (Hash)

    Describes the redirect behavior for every request to this bucket's website endpoint. If this element is present, no other options are are allowed.

    • :host_name - (required, String) Name of the host where requests will be redirected.
    • :protocol - (String) Protocol to use (http, https) when redirecting requests. The default is the protocol that is used in the original request.
  • :index_document (Hash)
    • :suffix - (required, String) - A suffix that is appended to a request that is for a directory on the website endpoint (e.g. if the suffix is index.html and you make a request to samplebucket/images/ the data that is returned will be for the object with the key name images/index.html). The suffix must not be empty and must not include a slash character.
  • :error_document (Hash)
    • :key - (required, String) - The object key name to use when a 4XX class error occurs.
  • :routing_rules (Array<Hash>)
    • :redirect - (required, Hash)
      • :host_name - (String)
      • :protocol - (String)
      • :replace_key_prefix_with - (String)
      • :replace_key_with - (String)
      • :http_redirect_code - (String)
    • :condition - (Hash)
      • :key_prefix_equals - (String)
      • :http_error_code_returned_equals - (String)


51
52
53
54
55
56
57
# File 'lib/aws/s3/website_configuration.rb', line 51

def initialize options = {}
  @options = deep_copy(options)
  if @options.empty?
    @options[:index_document] = { :suffix => 'index.html' }
    @options[:error_document] = { :key => 'error.html' }
  end
end

Instance Attribute Details

#optionsHash (readonly) Also known as: to_hash

Returns:

  • (Hash)


60
61
62
# File 'lib/aws/s3/website_configuration.rb', line 60

def options
  @options
end