class Cumulus::CloudFront::InvalidationConfig

Public: An object representing configuration for a CloudFront invalidation

Attributes

distribution_id[R]
name[R]
paths[R]

Public Class Methods

new(name, json = nil) click to toggle source

Public: Constructor

json - a hash containing the JSON configuration for the invalidation

# File lib/cloudfront/models/InvalidationConfig.rb, line 14
def initialize(name, json = nil)
  if json
    @name = name

    begin
      @distribution_id = json.fetch("distribution-id")
    rescue KeyError
      puts "Must supply 'distribution-id' in invalidation config"
      exit
    end

    begin
      @paths = json.fetch("paths")
    rescue KeyError
      puts "Must supply 'paths' in invalidation config"
      exit
    end

  end
end