Class: CloudFormationTool::CLI::Invalidate

Inherits:
Clamp::Command
  • Object
show all
Includes:
CloudFormationTool
Defined in:
lib/cloud_formation_tool/cli/invalidate.rb

Constant Summary

Constants included from CloudFormationTool

VERSION

Instance Method Summary collapse

Methods included from CloudFormationTool

#aws_config, #awsas, #awscdn, #awscf, #awscreds, #awsec2, #awsecs, #awss3, #cf_bucket_name, #find_profile, #profile, #region, #s3_bucket_name

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cloud_formation_tool/cli/invalidate.rb', line 9

def execute
  st = CloudFormation::Stack.new(stack_name)
  st.cdns.collect do |res|
    Thread.new do
      log "Creating cache invalidation for #{res.distribution.id} #{res.domain_names} /*"
      inv = res.invalidate("/*")
      log "Invalidation #{inv.id}: #{inv.status}"
      inv.wait
      log "Invalidation #{inv.id}: #{inv.status}"
    end
  end.each(&:join).length > 0 or error "No valid CloudFront distributions found"
end