Sha256: 225c020f7dd8033bcfa964b67cac0a75f05e129ed105c1366510999f73de68b4

Contents?: true

Size: 1.14 KB

Versions: 78

Compression:

Stored size: 1.14 KB

Contents

module Jets::Stack::Main::Dsl
  module Base
    def ref(value)
      "!Ref #{value.to_s.camelize}"
    end

    def logical_id(value)
      value.to_s.camelize
    end

    def depends_on(*stacks)
      if stacks == []
        @depends_on
      else
        @depends_on ||= []
        @depends_on += stacks
      end
    end

    # Due to `if Jets::Stack.has_resources?` check early on in the bootstraping process
    # The code has not been built at that point. So we use a placeholder and will replace
    # the placeholder as part of the cfn template build process after the code has been built
    # and the code_s3_key with md5 is available.
    def code_s3_key
      "code_s3_key_placeholder"
    end

    # resource(:hello,
    #   function_name: "hello",
    #   code: {
    #     s3_bucket: "!Ref S3Bucket",
    #     s3_key: code_s3_key
    #   },
    #   description: "Hello world",
    #   handler: handler_function("hello.lambda_handler"),
    #   memory_size: 128,
    #   role: "!Ref IamRole",
    #   runtime: "python3.6",
    #   timeout: 20,
    # )
    def handler(name)
      "handlers/shared/functions/#{name}" # generated handler
    end
  end
end

Version data entries

78 entries across 78 versions & 2 rubygems

Version Path
jets-1.5.1 lib/jets/stack/main/extensions/base.rb
jets-1.5.0 lib/jets/stack/main/extensions/base.rb
jets-1.4.11 lib/jets/stack/main/extensions/base.rb
jets-1.4.10 lib/jets/stack/main/extensions/base.rb
jets-1.4.9 lib/jets/stack/main/extensions/base.rb
jets-1.4.8 lib/jets/stack/main/extensions/base.rb
jets-1.4.7 lib/jets/stack/main/extensions/base.rb
jets-1.4.6 lib/jets/stack/main/extensions/base.rb
jets-1.4.5 lib/jets/stack/main/extensions/base.rb
jets-1.4.4 lib/jets/stack/main/extensions/base.rb
jets-1.4.3 lib/jets/stack/main/extensions/base.rb
jets-1.4.2 lib/jets/stack/main/extensions/base.rb
jets-1.4.1 lib/jets/stack/main/extensions/base.rb
jets-1.4.0 lib/jets/stack/main/extensions/base.rb
jets-1.3.9 lib/jets/stack/main/extensions/base.rb
jets-1.3.8 lib/jets/stack/main/extensions/base.rb
jets-1.3.7 lib/jets/stack/main/extensions/base.rb
jets-1.3.6 lib/jets/stack/main/extensions/base.rb
jets-1.3.5 lib/jets/stack/main/extensions/base.rb
jets-1.3.4 lib/jets/stack/main/extensions/base.rb