ruby/example_code/s3/s3_ruby_bucket_website.rb
def run_me
  bucket_name = 'doc-example-bucket'
  index_document = 'index.html'
  error_document = '404.html'
  region = 'us-west-2'
  s3_client = Aws::S3::Client.new(region: region)

  if bucket_website_configured?(
    s3_client,
    bucket_name,
    index_document,
    error_document
  )
    puts 'Bucket configured as a static website.'
  else
    puts 'Bucket not configured as a static website.'
  end
end
# Replace us-west-2 with the AWS Region you're using for Amazon S3.

Replace us-west-2 with the AWS Region you're using for Amazon S3.
Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .
def run_me
  bucket_name = 'doc-example-bucket'
  index_document = 'index.html'
  error_document = '404.html'
  region = 'us-west-2'
  s3_client = Aws::S3::Client.new(region: region)
  if bucket_website_configured?(
    s3_client,
    bucket_name,
    index_document,
    error_document
  )
    puts 'Bucket configured as a static website.'
  else
    puts 'Bucket not configured as a static website.'
  end
end
def run_me bucket_name = 'doc-example-bucket' index_document = 'index.html' error_document = '404.html' region = 'us-west-2' s3_client = Aws :: S3 :: Client . new ( region : region ) if bucket_website_configured? ( s3_client , bucket_name , index_document , error_document ) puts 'Bucket configured as a static website.' else puts 'Bucket not configured as a static website.' end end
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .