Class: TerraspacePluginAws::Interfaces::Summary

Inherits:
Object
  • Object
show all
Includes:
Terraspace::Plugin::Summary::Interface, Clients
Defined in:
lib/terraspace_plugin_aws/interfaces/summary.rb

Instance Method Summary collapse

Methods included from Clients

#dynamodb, #s3, #secretsmanager, #ssm, #sts

Instance Method Details

#delete_empty_statefile(key) ⇒ Object

interface method



21
22
23
24
# File 'lib/terraspace_plugin_aws/interfaces/summary.rb', line 21

def delete_empty_statefile(key)
  delete_lock_id(key)
  delete_s3_file(key)
end

#downloadObject

interface method



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/terraspace_plugin_aws/interfaces/summary.rb', line 7

def download
  resp = s3.list_objects(bucket: @bucket, prefix: @folder)
  resp.contents.each do |content|
    local_path = "#{@dest}/#{content.key}"
    FileUtils.mkdir_p(File.dirname(local_path))
    s3.get_object(
      response_target: local_path,
      bucket: @bucket,
      key: content.key,
    )
  end
end