ruby/example_code/s3/s3_add_default_sse_encryption.rb
# 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'
  kms_master_key_id = '9041e78c-7a20-4db3-929e-828abEXAMPLE'
  region = 'us-west-2'
  s3_client = Aws::S3::Client.new(region: region)
  if default_bucket_encryption_sse_cmk_set?(
    s3_client,
    bucket_name,
    kms_master_key_id
  )
    puts 'Default encryption state set.'
  else
    puts 'Default encryption state not set.'
  end
end
def run_me bucket_name = 'doc-example-bucket' kms_master_key_id = '9041e78c-7a20-4db3-929e-828abEXAMPLE' region = 'us-west-2' s3_client = Aws :: S3 :: Client . new ( region : region ) if default_bucket_encryption_sse_cmk_set? ( s3_client , bucket_name , kms_master_key_id ) puts 'Default encryption state set.' else puts 'Default encryption state not set.' 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 .