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,60 +1,60 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_helper'
|
|
3
|
-
|
|
4
|
-
module CfFactory
|
|
5
|
-
class CfCloudWatchAlarm
|
|
6
|
-
include CfBase
|
|
7
|
-
|
|
8
|
-
GREATER_THAN_OR_EQUAL_TO_THRESHOLD = "GreaterThanOrEqualToThreshold"
|
|
9
|
-
GREATER_THAN_THRESHOLD = "GreaterThanThreshold"
|
|
10
|
-
LESS_THAN_THRESHOLD = "LessThanThreshold"
|
|
11
|
-
LESS_THAN_OR_EQUAL_TO_THRESHOLD = "LessThanOrEqualToThreshold"
|
|
12
|
-
|
|
13
|
-
def initialize(name, comparison_operator, evaluation_periods, metric_name, metric_name_space,
|
|
14
|
-
period, statistic, threshold, options = {})
|
|
15
|
-
@name = name
|
|
16
|
-
@comparison_operator = comparison_operator
|
|
17
|
-
@evaluation_periods = evaluation_periods
|
|
18
|
-
@metric_name = metric_name
|
|
19
|
-
@metric_name_space = metric_name_space
|
|
20
|
-
@period = period
|
|
21
|
-
@statistic = statistic
|
|
22
|
-
@threshold = threshold
|
|
23
|
-
#TODO: optional values
|
|
24
|
-
@alarm_actions = options[:alarm_actions]
|
|
25
|
-
validate()
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def validate
|
|
29
|
-
if ![GREATER_THAN_OR_EQUAL_TO_THRESHOLD, GREATER_THAN_THRESHOLD, LESS_THAN_OR_EQUAL_TO_THRESHOLD, LESS_THAN_THRESHOLD].include?(@comparison_operator)
|
|
30
|
-
raise Exception.new("comparison operator #{@comparison_operator} not valid")
|
|
31
|
-
end
|
|
32
|
-
if !["SampleCount", "Average", "Sum", "Minimum", "Maximum"].include?(@statistic)
|
|
33
|
-
raise Exception.new("statistic #{@statistic} not a valid value")
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def get_cf_type
|
|
38
|
-
"AWS::CloudWatch::Alarm"
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def get_cf_attributes
|
|
42
|
-
{}
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def get_cf_properties
|
|
46
|
-
result = {
|
|
47
|
-
"ComparisonOperator" => @comparison_operator,
|
|
48
|
-
"EvaluationPeriods" => @evaluation_periods,
|
|
49
|
-
"MetricName" => @metric_name,
|
|
50
|
-
"Namespace" => @metric_name_space,
|
|
51
|
-
"Period" => @period,
|
|
52
|
-
"Statistic" => @statistic,
|
|
53
|
-
"Threshold" => @threshold
|
|
54
|
-
}
|
|
55
|
-
result["AlarmActions"] = CfHelper.generate_ref_array(@alarm_actions) unless @alarm_actions.nil?
|
|
56
|
-
result
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
end
|
|
60
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_helper'
|
|
3
|
+
|
|
4
|
+
module CfFactory
|
|
5
|
+
class CfCloudWatchAlarm
|
|
6
|
+
include CfBase
|
|
7
|
+
|
|
8
|
+
GREATER_THAN_OR_EQUAL_TO_THRESHOLD = "GreaterThanOrEqualToThreshold"
|
|
9
|
+
GREATER_THAN_THRESHOLD = "GreaterThanThreshold"
|
|
10
|
+
LESS_THAN_THRESHOLD = "LessThanThreshold"
|
|
11
|
+
LESS_THAN_OR_EQUAL_TO_THRESHOLD = "LessThanOrEqualToThreshold"
|
|
12
|
+
|
|
13
|
+
def initialize(name, comparison_operator, evaluation_periods, metric_name, metric_name_space,
|
|
14
|
+
period, statistic, threshold, options = {})
|
|
15
|
+
@name = name
|
|
16
|
+
@comparison_operator = comparison_operator
|
|
17
|
+
@evaluation_periods = evaluation_periods
|
|
18
|
+
@metric_name = metric_name
|
|
19
|
+
@metric_name_space = metric_name_space
|
|
20
|
+
@period = period
|
|
21
|
+
@statistic = statistic
|
|
22
|
+
@threshold = threshold
|
|
23
|
+
#TODO: optional values
|
|
24
|
+
@alarm_actions = options[:alarm_actions]
|
|
25
|
+
validate()
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def validate
|
|
29
|
+
if ![GREATER_THAN_OR_EQUAL_TO_THRESHOLD, GREATER_THAN_THRESHOLD, LESS_THAN_OR_EQUAL_TO_THRESHOLD, LESS_THAN_THRESHOLD].include?(@comparison_operator)
|
|
30
|
+
raise Exception.new("comparison operator #{@comparison_operator} not valid")
|
|
31
|
+
end
|
|
32
|
+
if !["SampleCount", "Average", "Sum", "Minimum", "Maximum"].include?(@statistic)
|
|
33
|
+
raise Exception.new("statistic #{@statistic} not a valid value")
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def get_cf_type
|
|
38
|
+
"AWS::CloudWatch::Alarm"
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def get_cf_attributes
|
|
42
|
+
{}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def get_cf_properties
|
|
46
|
+
result = {
|
|
47
|
+
"ComparisonOperator" => @comparison_operator,
|
|
48
|
+
"EvaluationPeriods" => @evaluation_periods,
|
|
49
|
+
"MetricName" => @metric_name,
|
|
50
|
+
"Namespace" => @metric_name_space,
|
|
51
|
+
"Period" => @period,
|
|
52
|
+
"Statistic" => @statistic,
|
|
53
|
+
"Threshold" => @threshold
|
|
54
|
+
}
|
|
55
|
+
result["AlarmActions"] = CfHelper.generate_ref_array(@alarm_actions) unless @alarm_actions.nil?
|
|
56
|
+
result
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
module CfFactory
|
|
3
|
-
class CfDynamoTable
|
|
4
|
-
include CfBase
|
|
5
|
-
|
|
6
|
-
def initialize(name, read_capacity_units, write_capacity_units, hash_key_name, hash_key_type, range_key_name = nil, range_key_type = nil)
|
|
7
|
-
@name = name
|
|
8
|
-
@hash_key_name = hash_key_name
|
|
9
|
-
@hash_key_type = hash_key_type
|
|
10
|
-
@range_key_name = range_key_name
|
|
11
|
-
@range_key_type = range_key_type
|
|
12
|
-
@read_capacity_units = read_capacity_units
|
|
13
|
-
@write_capacity_units = write_capacity_units
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def set_deletion_policy(deletion_policy)
|
|
17
|
-
@deletion_policy = deletion_policy
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def get_cf_type
|
|
21
|
-
"AWS::DynamoDB::Table"
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def get_cf_attributes
|
|
25
|
-
result = super
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def get_cf_properties
|
|
29
|
-
result = {}
|
|
30
|
-
if @range_key_name then
|
|
31
|
-
result["KeySchema"] = {
|
|
32
|
-
"HashKeyElement" => { "AttributeName" => @hash_key_name, "AttributeType" => @hash_key_type },
|
|
33
|
-
"RangeKeyElement" => { "AttributeName" => @range_key_name, "AttributeType" => @range_key_type}
|
|
34
|
-
}
|
|
35
|
-
else
|
|
36
|
-
result["KeySchema"] = {
|
|
37
|
-
"HashKeyElement" => { "AttributeName" => @hash_key_name, "AttributeType" => @hash_key_type }
|
|
38
|
-
}
|
|
39
|
-
end
|
|
40
|
-
result["ProvisionedThroughput"] = { "ReadCapacityUnits" => @read_capacity_units, "WriteCapacityUnits" => @write_capacity_units }
|
|
41
|
-
result
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
end
|
|
45
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
module CfFactory
|
|
3
|
+
class CfDynamoTable
|
|
4
|
+
include CfBase
|
|
5
|
+
|
|
6
|
+
def initialize(name, read_capacity_units, write_capacity_units, hash_key_name, hash_key_type, range_key_name = nil, range_key_type = nil)
|
|
7
|
+
@name = name
|
|
8
|
+
@hash_key_name = hash_key_name
|
|
9
|
+
@hash_key_type = hash_key_type
|
|
10
|
+
@range_key_name = range_key_name
|
|
11
|
+
@range_key_type = range_key_type
|
|
12
|
+
@read_capacity_units = read_capacity_units
|
|
13
|
+
@write_capacity_units = write_capacity_units
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def set_deletion_policy(deletion_policy)
|
|
17
|
+
@deletion_policy = deletion_policy
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def get_cf_type
|
|
21
|
+
"AWS::DynamoDB::Table"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def get_cf_attributes
|
|
25
|
+
result = super
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def get_cf_properties
|
|
29
|
+
result = {}
|
|
30
|
+
if @range_key_name then
|
|
31
|
+
result["KeySchema"] = {
|
|
32
|
+
"HashKeyElement" => { "AttributeName" => @hash_key_name, "AttributeType" => @hash_key_type },
|
|
33
|
+
"RangeKeyElement" => { "AttributeName" => @range_key_name, "AttributeType" => @range_key_type}
|
|
34
|
+
}
|
|
35
|
+
else
|
|
36
|
+
result["KeySchema"] = {
|
|
37
|
+
"HashKeyElement" => { "AttributeName" => @hash_key_name, "AttributeType" => @hash_key_type }
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
result["ProvisionedThroughput"] = { "ReadCapacityUnits" => @read_capacity_units, "WriteCapacityUnits" => @write_capacity_units }
|
|
41
|
+
result
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
module CfEbSolutionStack
|
|
2
|
-
|
|
3
|
-
SUPPORTED_STACK_NAMES = {
|
|
4
|
-
s32php54
|
|
5
|
-
s64php54
|
|
6
|
-
s32php53
|
|
7
|
-
s64php53
|
|
8
|
-
s64iis75
|
|
9
|
-
s64iis80
|
|
10
|
-
s32tomcat7
|
|
11
|
-
s64tomcat7
|
|
12
|
-
s32tomcat6
|
|
13
|
-
s64tomcat6
|
|
14
|
-
s32python
|
|
15
|
-
s64python
|
|
16
|
-
s32ruby187
|
|
17
|
-
s64ruby187
|
|
18
|
-
s32ruby193
|
|
19
|
-
s64ruby193
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
module CfEbSolutionStack
|
|
2
|
+
|
|
3
|
+
SUPPORTED_STACK_NAMES = {
|
|
4
|
+
"s32php54" => "32bit Amazon Linux running PHP 5.4",
|
|
5
|
+
"s64php54" => "64bit Amazon Linux running PHP 5.4",
|
|
6
|
+
"s32php53" => "32bit Amazon Linux running PHP 5.3",
|
|
7
|
+
"s64php53" => "64bit Amazon Linux running PHP 5.3",
|
|
8
|
+
"s64iis75" => "64bit Windows Server 2008 R2 running IIS 7.5",
|
|
9
|
+
"s64iis80" => "64bit Windows Server 2012 running IIS 8",
|
|
10
|
+
"s32tomcat7" => "32bit Amazon Linux running Tomcat 7",
|
|
11
|
+
"s64tomcat7" => "64bit Amazon Linux running Tomcat 7",
|
|
12
|
+
"s32tomcat6" => "32bit Amazon Linux running Tomcat 6",
|
|
13
|
+
"s64tomcat6" => "64bit Amazon Linux running Tomcat 6",
|
|
14
|
+
"s32python" => "32bit Amazon Linux running Python",
|
|
15
|
+
"s64python" => "64bit Amazon Linux running Python",
|
|
16
|
+
"s32ruby187" => "32bit Amazon Linux running Ruby 1.8.7",
|
|
17
|
+
"s64ruby187" => "64bit Amazon Linux running Ruby 1.8.7",
|
|
18
|
+
"s32ruby193" => "32bit Amazon Linux running Ruby 1.9.3",
|
|
19
|
+
"s64ruby193" => "64bit Amazon Linux running Ruby 1.9.3"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
def is_valid_stack?(stack_id)
|
|
23
|
+
SUPPORTED_STACK_NAMES.has_key?(stack_id)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_helper'
|
|
3
|
-
|
|
4
|
-
module CfFactory
|
|
5
|
-
class CfEbApplication
|
|
6
|
-
include CfBase
|
|
7
|
-
|
|
8
|
-
def initialize(name, description, application_versions, configuration_templates)
|
|
9
|
-
@name = name
|
|
10
|
-
@description = description
|
|
11
|
-
@application_versions = application_versions
|
|
12
|
-
@configuration_templates = configuration_templates
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def set_tags(tag_list)
|
|
16
|
-
@tag_list = tag_list
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def set_deletion_policy(deletion_policy)
|
|
20
|
-
@deletion_policy = deletion_policy
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def get_cf_type
|
|
24
|
-
"AWS::ElasticBeanstalk::Application"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def get_cf_attributes
|
|
28
|
-
super
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def get_cf_properties
|
|
32
|
-
result = {}
|
|
33
|
-
result["ApplicationVersions"] = CfHelper.generate_inner_array(@application_versions)
|
|
34
|
-
result["ConfigurationTemplates"] = CfHelper.generate_inner_array(@configuration_templates)
|
|
35
|
-
result["Description"] = @description
|
|
36
|
-
result
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
end
|
|
41
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_helper'
|
|
3
|
+
|
|
4
|
+
module CfFactory
|
|
5
|
+
class CfEbApplication
|
|
6
|
+
include CfBase
|
|
7
|
+
|
|
8
|
+
def initialize(name, description, application_versions, configuration_templates)
|
|
9
|
+
@name = name
|
|
10
|
+
@description = description
|
|
11
|
+
@application_versions = application_versions
|
|
12
|
+
@configuration_templates = configuration_templates
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def set_tags(tag_list)
|
|
16
|
+
@tag_list = tag_list
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def set_deletion_policy(deletion_policy)
|
|
20
|
+
@deletion_policy = deletion_policy
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def get_cf_type
|
|
24
|
+
"AWS::ElasticBeanstalk::Application"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def get_cf_attributes
|
|
28
|
+
super
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def get_cf_properties
|
|
32
|
+
result = {}
|
|
33
|
+
result["ApplicationVersions"] = CfHelper.generate_inner_array(@application_versions)
|
|
34
|
+
result["ConfigurationTemplates"] = CfHelper.generate_inner_array(@configuration_templates)
|
|
35
|
+
result["Description"] = @description
|
|
36
|
+
result
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_inner'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfEbApplicationVersion
|
|
5
|
-
include CfInner
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def initialize(description, source_bundle_bucket, source_bundle_key, version_label)
|
|
9
|
-
|
|
10
|
-
@description = description
|
|
11
|
-
@source_bundle_bucket = source_bundle_bucket
|
|
12
|
-
@source_bundle_key = source_bundle_key
|
|
13
|
-
@version_label = version_label
|
|
14
|
-
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def get_cf_attributes
|
|
18
|
-
{ "Description" => @description,
|
|
19
|
-
"SourceBundle" => { "S3Bucket" => @source_bundle_bucket, "S3Key" => @source_bundle_key },
|
|
20
|
-
"VersionLabel" => @version_label }
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
end
|
|
24
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_inner'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfEbApplicationVersion
|
|
5
|
+
include CfInner
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def initialize(description, source_bundle_bucket, source_bundle_key, version_label)
|
|
9
|
+
|
|
10
|
+
@description = description
|
|
11
|
+
@source_bundle_bucket = source_bundle_bucket
|
|
12
|
+
@source_bundle_key = source_bundle_key
|
|
13
|
+
@version_label = version_label
|
|
14
|
+
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def get_cf_attributes
|
|
18
|
+
{ "Description" => @description,
|
|
19
|
+
"SourceBundle" => { "S3Bucket" => @source_bundle_bucket, "S3Key" => @source_bundle_key },
|
|
20
|
+
"VersionLabel" => @version_label }
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_inner'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfEbConfigurationTemplate
|
|
5
|
-
include CfInner
|
|
6
|
-
include CfEbSolutionStack
|
|
7
|
-
def initialize(template_name, description, option_settings, solution_stack_name)
|
|
8
|
-
@template_name = template_name
|
|
9
|
-
@description = description
|
|
10
|
-
@option_settings = option_settings
|
|
11
|
-
@solution_stack_name = solution_stack_name
|
|
12
|
-
validate
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def get_cf_attributes
|
|
16
|
-
{ "TemplateName" => @template_name,
|
|
17
|
-
"Description" => @description,
|
|
18
|
-
"OptionSettings" => "[" + (@option_settings.map {|opt| opt.generate}).join(',') + "]",
|
|
19
|
-
"SolutionStackName" => SUPPORTED_STACK_NAMES[@solution_stack_name]
|
|
20
|
-
}
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def generate_ref
|
|
24
|
-
"{ \"Ref\" : \"#{@template_name}\" }"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def get_template_name
|
|
28
|
-
@template_name
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def validate
|
|
32
|
-
raise Exception.new("stack name not supported: #{@solution_stack_name}") unless is_valid_stack?(@solution_stack_name)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
end
|
|
36
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_inner'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfEbConfigurationTemplate
|
|
5
|
+
include CfInner
|
|
6
|
+
include CfEbSolutionStack
|
|
7
|
+
def initialize(template_name, description, option_settings, solution_stack_name)
|
|
8
|
+
@template_name = template_name
|
|
9
|
+
@description = description
|
|
10
|
+
@option_settings = option_settings
|
|
11
|
+
@solution_stack_name = solution_stack_name
|
|
12
|
+
validate
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def get_cf_attributes
|
|
16
|
+
{ "TemplateName" => @template_name,
|
|
17
|
+
"Description" => @description,
|
|
18
|
+
"OptionSettings" => "[" + (@option_settings.map {|opt| opt.generate}).join(',') + "]",
|
|
19
|
+
"SolutionStackName" => SUPPORTED_STACK_NAMES[@solution_stack_name]
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def generate_ref
|
|
24
|
+
"{ \"Ref\" : \"#{@template_name}\" }"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def get_template_name
|
|
28
|
+
@template_name
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def validate
|
|
32
|
+
raise Exception.new("stack name not supported: #{@solution_stack_name}") unless is_valid_stack?(@solution_stack_name)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module CfFactory
|
|
6
|
-
class CfEbEnvironment
|
|
7
|
-
include CfBase
|
|
8
|
-
include CfEbSolutionStack
|
|
9
|
-
|
|
10
|
-
def initialize(name, application_name, cname_prefix, description, option_settings, options_to_remove,
|
|
11
|
-
solution_stack_name, template_name, version_label)
|
|
12
|
-
@name = name
|
|
13
|
-
@application_name = application_name
|
|
14
|
-
@cname_prefix = cname_prefix
|
|
15
|
-
@description = description
|
|
16
|
-
@option_settings = option_settings
|
|
17
|
-
@options_to_remove = options_to_remove
|
|
18
|
-
@solution_stack_name = solution_stack_name
|
|
19
|
-
@template_name = template_name
|
|
20
|
-
@version_label = version_label
|
|
21
|
-
|
|
22
|
-
validate
|
|
23
|
-
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def get_cf_type
|
|
27
|
-
"AWS::ElasticBeanstalk::Environment"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def get_cf_attributes
|
|
31
|
-
super
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def get_cf_properties
|
|
35
|
-
result = {}
|
|
36
|
-
result["ApplicationName"] = @application_name
|
|
37
|
-
result["Description"] = @description
|
|
38
|
-
result["TemplateName"] = @template_name
|
|
39
|
-
result["VersionLabel"] = @version_label
|
|
40
|
-
result["SolutionStackName"] = SUPPORTED_STACK_NAMES[@solution_stack_name] unless @solution_stack_name.nil?
|
|
41
|
-
result["CNAMEPrefix"] = @cname_prefix unless @cname_prefix.nil?
|
|
42
|
-
result["OptionSettings"] = @option_settings unless @option_settings.nil?
|
|
43
|
-
result["OptionsToRemove"] = @options_to_remove unless @options_to_remove.nil?
|
|
44
|
-
result
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def validate
|
|
48
|
-
if not @solution_stack_name.nil?
|
|
49
|
-
raise Exception.new("stack name not supported: #{@solution_stack_name}") unless is_valid_stack?(@solution_stack_name)
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
module CfFactory
|
|
6
|
+
class CfEbEnvironment
|
|
7
|
+
include CfBase
|
|
8
|
+
include CfEbSolutionStack
|
|
9
|
+
|
|
10
|
+
def initialize(name, application_name, cname_prefix, description, option_settings, options_to_remove,
|
|
11
|
+
solution_stack_name, template_name, version_label)
|
|
12
|
+
@name = name
|
|
13
|
+
@application_name = application_name
|
|
14
|
+
@cname_prefix = cname_prefix
|
|
15
|
+
@description = description
|
|
16
|
+
@option_settings = option_settings
|
|
17
|
+
@options_to_remove = options_to_remove
|
|
18
|
+
@solution_stack_name = solution_stack_name
|
|
19
|
+
@template_name = template_name
|
|
20
|
+
@version_label = version_label
|
|
21
|
+
|
|
22
|
+
validate
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_cf_type
|
|
27
|
+
"AWS::ElasticBeanstalk::Environment"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def get_cf_attributes
|
|
31
|
+
super
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def get_cf_properties
|
|
35
|
+
result = {}
|
|
36
|
+
result["ApplicationName"] = @application_name
|
|
37
|
+
result["Description"] = @description
|
|
38
|
+
result["TemplateName"] = @template_name
|
|
39
|
+
result["VersionLabel"] = @version_label
|
|
40
|
+
result["SolutionStackName"] = SUPPORTED_STACK_NAMES[@solution_stack_name] unless @solution_stack_name.nil?
|
|
41
|
+
result["CNAMEPrefix"] = @cname_prefix unless @cname_prefix.nil?
|
|
42
|
+
result["OptionSettings"] = @option_settings unless @option_settings.nil?
|
|
43
|
+
result["OptionsToRemove"] = @options_to_remove unless @options_to_remove.nil?
|
|
44
|
+
result
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def validate
|
|
48
|
+
if not @solution_stack_name.nil?
|
|
49
|
+
raise Exception.new("stack name not supported: #{@solution_stack_name}") unless is_valid_stack?(@solution_stack_name)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_inner'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfEbOptionSetting
|
|
5
|
-
include CfInner
|
|
6
|
-
def initialize(namespace, option_name, value)
|
|
7
|
-
@namespace=namespace
|
|
8
|
-
@option_name = option_name
|
|
9
|
-
@value = value
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def get_cf_attributes
|
|
13
|
-
{ "Namespace" => @namespace,
|
|
14
|
-
"OptionName" => @option_name,
|
|
15
|
-
"Value" => @value
|
|
16
|
-
}
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_inner'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfEbOptionSetting
|
|
5
|
+
include CfInner
|
|
6
|
+
def initialize(namespace, option_name, value)
|
|
7
|
+
@namespace=namespace
|
|
8
|
+
@option_name = option_name
|
|
9
|
+
@value = value
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def get_cf_attributes
|
|
13
|
+
{ "Namespace" => @namespace,
|
|
14
|
+
"OptionName" => @option_name,
|
|
15
|
+
"Value" => @value
|
|
16
|
+
}
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|