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.5 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.4 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.3 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.2 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.1 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.2.0 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.1.2 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.1.1 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.1.0 lib/convection/model/template/resource/aws_lambda_function.rb
convection-2.0.0 lib/convection/model/template/resource/aws_lambda_function.rb
convection-1.1.7 lib/convection/model/template/resource/aws_lambda_function.rb
convection-1.1.5 lib/convection/model/template/resource/aws_lambda_function.rb