Class: Convection::Model::Template::Resource::CloudFrontDistribution

Inherits:
Convection::Model::Template::Resource show all
Includes:
Mixin::Taggable
Defined in:
lib/convection/model/template/resource/aws_cloudfront_distribution.rb

Overview

Creates an Amazon CloudFront web distribution.

Examples:

cloudfront_distribution 'MySiteWebsite' do
  config do
    cname 'mysite.example.com'
    default_root_object 'index.html'
    price_class 'PriceClass_100'
    default_cache_behavior do
      forwarded_values do
        query_string false
      end
      target_origin 's3-mysite-bucket'
      viewer_protocol_policy 'redirect-to-https'
    end
    origin do
      id 's3-mysite-bucket'
      domain_name "mysite.example.com.s3-website-#{stack.region}.amazonaws.com"
      custom_origin do
        protocol_policy 'http-only'
      end
    end
    viewer_certificate do
      iam_certificate 'EXAMPLECERTID'
      minimum_protocol_version 'TLSv1'
      ssl_support_method 'sni-only'
    end
  end
end

See Also:

Instance Attribute Summary

Attributes inherited from Convection::Model::Template::Resource

#exist, #name, #parent, #properties, #resource_attributes, #template

Instance Method Summary collapse

Methods included from Mixin::Taggable

#immutable_metadata, #render_tags, #tag, #tags

Methods inherited from Convection::Model::Template::Resource

#as_attribute, attach_method, #deletion_policy, #depends_on, #initialize, properties, #property, property, #reference, type, #type, #with_output

Methods included from Mixin::Conditional

#condition, #render_condition

Methods included from DSL::Template::Resource

attach_resource

Methods included from DSL::Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from DSL::IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_not, #fn_or, #fn_ref, #get_att, #get_azs, #join, #select

Constructor Details

This class inherits a constructor from Convection::Model::Template::Resource

Instance Method Details

#config(&block) ⇒ Object

Append a network interface to network_interfaces



43
# File 'lib/convection/model/template/resource/aws_cloudfront_distribution.rb', line 43

property :config, 'DistributionConfig'

#render(*args) ⇒ Object



49
50
51
52
53
# File 'lib/convection/model/template/resource/aws_cloudfront_distribution.rb', line 49

def render(*args)
  super.tap do |resource|
    render_tags(resource)
  end
end