lib/cloudster/cloud_front.rb in cloudster-2.19.2 vs lib/cloudster/cloud_front.rb in cloudster-2.19.3
- old
+ new
@@ -1,8 +1,10 @@
module Cloudster
#==CloudFront resource
+ #Output values : domain_name
class CloudFront
+ include Cloudster::Output
# Initialize CloudFront
#
# ==== Notes
# options parameter must include values for :name
@@ -39,22 +41,30 @@
s3.template.deep_merge(cloud_front_template)
end
private
def template
- return "Resources" => {
- @name => {
- "Type" => "AWS::CloudFront::Distribution",
- "Properties" => {
- "DistributionConfig" => {
- "S3Origin" => {
- "DNSName"=> {"Fn::GetAtt" => [@instance_name, "DomainName"]},
- },
- "Enabled" => "true"
+ template = { "Resources" => {
+ @name => {
+ "Type" => "AWS::CloudFront::Distribution",
+ "Properties" => {
+ "DistributionConfig" => {
+ "S3Origin" => {
+ "DNSName"=> {"Fn::GetAtt" => [@instance_name, "DomainName"]},
+ },
+ "Enabled" => "true"
+ }
}
- }
+ }
}
}
+ outputs = {
+ @name => {
+ 'domain_name' => {'Fn::GetAtt' => [@name, 'DomainName']}
+ }
+ }
+ template['Outputs'] = output_template(outputs)
+ return template
end
end
end