def set_distribution_config(aws_id, config)
cnames_str = ''
unless config[:cnames].blank?
config[:cnames].to_a.each { |cname| cnames_str += "\n <CNAME>#{cname}</CNAME>" }
end
body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<DistributionConfig xmlns=\#{xmlns}>\n<Origin>\#{config[:origin]}</Origin>\n<CallerReference>\#{config[:caller_reference]}</CallerReference>\n\#{cnames_str.lstrip}\n<Comment>\#{AcfInterface::escape(config[:comment].to_s)}</Comment>\n<Enabled>\#{config[:enabled]}</Enabled>\n</DistributionConfig>\n"
request_hash = generate_request('PUT', "distribution/#{aws_id}/config", body.strip,
'If-Match' => config[:e_tag])
request_info(request_hash, RightHttp2xxParser.new)
end