Class: Jets::Resource::ApiGateway::BasePath::Function
Instance Method Summary
collapse
#env_properties, #environment, #jets_env
Methods inherited from Base
#replacements, #resource
Instance Method Details
#code_s3_key ⇒ Object
37
38
39
40
|
# File 'lib/jets/resource/api_gateway/base_path/function.rb', line 37
def code_s3_key
checksum = Jets::Builders::Md5.checksums["stage/code"]
"jets/code/code-#{checksum}.zip"
end
|
#definition ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/jets/resource/api_gateway/base_path/function.rb', line 5
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: "ruby2.5",
timeout: 60,
memory_size: 1536,
environment: env_properties[:environment],
}
}
}
end
|
#function_name ⇒ Object
26
27
28
29
30
31
|
# File 'lib/jets/resource/api_gateway/base_path/function.rb', line 26
def function_name
method = "jets-base-path"
timestamp = Jets::Resource::ApiGateway::Deployment.timestamp
"#{Jets.config.project_namespace}-#{method}-#{timestamp}"
end
|
#handler ⇒ Object
33
34
35
|
# File 'lib/jets/resource/api_gateway/base_path/function.rb', line 33
def handler
"handlers/functions/jets/base_path.lambda_handler"
end
|