class Awspec::Type::CloudfrontDistribution
Constants
- STATUSES
Public Instance Methods
has_origin?(origin_id, domain_name: nil, origin_path: nil, origin_access_identity: nil)
click to toggle source
# File lib/awspec/type/cloudfront_distribution.rb, line 21 def has_origin?(origin_id, domain_name: nil, origin_path: nil, origin_access_identity: nil) return false unless [origin_id, domain_name].any? resource_via_client.origins.items.find do |origin| next false if !origin_id.nil? && origin.id != origin_id next false if !domain_name.nil? && origin.domain_name != domain_name next false if !origin_path.nil? && origin.origin_path != origin_path next false if !origin_access_identity.nil? && \ origin.s3_origin_config.origin_access_identity != origin_access_identity true end end
has_origin_domain_name?(domain_name)
click to toggle source
# File lib/awspec/type/cloudfront_distribution.rb, line 36 def has_origin_domain_name?(domain_name) has_origin?(nil, domain_name: domain_name) end
has_origin_domain_name_and_path?(domain_name_and_path)
click to toggle source
# File lib/awspec/type/cloudfront_distribution.rb, line 40 def has_origin_domain_name_and_path?(domain_name_and_path) domain_name = domain_name_and_path.gsub(%r(/.*\z), '') origin_path = domain_name_and_path.gsub(%r(\A[^/]*), '') has_origin?(nil, domain_name: domain_name, origin_path: origin_path) end
id()
click to toggle source
# File lib/awspec/type/cloudfront_distribution.rb, line 7 def id @id ||= resource_via_client.id if resource_via_client end
resource_via_client()
click to toggle source
# File lib/awspec/type/cloudfront_distribution.rb, line 3 def resource_via_client @resource_via_client ||= find_cloudfront_distribution(@display_name) end