Class: Jets::Resource::ChildStack::ApiDeployment
- Inherits:
-
Base
- Object
- Base
- Base
- Jets::Resource::ChildStack::ApiDeployment
show all
- Defined in:
- lib/jets/resource/child_stack/api_deployment.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #outputs, #template_url
Methods inherited from Base
#replacements, #resource
Instance Method Details
#definition ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/jets/resource/child_stack/api_deployment.rb', line 8
def definition
{
deployment_id => {
type: "AWS::CloudFormation::Stack",
properties: {
template_url: template_url,
parameters: parameters,
},
depends_on: depends_on,
}
}
end
|
#depends_on ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/jets/resource/child_stack/api_deployment.rb', line 33
def depends_on
expression = "#{Jets::Names.template_path_prefix}-*_controller*"
controller_logical_ids = []
Dir.glob(expression).each do |path|
next unless File.file?(path)
regexp = Regexp.new(".*#{Jets.config.project_namespace}-app-")
controller_name = path.sub(regexp, '').sub('.yml', '')
controller_logical_id = controller_name.underscore.camelize
controller_logical_ids << controller_logical_id
end
controller_logical_ids
end
|
#parameters ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/jets/resource/child_stack/api_deployment.rb', line 21
def parameters
p = {
GemLayer: "!Ref GemLayer",
IamRole: "!GetAtt IamRole.Arn",
RestApi: "!GetAtt ApiGateway.Outputs.RestApi",
S3Bucket: "!Ref S3Bucket",
}
p[:DomainName] = "!GetAtt ApiGateway.Outputs.DomainName" if Jets.custom_domain?
p[:BasePath] = Jets.config.domain.base_path unless Jets.config.domain.base_path.nil?
p
end
|
#template_filename ⇒ Object
54
55
56
|
# File 'lib/jets/resource/child_stack/api_deployment.rb', line 54
def template_filename
"#{Jets.config.project_namespace}-api-deployment.yml"
end
|