Sha256: dab27a237c77be4e6184691634157a2d35dda1d09470b926d73c740983758f50
Contents?: true
Size: 1.35 KB
Versions: 37
Compression:
Stored size: 1.35 KB
Contents
module Jets::Resource::ApiGateway::BasePath class Function < Jets::Resource::Base include Jets::Resource::Lambda::Function::Environment def definition { base_path_function: { type: "AWS::Lambda::Function", properties: { function_name: function_name, code: { s3_bucket: "!Ref S3Bucket", s3_key: code_s3_key, }, role: "!GetAtt BasePathRole.Arn", handler: handler, runtime: Jets.ruby_runtime, timeout: 60, memory_size: 1536, environment: env_properties[:environment], layers: layers, } } } end def layers return Jets.config.lambda.layers if Jets.config.gems.disable ["!Ref GemLayer"] + Jets.config.lambda.layers end def function_name method = "jets-base-path" # need to add the deployment timestamp because or else function name collides between deploys timestamp = Jets::Resource::ApiGateway::Deployment.timestamp "#{Jets.config.project_namespace}-#{method}-#{timestamp}" end def handler "handlers/functions/jets/base_path.lambda_handler" end def code_s3_key checksum = Jets::Builders::Md5.checksums["stage/code"] "jets/code/code-#{checksum}.zip" # s3_key end end end
Version data entries
37 entries across 37 versions & 2 rubygems