cf_factory 0.0.4 → 0.0.5
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.
- data/bin/cf_factory +9 -9
- data/examples/base_vpc.rb +40 -40
- data/examples/cloudfront_private.rb +23 -23
- data/examples/cloudinit_script_for_one_instance.rb +77 -77
- data/examples/cloudinit_script_with_autoscaling.rb +85 -85
- data/examples/dynamodb_table.rb +24 -24
- data/examples/elastic_beanstalk_example.rb +23 -23
- data/examples/elb_with_cloudfront.rb +100 -100
- data/examples/instance_with_eip.rb +40 -40
- data/examples/instance_with_yum.rb +40 -40
- data/examples/just_an_instance.rb +31 -31
- data/examples/nat_mutual_monitoring.rb +69 -69
- data/examples/play_with_region_and_zones.rb +28 -28
- data/examples/ra_web_hosting.rb +148 -148
- data/examples/s3_with_cloudfront.rb +35 -35
- data/examples/test_vpc.rb +61 -61
- data/lib/cf_factory/as/cf_as_group.rb +80 -77
- data/lib/cf_factory/as/cf_as_launch_config.rb +55 -55
- data/lib/cf_factory/as/cf_as_scaling_policy.rb +35 -35
- data/lib/cf_factory/as/cf_as_update_policy.rb +23 -0
- data/lib/cf_factory/base/cf_base.rb +112 -102
- data/lib/cf_factory/base/cf_ec2_tag.rb +34 -34
- data/lib/cf_factory/base/cf_generator.rb +20 -20
- data/lib/cf_factory/base/cf_helper.rb +93 -93
- data/lib/cf_factory/base/cf_inner.rb +74 -74
- data/lib/cf_factory/base/cf_main.rb +103 -103
- data/lib/cf_factory/base/cf_mapping.rb +28 -28
- data/lib/cf_factory/base/cf_named_inner.rb +70 -1
- data/lib/cf_factory/base/cf_output.rb +26 -26
- data/lib/cf_factory/base/cf_parameter.rb +27 -27
- data/lib/cf_factory/base/cf_script_reader.rb +34 -34
- data/lib/cf_factory/cloudformation/cf_cloud_formation_init.rb +27 -27
- data/lib/cf_factory/cloudformation/cf_cloudformation_command.rb +39 -39
- data/lib/cf_factory/cloudformation/cf_cloudformation_commands.rb +27 -27
- data/lib/cf_factory/cloudformation/cf_cloudformation_config.rb +35 -35
- data/lib/cf_factory/cloudformation/cf_cloudformation_file.rb +40 -40
- data/lib/cf_factory/cloudformation/cf_cloudformation_files.rb +27 -27
- data/lib/cf_factory/cloudformation/cf_cloudformation_inner.rb +30 -30
- data/lib/cf_factory/cloudformation/cf_cloudformation_package.rb +36 -36
- data/lib/cf_factory/cloudformation/cf_cloudformation_packages.rb +44 -44
- data/lib/cf_factory/cloudformation/cf_cloudformation_sources.rb +32 -32
- data/lib/cf_factory/cloudformation/cf_init_script.rb +80 -80
- data/lib/cf_factory/cloudfront/cf_cache_behavior.rb +39 -39
- data/lib/cf_factory/cloudfront/cf_cache_behaviors.rb +30 -30
- data/lib/cf_factory/cloudfront/cf_cloudfront_distribution.rb +66 -66
- data/lib/cf_factory/cloudfront/cf_custom_origin_config.rb +39 -39
- data/lib/cf_factory/cloudfront/cf_default_cache_behavior.rb +34 -34
- data/lib/cf_factory/cloudfront/cf_distribution_config.rb +33 -33
- data/lib/cf_factory/cloudfront/cf_forwarded_values.rb +27 -27
- data/lib/cf_factory/cloudfront/cf_logging.rb +26 -26
- data/lib/cf_factory/cloudfront/cf_origin.rb +42 -42
- data/lib/cf_factory/cloudfront/cf_s3_origin_config.rb +27 -27
- data/lib/cf_factory/cloudwatch/cf_cloud_watch_alarm.rb +60 -60
- data/lib/cf_factory/dynamo/cf_dynamo_table.rb +45 -45
- data/lib/cf_factory/eb/cd_eb_solution_stack.rb +27 -28
- data/lib/cf_factory/eb/cf_eb_application.rb +41 -41
- data/lib/cf_factory/eb/cf_eb_application_version.rb +24 -24
- data/lib/cf_factory/eb/cf_eb_configuration_template.rb +36 -36
- data/lib/cf_factory/eb/cf_eb_environment.rb +56 -56
- data/lib/cf_factory/eb/cf_eb_option_setting.rb +19 -19
- data/lib/cf_factory/ec2/cf_ebs_volume.rb +56 -56
- data/lib/cf_factory/ec2/cf_ec2_instance.rb +80 -66
- data/lib/cf_factory/ec2/cf_ec2_security_group.rb +42 -42
- data/lib/cf_factory/ec2/cf_ec2_security_group_egress.rb +30 -30
- data/lib/cf_factory/ec2/cf_ec2_security_group_ingress.rb +41 -41
- data/lib/cf_factory/ec2/cf_eip.rb +28 -28
- data/lib/cf_factory/ec2/cf_eip_association.rb +33 -31
- data/lib/cf_factory/ec2/cf_inner_network_interface.rb +26 -0
- data/lib/cf_factory/ec2/cf_network_interface.rb +40 -0
- data/lib/cf_factory/elb/cf_app_cookie_stickiness_policy.rb +17 -17
- data/lib/cf_factory/elb/cf_elb.rb +51 -51
- data/lib/cf_factory/elb/cf_health_check.rb +25 -25
- data/lib/cf_factory/elb/cf_lb_cookie_stickiness_policy.rb +17 -17
- data/lib/cf_factory/elb/cf_listener.rb +28 -28
- data/lib/cf_factory/help/fixes.rb +15 -15
- data/lib/cf_factory/help/ip_mask.rb +167 -167
- data/lib/cf_factory/help/template_validation.rb +30 -30
- data/lib/cf_factory/iam/cf_iam_access_key.rb +34 -34
- data/lib/cf_factory/iam/cf_iam_group.rb +32 -32
- data/lib/cf_factory/iam/cf_iam_instance_profile.rb +32 -32
- data/lib/cf_factory/iam/cf_iam_policy.rb +20 -20
- data/lib/cf_factory/iam/cf_iam_role.rb +58 -58
- data/lib/cf_factory/iam/cf_iam_statement.rb +25 -25
- data/lib/cf_factory/iam/cf_iam_user.rb +36 -36
- data/lib/cf_factory/iam/cf_policy_document.rb +21 -21
- data/lib/cf_factory/modules/base_vpc.rb +63 -63
- data/lib/cf_factory/rds/cf_rds_instance.rb +55 -55
- data/lib/cf_factory/rds/cf_rds_security_group.rb +35 -35
- data/lib/cf_factory/rds/cf_rds_security_group_ingress.rb +31 -31
- data/lib/cf_factory/rds/cf_rds_subnet_group.rb +31 -31
- data/lib/cf_factory/route53/cf_elb_alias_target.rb +23 -23
- data/lib/cf_factory/route53/cf_record_set.rb +63 -63
- data/lib/cf_factory/route53/cf_route53_record_set.rb +63 -63
- data/lib/cf_factory/route53/cf_route53_record_set_group.rb +44 -44
- data/lib/cf_factory/s3/cf_s3_bucket.rb +34 -34
- data/lib/cf_factory/s3/cf_web_site_config.rb +26 -26
- data/lib/cf_factory/sqs/cf_sqs_queue.rb +28 -28
- data/lib/cf_factory/vpc/cf_attach_gateway.rb +30 -30
- data/lib/cf_factory/vpc/cf_internet_gateway.rb +32 -32
- data/lib/cf_factory/vpc/cf_network_acl.rb +41 -41
- data/lib/cf_factory/vpc/cf_network_acl_association.rb +26 -26
- data/lib/cf_factory/vpc/cf_network_acl_entry.rb +39 -39
- data/lib/cf_factory/vpc/cf_route.rb +45 -45
- data/lib/cf_factory/vpc/cf_route_table.rb +43 -43
- data/lib/cf_factory/vpc/cf_route_table_association.rb +26 -26
- data/lib/cf_factory/vpc/cf_subnet.rb +50 -50
- data/lib/cf_factory/vpc/cf_vpc.rb +66 -66
- data/lib/cf_factory.rb +12 -12
- metadata +120 -91
|
@@ -1 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
require 'cf_factory/base/cf_helper'
|
|
2
|
+
|
|
3
|
+
# Defines a named JSON resource with attributes to be defined in get_cf_attributes(). NamedInner objects can be passed to other NamedInner objects as attributes
|
|
4
|
+
# for recursive definitions.
|
|
5
|
+
|
|
6
|
+
module CfNamedInner
|
|
7
|
+
def get_cf_attributes
|
|
8
|
+
raise Exception.new("must be defined")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def additional_indent()
|
|
12
|
+
if @indent.nil?
|
|
13
|
+
@indent = 0
|
|
14
|
+
end
|
|
15
|
+
@indent
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def set_indent(indent)
|
|
19
|
+
@indent = indent
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def generate()
|
|
23
|
+
indent = " "*self.additional_indent()
|
|
24
|
+
@result = "#{indent}\"#{@name}\" : {\n"
|
|
25
|
+
attributes = self.get_cf_attributes
|
|
26
|
+
@result += hash_to_string(attributes)
|
|
27
|
+
@result += "\n#{indent}}"
|
|
28
|
+
@result
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def hash_to_string(hash, indent="")
|
|
32
|
+
output = ""
|
|
33
|
+
indent = " "*additional_indent()
|
|
34
|
+
hash.keys.each() do |key|
|
|
35
|
+
value = hash[key]
|
|
36
|
+
output += indent
|
|
37
|
+
#puts "value.class.to_s = #{value.class.to_s} indent = #{indent.size}"
|
|
38
|
+
case value.class.to_s
|
|
39
|
+
when "Hash"
|
|
40
|
+
output += " \"#{key}\" : \n{#{hash_to_string(value,indent+5)}},\n"
|
|
41
|
+
else
|
|
42
|
+
if value.class.to_s == self.class.to_s
|
|
43
|
+
#recursive usage
|
|
44
|
+
output += " \"#{key}\" : { \n#{value.generate},\n"
|
|
45
|
+
else
|
|
46
|
+
#any other primitive type
|
|
47
|
+
output += " \"#{key}\" : #{set_quotes(value)},\n"
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
output
|
|
52
|
+
output = output.chomp().chomp(",")
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# Sets leading and trailing quotes
|
|
58
|
+
def set_quotes(value)
|
|
59
|
+
if value.class.to_s == "String"
|
|
60
|
+
if value.delete(" ").start_with?("{") || value.delete(" ").start_with?("[")
|
|
61
|
+
value
|
|
62
|
+
else
|
|
63
|
+
"\"#{value}\""
|
|
64
|
+
end
|
|
65
|
+
else
|
|
66
|
+
value
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
end
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfOutput
|
|
5
|
-
include CfBase
|
|
6
|
-
|
|
7
|
-
def initialize(name, description, value)
|
|
8
|
-
@name = name
|
|
9
|
-
@description = description
|
|
10
|
-
@value = value
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def get_cf_type
|
|
14
|
-
nil
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def get_cf_attributes
|
|
18
|
-
{"Description" => @description, "Value" => @value}
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def get_cf_properties
|
|
22
|
-
{}
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
end
|
|
26
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfOutput
|
|
5
|
+
include CfBase
|
|
6
|
+
|
|
7
|
+
def initialize(name, description, value)
|
|
8
|
+
@name = name
|
|
9
|
+
@description = description
|
|
10
|
+
@value = value
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def get_cf_type
|
|
14
|
+
nil
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def get_cf_attributes
|
|
18
|
+
{"Description" => @description, "Value" => @value}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def get_cf_properties
|
|
22
|
+
{}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfParameter
|
|
5
|
-
include CfBase
|
|
6
|
-
|
|
7
|
-
def initialize(name, description, type, properties_hash = {})
|
|
8
|
-
@name = name
|
|
9
|
-
@description = description
|
|
10
|
-
@type = type
|
|
11
|
-
@properties_hash = properties_hash
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def get_cf_type
|
|
15
|
-
@type
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def get_cf_attributes
|
|
19
|
-
@properties_hash.merge({"Description" => @description})
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def get_cf_properties
|
|
23
|
-
{}
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
27
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfParameter
|
|
5
|
+
include CfBase
|
|
6
|
+
|
|
7
|
+
def initialize(name, description, type, properties_hash = {})
|
|
8
|
+
@name = name
|
|
9
|
+
@description = description
|
|
10
|
+
@type = type
|
|
11
|
+
@properties_hash = properties_hash
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def get_cf_type
|
|
15
|
+
@type
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def get_cf_attributes
|
|
19
|
+
@properties_hash.merge({"Description" => @description})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def get_cf_properties
|
|
23
|
+
{}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# Reads a file, integrates the specified arguments, and generates indented output taken specified parameters into account
|
|
2
|
-
module CfFactory
|
|
3
|
-
class CfScriptReader
|
|
4
|
-
def initialize(file_to_read, indentation = 0)
|
|
5
|
-
@file = file_to_read
|
|
6
|
-
@indent = indentation
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def apply_arguments(*arguments)
|
|
10
|
-
@arguments = arguments
|
|
11
|
-
puts @arguments.inspect
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def generate()
|
|
15
|
-
contents = File.open(@file, "r") {|f| f.read}
|
|
16
|
-
count = 1
|
|
17
|
-
@arguments.each() {|arg|
|
|
18
|
-
pattern = /<\$#{count}>/
|
|
19
|
-
puts "pattern = #{pattern.inspect}"
|
|
20
|
-
contents.gsub!(pattern, arg)
|
|
21
|
-
count += 1
|
|
22
|
-
}
|
|
23
|
-
result = ""
|
|
24
|
-
contents.each_line do |line|
|
|
25
|
-
result += "#{' '*@indent}#{line}"
|
|
26
|
-
end
|
|
27
|
-
result
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
end
|
|
34
|
-
end
|
|
1
|
+
# Reads a file, integrates the specified arguments, and generates indented output taken specified parameters into account
|
|
2
|
+
module CfFactory
|
|
3
|
+
class CfScriptReader
|
|
4
|
+
def initialize(file_to_read, indentation = 0)
|
|
5
|
+
@file = file_to_read
|
|
6
|
+
@indent = indentation
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def apply_arguments(*arguments)
|
|
10
|
+
@arguments = arguments
|
|
11
|
+
puts @arguments.inspect
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def generate()
|
|
15
|
+
contents = File.open(@file, "r") {|f| f.read}
|
|
16
|
+
count = 1
|
|
17
|
+
@arguments.each() {|arg|
|
|
18
|
+
pattern = /<\$#{count}>/
|
|
19
|
+
puts "pattern = #{pattern.inspect}"
|
|
20
|
+
contents.gsub!(pattern, arg)
|
|
21
|
+
count += 1
|
|
22
|
+
}
|
|
23
|
+
result = ""
|
|
24
|
+
contents.each_line do |line|
|
|
25
|
+
result += "#{' '*@indent}#{line}"
|
|
26
|
+
end
|
|
27
|
+
result
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_inner'
|
|
3
|
-
|
|
4
|
-
module CfFactory
|
|
5
|
-
class CfCloudFormationInit
|
|
6
|
-
include CfInner
|
|
7
|
-
|
|
8
|
-
#config: key value pair of config-sets
|
|
9
|
-
def initialize(configs)
|
|
10
|
-
@configs = configs
|
|
11
|
-
@name = "AWS::CloudFormation::Init"
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def get_cf_attributes
|
|
15
|
-
result = {}
|
|
16
|
-
@configs.each() {|c|
|
|
17
|
-
result[c.get_name] = c.generate
|
|
18
|
-
}
|
|
19
|
-
result
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def generate
|
|
23
|
-
generate_name
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
27
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_inner'
|
|
3
|
+
|
|
4
|
+
module CfFactory
|
|
5
|
+
class CfCloudFormationInit
|
|
6
|
+
include CfInner
|
|
7
|
+
|
|
8
|
+
#config: key value pair of config-sets
|
|
9
|
+
def initialize(configs)
|
|
10
|
+
@configs = configs
|
|
11
|
+
@name = "AWS::CloudFormation::Init"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def get_cf_attributes
|
|
15
|
+
result = {}
|
|
16
|
+
@configs.each() {|c|
|
|
17
|
+
result[c.get_name] = c.generate
|
|
18
|
+
}
|
|
19
|
+
result
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def generate
|
|
23
|
+
generate_name
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_inner'
|
|
3
|
-
require 'cf_factory/base/cf_helper'
|
|
4
|
-
|
|
5
|
-
module CfFactory
|
|
6
|
-
class CfCloudFormationCommand
|
|
7
|
-
include CfInner
|
|
8
|
-
|
|
9
|
-
def get_name
|
|
10
|
-
@name
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def initialize(name, command, options = {})
|
|
14
|
-
@name = name
|
|
15
|
-
@command = command
|
|
16
|
-
#
|
|
17
|
-
@env = options[:env]
|
|
18
|
-
@cwd = options[:cwd]
|
|
19
|
-
@test = options[:test]
|
|
20
|
-
@ignore_errors = options[:ignore_errors]
|
|
21
|
-
@additional_indent = 6
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def additional_indent
|
|
25
|
-
@additional_indent += 2
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def get_cf_attributes
|
|
29
|
-
result = {}
|
|
30
|
-
result['command'] = @command
|
|
31
|
-
result['env'] = @env unless @env.nil?
|
|
32
|
-
result['cwd'] = @cwd unless @cwd.nil?
|
|
33
|
-
result['test'] = @test unless @test.nil?
|
|
34
|
-
result['ignoreErrors'] = @ignore_errors unless @ignore_errors.nil?
|
|
35
|
-
result
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
end
|
|
39
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_inner'
|
|
3
|
+
require 'cf_factory/base/cf_helper'
|
|
4
|
+
|
|
5
|
+
module CfFactory
|
|
6
|
+
class CfCloudFormationCommand
|
|
7
|
+
include CfInner
|
|
8
|
+
|
|
9
|
+
def get_name
|
|
10
|
+
@name
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(name, command, options = {})
|
|
14
|
+
@name = name
|
|
15
|
+
@command = command
|
|
16
|
+
#
|
|
17
|
+
@env = options[:env]
|
|
18
|
+
@cwd = options[:cwd]
|
|
19
|
+
@test = options[:test]
|
|
20
|
+
@ignore_errors = options[:ignore_errors]
|
|
21
|
+
@additional_indent = 6
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def additional_indent
|
|
25
|
+
@additional_indent += 2
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def get_cf_attributes
|
|
29
|
+
result = {}
|
|
30
|
+
result['command'] = @command
|
|
31
|
+
result['env'] = @env unless @env.nil?
|
|
32
|
+
result['cwd'] = @cwd unless @cwd.nil?
|
|
33
|
+
result['test'] = @test unless @test.nil?
|
|
34
|
+
result['ignoreErrors'] = @ignore_errors unless @ignore_errors.nil?
|
|
35
|
+
result
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_inner'
|
|
3
|
-
require 'cf_factory/base/cf_helper'
|
|
4
|
-
|
|
5
|
-
module CfFactory
|
|
6
|
-
class CfCloudFormationCommands
|
|
7
|
-
include CfInner
|
|
8
|
-
|
|
9
|
-
def initialize(commands)
|
|
10
|
-
@commands = commands
|
|
11
|
-
@additional_indent = 4
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def additional_indent
|
|
15
|
-
@additional_indent += 2
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def get_cf_attributes
|
|
19
|
-
result = {}
|
|
20
|
-
@commands.each() {|command|
|
|
21
|
-
result[command.get_name] = command.generate
|
|
22
|
-
}
|
|
23
|
-
result
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
27
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_inner'
|
|
3
|
+
require 'cf_factory/base/cf_helper'
|
|
4
|
+
|
|
5
|
+
module CfFactory
|
|
6
|
+
class CfCloudFormationCommands
|
|
7
|
+
include CfInner
|
|
8
|
+
|
|
9
|
+
def initialize(commands)
|
|
10
|
+
@commands = commands
|
|
11
|
+
@additional_indent = 4
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def additional_indent
|
|
15
|
+
@additional_indent += 2
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def get_cf_attributes
|
|
19
|
+
result = {}
|
|
20
|
+
@commands.each() {|command|
|
|
21
|
+
result[command.get_name] = command.generate
|
|
22
|
+
}
|
|
23
|
+
result
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_inner'
|
|
3
|
-
require 'cf_factory/base/cf_helper'
|
|
4
|
-
|
|
5
|
-
module CfFactory
|
|
6
|
-
class CfCloudFormationConfig
|
|
7
|
-
include CfInner
|
|
8
|
-
|
|
9
|
-
def get_name
|
|
10
|
-
@name
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def initialize(name, sources, commands, files, packages)
|
|
14
|
-
@name = name
|
|
15
|
-
@sources = sources
|
|
16
|
-
@commands = commands
|
|
17
|
-
@files = files
|
|
18
|
-
@packages = packages
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def additional_indent
|
|
22
|
-
4
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def get_cf_attributes
|
|
26
|
-
result = {}
|
|
27
|
-
result["sources"] = CfHelper.clean(@sources.generate) unless @sources.nil?
|
|
28
|
-
result["commands"] = @commands.generate unless @commands.nil?
|
|
29
|
-
result["files"] = @files.generate unless @files.nil?
|
|
30
|
-
result["packages"] = @packages.generate unless @packages.nil?
|
|
31
|
-
result
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_inner'
|
|
3
|
+
require 'cf_factory/base/cf_helper'
|
|
4
|
+
|
|
5
|
+
module CfFactory
|
|
6
|
+
class CfCloudFormationConfig
|
|
7
|
+
include CfInner
|
|
8
|
+
|
|
9
|
+
def get_name
|
|
10
|
+
@name
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(name, sources, commands, files, packages)
|
|
14
|
+
@name = name
|
|
15
|
+
@sources = sources
|
|
16
|
+
@commands = commands
|
|
17
|
+
@files = files
|
|
18
|
+
@packages = packages
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def additional_indent
|
|
22
|
+
4
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def get_cf_attributes
|
|
26
|
+
result = {}
|
|
27
|
+
result["sources"] = CfHelper.clean(@sources.generate) unless @sources.nil?
|
|
28
|
+
result["commands"] = @commands.generate unless @commands.nil?
|
|
29
|
+
result["files"] = @files.generate unless @files.nil?
|
|
30
|
+
result["packages"] = @packages.generate unless @packages.nil?
|
|
31
|
+
result
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_inner'
|
|
3
|
-
require 'cf_factory/base/cf_helper'
|
|
4
|
-
|
|
5
|
-
module CfFactory
|
|
6
|
-
class CfCloudFormationFile
|
|
7
|
-
include CfInner
|
|
8
|
-
|
|
9
|
-
def get_name
|
|
10
|
-
@name
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def initialize(name, content, group, owner, mode, options = {})
|
|
14
|
-
@name = name
|
|
15
|
-
@content = content
|
|
16
|
-
@group = group
|
|
17
|
-
@owner = owner
|
|
18
|
-
@mode = mode
|
|
19
|
-
@source = options[:source]
|
|
20
|
-
#
|
|
21
|
-
@additional_indent = 6
|
|
22
|
-
#TODO: authentication + encoding missing
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def additional_indent
|
|
26
|
-
@additional_indent += 2
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def get_cf_attributes
|
|
30
|
-
result = {}
|
|
31
|
-
result["content"] = @content
|
|
32
|
-
result["group"] = @group
|
|
33
|
-
result["owner"] = @owner
|
|
34
|
-
result["mode"] = @mode
|
|
35
|
-
result["source"] = @source unless @source.nil?
|
|
36
|
-
result
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
40
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_inner'
|
|
3
|
+
require 'cf_factory/base/cf_helper'
|
|
4
|
+
|
|
5
|
+
module CfFactory
|
|
6
|
+
class CfCloudFormationFile
|
|
7
|
+
include CfInner
|
|
8
|
+
|
|
9
|
+
def get_name
|
|
10
|
+
@name
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(name, content, group, owner, mode, options = {})
|
|
14
|
+
@name = name
|
|
15
|
+
@content = content
|
|
16
|
+
@group = group
|
|
17
|
+
@owner = owner
|
|
18
|
+
@mode = mode
|
|
19
|
+
@source = options[:source]
|
|
20
|
+
#
|
|
21
|
+
@additional_indent = 6
|
|
22
|
+
#TODO: authentication + encoding missing
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def additional_indent
|
|
26
|
+
@additional_indent += 2
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def get_cf_attributes
|
|
30
|
+
result = {}
|
|
31
|
+
result["content"] = @content
|
|
32
|
+
result["group"] = @group
|
|
33
|
+
result["owner"] = @owner
|
|
34
|
+
result["mode"] = @mode
|
|
35
|
+
result["source"] = @source unless @source.nil?
|
|
36
|
+
result
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_inner'
|
|
3
|
-
require 'cf_factory/base/cf_helper'
|
|
4
|
-
|
|
5
|
-
module CfFactory
|
|
6
|
-
class CfCloudFormationFiles
|
|
7
|
-
include CfInner
|
|
8
|
-
|
|
9
|
-
def initialize(files)
|
|
10
|
-
@files = files
|
|
11
|
-
@additional_indent = 4
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def additional_indent
|
|
15
|
-
@additional_indent += 2
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def get_cf_attributes
|
|
19
|
-
result = {}
|
|
20
|
-
@files.each() {|file|
|
|
21
|
-
result[file.get_name] = file.generate
|
|
22
|
-
}
|
|
23
|
-
result
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
27
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_inner'
|
|
3
|
+
require 'cf_factory/base/cf_helper'
|
|
4
|
+
|
|
5
|
+
module CfFactory
|
|
6
|
+
class CfCloudFormationFiles
|
|
7
|
+
include CfInner
|
|
8
|
+
|
|
9
|
+
def initialize(files)
|
|
10
|
+
@files = files
|
|
11
|
+
@additional_indent = 4
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def additional_indent
|
|
15
|
+
@additional_indent += 2
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def get_cf_attributes
|
|
19
|
+
result = {}
|
|
20
|
+
@files.each() {|file|
|
|
21
|
+
result[file.get_name] = file.generate
|
|
22
|
+
}
|
|
23
|
+
result
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|