Sha256: 2c3b5db90dd23c96a5ca01ac9501ce7a50ca5027a4747481420ee150501e2635

Contents?: true

Size: 1.45 KB

Versions: 32

Compression:

Stored size: 1.45 KB

Contents

require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        ##
        # AWS::Lambda::Function
        ##
        class Lambda < Resource
          type 'AWS::Lambda::Function'
          property :function_name, 'FunctionName'
          property :description, 'Description'
          property :handler, 'Handler'
          property :memory_size, 'MemorySize'
          property :runtime, 'Runtime'
          property :timeout, 'Timeout'
          property :role, 'Role'
          # psuedo-property definitions. We add the expected name as a nested DSL for these below.
          property :env, 'Environment'
          property :function_code, 'Code'
          property :vpc_cfg, 'VpcConfig'

          # Add code block
          def code(&block)
            function_code = ResourceProperty::LambdaFunctionCode.new(self)
            function_code.instance_exec(&block) if block
            properties['Code'].set(function_code)
          end

          def environment(&block)
            env = ResourceProperty::LambdaEnvironment.new(self)
            env.instance_exec(&block) if block
            properties['Environment'].set(env)
          end

          # Add vpc_config block
          def vpc_config(&block)
            vpc_cfg = ResourceProperty::LambdaVpcConfig.new(self)
            vpc_cfg.instance_exec(&block) if block
            properties['VpcConfig'].set(vpc_cfg)
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
convection-2.2.25 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.24 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.23 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.22 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.21 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.20 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.19 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.18 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.17 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.16 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.15 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.14 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.13 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.12 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.11 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.10 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.9 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.8 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.7 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.6 lib/convection/model/template/resource/aws_lambda_function.rb