5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/chef/provider/aws_s3_bucket.rb', line 5
def action_create
bucket = super
if new_resource.enable_website_hosting
if !bucket.website?
converge_by "Enabling website configuration for bucket #{new_resource.name}" do
bucket.website_configuration = AWS::S3::WebsiteConfiguration.new(
new_resource.website_options)
end
elsif modifies_website_configuration?(bucket)
converge_by "Reconfiguring website configuration for bucket #{new_resource.name} to #{new_resource.website_options}" do
bucket.website_configuration = AWS::S3::WebsiteConfiguration.new(
new_resource.website_options)
end
end
else
if bucket.website?
converge_by "Disabling website configuration for bucket #{new_resource.name}" do
bucket.website_configuration = nil
end
end
end
end
|