Class: Bauble::Resources::GemLayer

Inherits:
Resource
  • Object
show all
Defined in:
lib/bauble/resources/gem_layer.rb

Overview

a ruby lambda function

Instance Attribute Summary

Attributes inherited from Resource

#app

Instance Method Summary collapse

Methods inherited from Resource

#initialize, #resource_name

Constructor Details

This class inherits a constructor from Bauble::Resources::Resource

Instance Method Details

#bundleObject



11
12
13
14
15
16
17
# File 'lib/bauble/resources/gem_layer.rb', line 11

def bundle
  FileUtils.mkdir_p("#{@app.config.gem_layer_asset_dir}/#{@app.gem_layer_hash}")

  Bauble::Cli::CodeBundler.docker_bundle_gems(
    gem_path: ".bauble/assets/gem_layer/#{@app.gem_layer_hash}"
  )
end

#synthesizeObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bauble/resources/gem_layer.rb', line 19

def synthesize
  {
    'gemLayer' => {
      'type' => 'aws:lambda:LayerVersion',
      'name' => resource_name('gem_layer'),
      'properties' => {
        'code' => {
          'fn::fileArchive' => "#{@app.config.gem_layer_asset_dir}/#{@app.gem_layer_hash}"
        },
        'layerName' => resource_name('gem_layer'),
        'compatibleRuntimes' => %w[ruby3.2]
      }
    }
  }
end