jets 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +3 -1
- data/jets.gemspec +2 -0
- data/lib/jets/application.rb +1 -1
- data/lib/jets/cfn.rb +1 -2
- data/lib/jets/cfn/builders.rb +19 -0
- data/lib/jets/cfn/builders/api_deployment_builder.rb +32 -0
- data/lib/jets/cfn/{template_builders → builders}/api_gateway_builder.rb +10 -21
- data/lib/jets/cfn/builders/base_child_builder.rb +49 -0
- data/lib/jets/cfn/{template_builders → builders}/controller_builder.rb +7 -7
- data/lib/jets/cfn/{template_builders → builders}/function_builder.rb +1 -2
- data/lib/jets/cfn/builders/interface.rb +128 -0
- data/lib/jets/cfn/{template_builders → builders}/job_builder.rb +2 -2
- data/lib/jets/cfn/builders/parent_builder.rb +84 -0
- data/lib/jets/cfn/{template_builders → builders}/rule_builder.rb +4 -5
- data/lib/jets/commands/base.rb +1 -1
- data/lib/jets/commands/build.rb +11 -15
- data/lib/jets/commands/delete.rb +12 -0
- data/lib/jets/commands/templates/skeleton/Gemfile.tt +1 -0
- data/lib/jets/commands/templates/skeleton/config/application.rb.tt +1 -1
- data/lib/jets/commands/url.rb +10 -12
- data/lib/jets/controller/base.rb +2 -2
- data/lib/jets/core.rb +1 -1
- data/lib/jets/core_ext/kernel.rb +11 -1
- data/lib/jets/internal/app/controllers/jets/public_controller.rb +11 -8
- data/lib/jets/lambda/dsl.rb +1 -1
- data/lib/jets/lambda/task.rb +9 -1
- data/lib/jets/naming.rb +2 -2
- data/lib/jets/pascalize.rb +9 -1
- data/lib/jets/poly_fun/base_executor.rb +2 -2
- data/lib/jets/preheat.rb +2 -2
- data/lib/jets/rails_overrides/common_methods.rb +1 -1
- data/lib/jets/resource.rb +55 -5
- data/lib/jets/resource/api_gateway.rb +7 -0
- data/lib/jets/resource/{route → api_gateway}/cors.rb +11 -10
- data/lib/jets/resource/api_gateway/deployment.rb +75 -0
- data/lib/jets/resource/{route.rb → api_gateway/method.rb} +26 -22
- data/lib/jets/{cfn/template_mappers/gateway_resource_mapper.rb → resource/api_gateway/resource.rb} +41 -27
- data/lib/jets/resource/api_gateway/rest_api.rb +23 -0
- data/lib/jets/resource/base.rb +17 -0
- data/lib/jets/resource/child_stack.rb +5 -0
- data/lib/jets/resource/child_stack/api_deployment.rb +58 -0
- data/lib/jets/resource/child_stack/api_gateway.rb +29 -0
- data/lib/jets/resource/child_stack/app_class.rb +81 -0
- data/lib/jets/resource/function.rb +184 -0
- data/lib/jets/resource/iam.rb +8 -0
- data/lib/jets/resource/iam/application_role.rb +27 -0
- data/lib/jets/resource/iam/base_role_definition.rb +44 -0
- data/lib/jets/resource/iam/class_role.rb +25 -0
- data/lib/jets/resource/iam/function_role.rb +25 -0
- data/lib/jets/{cfn/template_builders/managed_iam_policy/base_policy.rb → resource/iam/managed_policy.rb} +6 -6
- data/lib/jets/resource/iam/policy_document.rb +43 -0
- data/lib/jets/resource/permission.rb +38 -21
- data/lib/jets/resource/replacer.rb +50 -17
- data/lib/jets/resource/s3.rb +17 -0
- data/lib/jets/route.rb +3 -1
- data/lib/jets/rule/dsl.rb +7 -1
- data/lib/jets/server/route_matcher.rb +2 -1
- data/lib/jets/version.rb +1 -1
- metadata +46 -52
- data/lib/jets/cfn/template_builders.rb +0 -25
- data/lib/jets/cfn/template_builders/api_gateway_deployment_builder.rb +0 -38
- data/lib/jets/cfn/template_builders/base_child_builder.rb +0 -72
- data/lib/jets/cfn/template_builders/function_properties.rb +0 -6
- data/lib/jets/cfn/template_builders/function_properties/base_builder.rb +0 -128
- data/lib/jets/cfn/template_builders/function_properties/node_builder.rb +0 -12
- data/lib/jets/cfn/template_builders/function_properties/python_builder.rb +0 -12
- data/lib/jets/cfn/template_builders/function_properties/ruby_builder.rb +0 -13
- data/lib/jets/cfn/template_builders/iam_policy.rb +0 -6
- data/lib/jets/cfn/template_builders/iam_policy/application_policy.rb +0 -19
- data/lib/jets/cfn/template_builders/iam_policy/base_policy.rb +0 -57
- data/lib/jets/cfn/template_builders/iam_policy/class_policy.rb +0 -20
- data/lib/jets/cfn/template_builders/iam_policy/function_policy.rb +0 -21
- data/lib/jets/cfn/template_builders/interface.rb +0 -97
- data/lib/jets/cfn/template_builders/managed_iam_policy.rb +0 -6
- data/lib/jets/cfn/template_builders/managed_iam_policy/application_policy.rb +0 -11
- data/lib/jets/cfn/template_builders/managed_iam_policy/class_policy.rb +0 -10
- data/lib/jets/cfn/template_builders/managed_iam_policy/function_policy.rb +0 -10
- data/lib/jets/cfn/template_builders/parent_builder.rb +0 -95
- data/lib/jets/cfn/template_builders/templates/minimal-stack.yml +0 -9
- data/lib/jets/cfn/template_mappers.rb +0 -22
- data/lib/jets/cfn/template_mappers/api_gateway_deployment_mapper.rb +0 -48
- data/lib/jets/cfn/template_mappers/api_gateway_mapper.rb +0 -4
- data/lib/jets/cfn/template_mappers/child_mapper.rb +0 -41
- data/lib/jets/cfn/template_mappers/controller_mapper.rb +0 -36
- data/lib/jets/cfn/template_mappers/function_mapper.rb +0 -4
- data/lib/jets/cfn/template_mappers/iam_policy.rb +0 -6
- data/lib/jets/cfn/template_mappers/iam_policy/application_policy_mapper.rb +0 -37
- data/lib/jets/cfn/template_mappers/iam_policy/base_policy_mapper.rb +0 -49
- data/lib/jets/cfn/template_mappers/iam_policy/class_policy_mapper.rb +0 -42
- data/lib/jets/cfn/template_mappers/iam_policy/function_policy_mapper.rb +0 -42
- data/lib/jets/cfn/template_mappers/job_mapper.rb +0 -4
- data/lib/jets/cfn/template_mappers/lambda_function_mapper.rb +0 -52
- data/lib/jets/cfn/template_mappers/rule_mapper.rb +0 -5
- data/lib/jets/resource/attributes.rb +0 -46
- data/lib/jets/resource/creator.rb +0 -17
- data/lib/jets/resource/replacer/base.rb +0 -98
- data/lib/jets/resource/replacer/config_rule.rb +0 -18
- data/lib/jets/resource/route/attributes.rb +0 -8
@@ -1,12 +0,0 @@
|
|
1
|
-
module Jets::Cfn::TemplateBuilders::FunctionProperties
|
2
|
-
class NodeBuilder < BaseBuilder
|
3
|
-
def default_handler
|
4
|
-
@task.full_handler(:handler) # IE: handlers/controllers/posts/show.handler
|
5
|
-
end
|
6
|
-
|
7
|
-
# https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime
|
8
|
-
def default_runtime
|
9
|
-
"nodejs8.10"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Jets::Cfn::TemplateBuilders::FunctionProperties
|
2
|
-
class PythonBuilder < BaseBuilder
|
3
|
-
def default_handler
|
4
|
-
@task.full_handler(:lambda_handler) # IE: handlers/controllers/posts/show.lambda_handler
|
5
|
-
end
|
6
|
-
|
7
|
-
# https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime
|
8
|
-
def default_runtime
|
9
|
-
"python3.6"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module Jets::Cfn::TemplateBuilders::FunctionProperties
|
2
|
-
class RubyBuilder < BaseBuilder
|
3
|
-
def default_runtime
|
4
|
-
"nodejs8.10" # using node shim for ruby support
|
5
|
-
end
|
6
|
-
|
7
|
-
# Override this in subclasses like PythonBuilder.
|
8
|
-
# Dynamically generated handler.
|
9
|
-
def default_handler
|
10
|
-
map.handler # IE: handlers/controllers/posts_controllers.index
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
module Jets::Cfn::TemplateBuilders::IamPolicy
|
2
|
-
autoload :ApplicationPolicy, "jets/cfn/template_builders/iam_policy/application_policy"
|
3
|
-
autoload :BasePolicy, "jets/cfn/template_builders/iam_policy/base_policy"
|
4
|
-
autoload :ClassPolicy, "jets/cfn/template_builders/iam_policy/class_policy"
|
5
|
-
autoload :FunctionPolicy, "jets/cfn/template_builders/iam_policy/function_policy"
|
6
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# Implements:
|
2
|
-
# initialize
|
3
|
-
# policy_name
|
4
|
-
#
|
5
|
-
module Jets::Cfn::TemplateBuilders::IamPolicy
|
6
|
-
class ApplicationPolicy < BasePolicy
|
7
|
-
def initialize
|
8
|
-
setup
|
9
|
-
@definitions = Jets.config.iam_policy # config.iam_policy contains definitions
|
10
|
-
@definitions = [@definitions].flatten if @definitions
|
11
|
-
end
|
12
|
-
|
13
|
-
# Example: PostsControllerPolicy or SleepJobPolicy
|
14
|
-
# Note: There is no "method" in the name
|
15
|
-
def policy_name
|
16
|
-
"ApplicationPolicy"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# Classes that inherit this Base class should implement:
|
2
|
-
#
|
3
|
-
# initialize - should call setup in it
|
4
|
-
# policy_name
|
5
|
-
#
|
6
|
-
module Jets::Cfn::TemplateBuilders::IamPolicy
|
7
|
-
class BasePolicy
|
8
|
-
extend Memoist
|
9
|
-
|
10
|
-
attr_reader :definitions
|
11
|
-
# Not using initialize because method signature is different
|
12
|
-
def setup
|
13
|
-
# empty starting policy that will be changed
|
14
|
-
@policy = {
|
15
|
-
"Version" => "2012-10-17",
|
16
|
-
"Statement" => []
|
17
|
-
}
|
18
|
-
# https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html
|
19
|
-
@sid = 0 # counter
|
20
|
-
end
|
21
|
-
|
22
|
-
def policy_document
|
23
|
-
definitions.map { |definition| standardize(definition) }
|
24
|
-
# Thanks: https://www.mnishiguchi.com/2017/11/29/rails-hash-camelize-and-underscore-keys/
|
25
|
-
@policy.deep_transform_keys! { |key| key.to_s.camelize }
|
26
|
-
end
|
27
|
-
memoize :policy_document # only process policy_document once
|
28
|
-
|
29
|
-
def standardize(definition)
|
30
|
-
@sid += 1
|
31
|
-
case definition
|
32
|
-
when String
|
33
|
-
@policy["Statement"] << {
|
34
|
-
sid: "Stmt#{@sid}",
|
35
|
-
action: [definition],
|
36
|
-
effect: "Allow",
|
37
|
-
resource: "*",
|
38
|
-
}
|
39
|
-
when Hash
|
40
|
-
definition = definition.stringify_keys
|
41
|
-
if definition.key?("Version") # special case where we replace the policy entirely
|
42
|
-
@policy = definition
|
43
|
-
else
|
44
|
-
@policy["Statement"] << definition
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Need to underscore and then classify again for this case:
|
50
|
-
# Jets::PreheatJob_policy => JetsPreheatJobPolicy
|
51
|
-
# Or else you we get this:
|
52
|
-
# Jets::PreheatJob_policy => JetsPreheatjobPolicy
|
53
|
-
def classify_name(text)
|
54
|
-
text.gsub('::','_').underscore.classify
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# Implements:
|
2
|
-
# initialize
|
3
|
-
# policy_name
|
4
|
-
#
|
5
|
-
module Jets::Cfn::TemplateBuilders::IamPolicy
|
6
|
-
class ClassPolicy < BasePolicy
|
7
|
-
def initialize(app_class)
|
8
|
-
setup
|
9
|
-
@app_class = app_class
|
10
|
-
# IE: @app_class: PostsController, HardJob, Hello, HelloFunction
|
11
|
-
@definitions = app_class.class_iam_policy || [] # class_iam_policy contains definitions
|
12
|
-
end
|
13
|
-
|
14
|
-
# Example: PostsControllerPolicy or SleepJobPolicy
|
15
|
-
# Note: There is no "method" in the name
|
16
|
-
def policy_name
|
17
|
-
classify_name("#{@app_class}_policy")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Implements:
|
2
|
-
# initialize
|
3
|
-
# policy_name
|
4
|
-
#
|
5
|
-
module Jets::Cfn::TemplateBuilders::IamPolicy
|
6
|
-
class FunctionPolicy < BasePolicy
|
7
|
-
def initialize(task)
|
8
|
-
setup
|
9
|
-
@task = task
|
10
|
-
@app_class = task.class_name.to_s
|
11
|
-
# IE: @app_class: PostsController, HardJob, Hello, HelloFunction
|
12
|
-
|
13
|
-
@definitions = task.iam_policy || [] # iam_policy contains definitions
|
14
|
-
end
|
15
|
-
|
16
|
-
# Example: PostsControllerIndexPolicy or SleepJobPerformPolicy
|
17
|
-
def policy_name
|
18
|
-
classify_name("#{@app_class}_#{@task.meth}_policy")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# The class including this module should implement these methods:
|
2
|
-
#
|
3
|
-
# * compose
|
4
|
-
# * template_path
|
5
|
-
class Jets::Cfn::TemplateBuilders
|
6
|
-
module Interface
|
7
|
-
extend Memoist
|
8
|
-
|
9
|
-
def build
|
10
|
-
# Do not bother building
|
11
|
-
# or writing the template unless there are functions defined
|
12
|
-
return if @app_klass && !@app_klass.build?
|
13
|
-
|
14
|
-
compose # must be implemented by subclass
|
15
|
-
write
|
16
|
-
end
|
17
|
-
|
18
|
-
def write
|
19
|
-
FileUtils.mkdir_p(File.dirname(template_path))
|
20
|
-
IO.write(template_path, text)
|
21
|
-
end
|
22
|
-
|
23
|
-
def template
|
24
|
-
# need the to_hash or the YAML dump has
|
25
|
-
# !ruby/hash:ActiveSupport::HashWithIndifferentAccess
|
26
|
-
@template.to_hash
|
27
|
-
end
|
28
|
-
|
29
|
-
def text
|
30
|
-
text = YAML.dump(template)
|
31
|
-
post_process_template(text)
|
32
|
-
end
|
33
|
-
|
34
|
-
# post process the text so that
|
35
|
-
# "!Ref IamRole" => !Ref IamRole
|
36
|
-
# We strip the surrounding quotes
|
37
|
-
def post_process_template(text)
|
38
|
-
results = text.split("\n").map do |line|
|
39
|
-
if line.include?(': "!') # IE: IamRole: "!Ref IamRole",
|
40
|
-
# IamRole: "!Ref IamRole" => IamRole: !Ref IamRole
|
41
|
-
line.sub(/: "(.*)"/, ': \1')
|
42
|
-
elsif line.include?('- "!') # IE: - "!GetAtt Foo.Arn"
|
43
|
-
# IamRole: - "!GetAtt Foo.Arn" => - !GetAtt Foo.Arn
|
44
|
-
line.sub(/- "(.*)"/, '- \1')
|
45
|
-
else
|
46
|
-
line
|
47
|
-
end
|
48
|
-
end
|
49
|
-
results.join("\n") + "\n"
|
50
|
-
end
|
51
|
-
|
52
|
-
# add_resource handles an options Hash with both only Properties
|
53
|
-
# and also one with a nested Properties.
|
54
|
-
|
55
|
-
# Example:
|
56
|
-
#
|
57
|
-
# Simple options with properties only:
|
58
|
-
# add_resource("MyId", "AWS::CloudFormationStack",
|
59
|
-
# TemplateURL: "template_url",
|
60
|
-
# Parameters: {},
|
61
|
-
# )
|
62
|
-
#
|
63
|
-
# More complicated options:
|
64
|
-
# add_resource("MyId", "AWS::ApiGateway::RestApi",
|
65
|
-
# Properties: {
|
66
|
-
# Name: "my-api"
|
67
|
-
# },
|
68
|
-
# DependsOn: ["AnotherResource"]
|
69
|
-
# )
|
70
|
-
def add_resource(logical_id, type, options)
|
71
|
-
base = { Type: type }
|
72
|
-
|
73
|
-
options = if options.include?(:Properties)
|
74
|
-
base.merge(options)
|
75
|
-
else
|
76
|
-
{
|
77
|
-
Type: type,
|
78
|
-
Properties: options # options are properties
|
79
|
-
}
|
80
|
-
end
|
81
|
-
|
82
|
-
@template[:Resources][logical_id] = options
|
83
|
-
end
|
84
|
-
|
85
|
-
def add_parameter(name, options={})
|
86
|
-
defaults = { Type: "String" }
|
87
|
-
options = defaults.merge(options)
|
88
|
-
@template[:Parameters] ||= {}
|
89
|
-
@template[:Parameters][name.camelize] = options
|
90
|
-
end
|
91
|
-
|
92
|
-
def add_output(name, options={})
|
93
|
-
@template[:Outputs] ||= {}
|
94
|
-
@template[:Outputs][name.camelize] = options
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
module Jets::Cfn::TemplateBuilders::ManagedIamPolicy
|
2
|
-
autoload :ApplicationPolicy, "jets/cfn/template_builders/managed_iam_policy/application_policy"
|
3
|
-
autoload :BasePolicy, "jets/cfn/template_builders/managed_iam_policy/base_policy"
|
4
|
-
autoload :ClassPolicy, "jets/cfn/template_builders/managed_iam_policy/class_policy"
|
5
|
-
autoload :FunctionPolicy, "jets/cfn/template_builders/managed_iam_policy/function_policy"
|
6
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Implements:
|
2
|
-
# initialize
|
3
|
-
#
|
4
|
-
module Jets::Cfn::TemplateBuilders::ManagedIamPolicy
|
5
|
-
class ApplicationPolicy < BasePolicy
|
6
|
-
def initialize
|
7
|
-
@definitions = Jets.config.managed_iam_policy # config.managed_iam_policy contains definitions
|
8
|
-
@definitions = [@definitions].flatten if @definitions
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,95 +0,0 @@
|
|
1
|
-
require 'erb'
|
2
|
-
|
3
|
-
class Jets::Cfn::TemplateBuilders
|
4
|
-
class ParentBuilder
|
5
|
-
include Interface
|
6
|
-
include Jets::AwsServices
|
7
|
-
|
8
|
-
def initialize(options={})
|
9
|
-
@options = options
|
10
|
-
@template = ActiveSupport::HashWithIndifferentAccess.new(Resources: {})
|
11
|
-
end
|
12
|
-
|
13
|
-
# compose is an interface method
|
14
|
-
def compose
|
15
|
-
puts "Building parent template."
|
16
|
-
|
17
|
-
add_minimal_resources
|
18
|
-
add_child_resources unless @options[:stack_type] == :minimal
|
19
|
-
end
|
20
|
-
|
21
|
-
# template_path is an interface method
|
22
|
-
def template_path
|
23
|
-
Jets::Naming.parent_template_path
|
24
|
-
end
|
25
|
-
|
26
|
-
def add_minimal_resources
|
27
|
-
# variables for minimal-stack.yml
|
28
|
-
path = File.expand_path("../templates/minimal-stack.yml", __FILE__)
|
29
|
-
variables = {
|
30
|
-
policy_name: "lambda-#{Jets.config.project_namespace}-policy",
|
31
|
-
role_name: "lambda-#{Jets.config.project_namespace}-role",
|
32
|
-
}
|
33
|
-
rendered_result = Jets::Erb.result(path, variables)
|
34
|
-
minimal_template = YAML.load(rendered_result)
|
35
|
-
@template.deep_merge!(minimal_template)
|
36
|
-
|
37
|
-
# Add application-wide IAM policy from Jets.config.iam_role
|
38
|
-
map = Jets::Cfn::TemplateMappers::IamPolicy::ApplicationPolicyMapper.new
|
39
|
-
add_resource(map.logical_id, "AWS::IAM::Role", map.properties)
|
40
|
-
end
|
41
|
-
|
42
|
-
def add_child_resources
|
43
|
-
expression = "#{Jets::Naming.template_path_prefix}-*"
|
44
|
-
# IE: path: #{Jets.build_root}/templates/demo-dev-2-comments_controller.yml
|
45
|
-
Dir.glob(expression).each do |path|
|
46
|
-
next unless File.file?(path)
|
47
|
-
next if path =~ /api-gateway/ # treated specially
|
48
|
-
|
49
|
-
# Example of produced code:
|
50
|
-
#
|
51
|
-
# map = Jets::Cfn::TemplateMappers::ControllerMapper.new(path, s3_bucket)
|
52
|
-
# map = Jets::Cfn::TemplateMappers::JobMapper.new(path, s3_bucket)
|
53
|
-
#
|
54
|
-
mapper_class_name = File.basename(path, '.yml').split('_').last
|
55
|
-
mapper_class_name = mapper_class_name.classify
|
56
|
-
mapper_class = "Jets::Cfn::TemplateMappers::#{mapper_class_name}Mapper".constantize # ControllerMapper or JobMapper
|
57
|
-
map = mapper_class.new(path, @options[:s3_bucket])
|
58
|
-
|
59
|
-
# map.logical_id example: PostsController, HardJob, Hello, HelloFunction
|
60
|
-
add_resource(map.logical_id, "AWS::CloudFormation::Stack",
|
61
|
-
TemplateURL: map.template_url,
|
62
|
-
Parameters: map.parameters,
|
63
|
-
)
|
64
|
-
end
|
65
|
-
|
66
|
-
if @options[:stack_type] == :full and !Jets::Router.routes.empty?
|
67
|
-
add_api_gateway
|
68
|
-
add_api_gateway_deployment
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def add_api_gateway
|
73
|
-
path = "#{Jets.config.project_namespace}-api-gateway.yml"
|
74
|
-
map = Jets::Cfn::TemplateMappers::ApiGatewayMapper.new(path, @options[:s3_bucket])
|
75
|
-
|
76
|
-
add_resource(map.logical_id, "AWS::CloudFormation::Stack",
|
77
|
-
Properties: { TemplateURL: map.template_url }
|
78
|
-
)
|
79
|
-
|
80
|
-
add_output(map.logical_id, Value: "!Ref #{map.logical_id}")
|
81
|
-
end
|
82
|
-
|
83
|
-
def add_api_gateway_deployment
|
84
|
-
path = "#{Jets.config.project_namespace}-api-gateway-deployment.yml"
|
85
|
-
map = Jets::Cfn::TemplateMappers::ApiGatewayDeploymentMapper.new(path, @options[:s3_bucket])
|
86
|
-
add_resource(map.logical_id, "AWS::CloudFormation::Stack",
|
87
|
-
Properties: {
|
88
|
-
TemplateURL: map.template_url,
|
89
|
-
Parameters: map.parameters
|
90
|
-
},
|
91
|
-
DependsOn: map.depends_on
|
92
|
-
)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/hash'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
class Jets::Cfn
|
5
|
-
class TemplateMappers
|
6
|
-
# used in the parent_template.rb
|
7
|
-
autoload :ChildMapper, "jets/cfn/template_mappers/child_mapper"
|
8
|
-
autoload :ControllerMapper, "jets/cfn/template_mappers/controller_mapper"
|
9
|
-
autoload :FunctionMapper, "jets/cfn/template_mappers/function_mapper"
|
10
|
-
autoload :JobMapper, "jets/cfn/template_mappers/job_mapper"
|
11
|
-
autoload :RuleMapper, "jets/cfn/template_mappers/rule_mapper"
|
12
|
-
|
13
|
-
autoload :ApiGatewayMapper, "jets/cfn/template_mappers/api_gateway_mapper"
|
14
|
-
autoload :ApiGatewayDeploymentMapper, "jets/cfn/template_mappers/api_gateway_deployment_mapper"
|
15
|
-
# used in the child_template.rb
|
16
|
-
autoload :GatewayMethodMapper, "jets/cfn/template_mappers/gateway_method_mapper"
|
17
|
-
autoload :GatewayResourceMapper, "jets/cfn/template_mappers/gateway_resource_mapper"
|
18
|
-
autoload :LambdaFunctionMapper, "jets/cfn/template_mappers/lambda_function_mapper"
|
19
|
-
|
20
|
-
autoload :IamPolicy, "jets/cfn/template_mappers/iam_policy"
|
21
|
-
end
|
22
|
-
end
|