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,31 +1,31 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfRdsSubnetGroup
|
|
5
|
-
include CfBase
|
|
6
|
-
|
|
7
|
-
def initialize(name, description)
|
|
8
|
-
@name = name
|
|
9
|
-
@description = description
|
|
10
|
-
@subnets = []
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def get_cf_type
|
|
14
|
-
"AWS::RDS::DBSubnetGroup"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def get_cf_attributes
|
|
18
|
-
{}
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def get_cf_properties
|
|
22
|
-
subnet_array = @subnets.collect() {|s| s.generate_ref}.join(",")
|
|
23
|
-
{"DBSubnetGroupDescription" => @description, "SubnetIds" => "[#{subnet_array}]"}
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def add_subnet(subnet)
|
|
27
|
-
@subnets << subnet
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
end
|
|
31
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfRdsSubnetGroup
|
|
5
|
+
include CfBase
|
|
6
|
+
|
|
7
|
+
def initialize(name, description)
|
|
8
|
+
@name = name
|
|
9
|
+
@description = description
|
|
10
|
+
@subnets = []
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def get_cf_type
|
|
14
|
+
"AWS::RDS::DBSubnetGroup"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def get_cf_attributes
|
|
18
|
+
{}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def get_cf_properties
|
|
22
|
+
subnet_array = @subnets.collect() {|s| s.generate_ref}.join(",")
|
|
23
|
+
{"DBSubnetGroupDescription" => @description, "SubnetIds" => "[#{subnet_array}]"}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def add_subnet(subnet)
|
|
27
|
+
@subnets << subnet
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_inner'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfElbAliasTarget
|
|
5
|
-
include CfInner
|
|
6
|
-
|
|
7
|
-
def additional_indent
|
|
8
|
-
2
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def initialize(elb)
|
|
12
|
-
@elb = elb
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def get_cf_attributes
|
|
16
|
-
result = {}
|
|
17
|
-
result["HostedZoneId"] = @elb.retrieve_attribute("CanonicalHostedZoneNameID")
|
|
18
|
-
result["DNSName"] = @elb.retrieve_attribute("CanonicalHostedZoneName")
|
|
19
|
-
result
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
end
|
|
23
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_inner'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfElbAliasTarget
|
|
5
|
+
include CfInner
|
|
6
|
+
|
|
7
|
+
def additional_indent
|
|
8
|
+
2
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def initialize(elb)
|
|
12
|
+
@elb = elb
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def get_cf_attributes
|
|
16
|
+
result = {}
|
|
17
|
+
result["HostedZoneId"] = @elb.retrieve_attribute("CanonicalHostedZoneNameID")
|
|
18
|
+
result["DNSName"] = @elb.retrieve_attribute("CanonicalHostedZoneName")
|
|
19
|
+
result
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
module CfFactory
|
|
3
|
-
class CfRecordSet
|
|
4
|
-
include CfInner
|
|
5
|
-
|
|
6
|
-
def initialize(name, record_name, record_type, options)
|
|
7
|
-
@name = name
|
|
8
|
-
@record_name = record_name
|
|
9
|
-
@record_type = record_type
|
|
10
|
-
|
|
11
|
-
@comment = options[:comment]
|
|
12
|
-
@region = options[:region]
|
|
13
|
-
@hosted_zone_id = options[:hosted_zone_id]
|
|
14
|
-
@hosted_zone_name = options[:hosted_zone_name]
|
|
15
|
-
@region = options[:region]
|
|
16
|
-
@ttl = options[:ttl]
|
|
17
|
-
@resource_records = options[:resource_records]
|
|
18
|
-
@weight = options[:weight]
|
|
19
|
-
@set_identifier = options[:set_identifier]
|
|
20
|
-
@alias_target = options[:alias_target]
|
|
21
|
-
validate()
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def get_cf_type
|
|
25
|
-
"AWS::Route53::RecordSet"
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def get_cf_attributes
|
|
29
|
-
{}
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def get_cf_properties
|
|
33
|
-
result = {}
|
|
34
|
-
result["Name"] = @record_name
|
|
35
|
-
result["Type"] = @record_type
|
|
36
|
-
result["Comment"] = @comment unless @comment.nil?
|
|
37
|
-
result["HostedZoneId"] = @hosted_zone_id unless @hosted_zone_id.nil?
|
|
38
|
-
result["HostedZoneName"] = @hosted_zone_name unless @hosted_zone_name.nil?
|
|
39
|
-
result["Region"] = @region unless @region.nil?
|
|
40
|
-
result["TTL"] = @ttl unless @ttl.nil?
|
|
41
|
-
result["Weight"] = @weight unless @weight.nil?
|
|
42
|
-
result["SetIdentifier"] = @set_identifier unless @set_identifier.nil?
|
|
43
|
-
result["ResourceRecords"] = @resource_records.inspect unless @resource_records.nil?
|
|
44
|
-
result["AliasTarget"] = @alias_target.generate unless @alias_target.nil?
|
|
45
|
-
result
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
private
|
|
49
|
-
|
|
50
|
-
def validate
|
|
51
|
-
if @hosted_zone_id.nil? && @hosted_zone_name.nil?
|
|
52
|
-
raise Exception.new("either :hosted_zone_id or :hosted_zone_name must be specified")
|
|
53
|
-
end
|
|
54
|
-
if !@ttl.nil? && @resource_records.nil?
|
|
55
|
-
raise Exception.new("when :ttl specified, :resource_records must also be specified (and vice versa)")
|
|
56
|
-
end
|
|
57
|
-
if !@weight.nil? && @set_identifier.nil?
|
|
58
|
-
raise Exception.new("when :weight specified, :set_identifier must also be specified (and vice versa)")
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
end
|
|
63
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
module CfFactory
|
|
3
|
+
class CfRecordSet
|
|
4
|
+
include CfInner
|
|
5
|
+
|
|
6
|
+
def initialize(name, record_name, record_type, options)
|
|
7
|
+
@name = name
|
|
8
|
+
@record_name = record_name
|
|
9
|
+
@record_type = record_type
|
|
10
|
+
|
|
11
|
+
@comment = options[:comment]
|
|
12
|
+
@region = options[:region]
|
|
13
|
+
@hosted_zone_id = options[:hosted_zone_id]
|
|
14
|
+
@hosted_zone_name = options[:hosted_zone_name]
|
|
15
|
+
@region = options[:region]
|
|
16
|
+
@ttl = options[:ttl]
|
|
17
|
+
@resource_records = options[:resource_records]
|
|
18
|
+
@weight = options[:weight]
|
|
19
|
+
@set_identifier = options[:set_identifier]
|
|
20
|
+
@alias_target = options[:alias_target]
|
|
21
|
+
validate()
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def get_cf_type
|
|
25
|
+
"AWS::Route53::RecordSet"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def get_cf_attributes
|
|
29
|
+
{}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def get_cf_properties
|
|
33
|
+
result = {}
|
|
34
|
+
result["Name"] = @record_name
|
|
35
|
+
result["Type"] = @record_type
|
|
36
|
+
result["Comment"] = @comment unless @comment.nil?
|
|
37
|
+
result["HostedZoneId"] = @hosted_zone_id unless @hosted_zone_id.nil?
|
|
38
|
+
result["HostedZoneName"] = @hosted_zone_name unless @hosted_zone_name.nil?
|
|
39
|
+
result["Region"] = @region unless @region.nil?
|
|
40
|
+
result["TTL"] = @ttl unless @ttl.nil?
|
|
41
|
+
result["Weight"] = @weight unless @weight.nil?
|
|
42
|
+
result["SetIdentifier"] = @set_identifier unless @set_identifier.nil?
|
|
43
|
+
result["ResourceRecords"] = @resource_records.inspect unless @resource_records.nil?
|
|
44
|
+
result["AliasTarget"] = @alias_target.generate unless @alias_target.nil?
|
|
45
|
+
result
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
def validate
|
|
51
|
+
if @hosted_zone_id.nil? && @hosted_zone_name.nil?
|
|
52
|
+
raise Exception.new("either :hosted_zone_id or :hosted_zone_name must be specified")
|
|
53
|
+
end
|
|
54
|
+
if !@ttl.nil? && @resource_records.nil?
|
|
55
|
+
raise Exception.new("when :ttl specified, :resource_records must also be specified (and vice versa)")
|
|
56
|
+
end
|
|
57
|
+
if !@weight.nil? && @set_identifier.nil?
|
|
58
|
+
raise Exception.new("when :weight specified, :set_identifier must also be specified (and vice versa)")
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
module CfFactory
|
|
3
|
-
class CfRoute53RecordSet
|
|
4
|
-
include CfBase
|
|
5
|
-
|
|
6
|
-
def initialize(name, record_name, record_type, options)
|
|
7
|
-
@name = name
|
|
8
|
-
@record_name = record_name
|
|
9
|
-
@record_type = record_type
|
|
10
|
-
|
|
11
|
-
@comment = options[:comment]
|
|
12
|
-
@region = options[:region]
|
|
13
|
-
@hosted_zone_id = options[:hosted_zone_id]
|
|
14
|
-
@hosted_zone_name = options[:hosted_zone_name]
|
|
15
|
-
@region = options[:region]
|
|
16
|
-
@ttl = options[:ttl]
|
|
17
|
-
@resource_records = options[:resource_records]
|
|
18
|
-
@weight = options[:weight]
|
|
19
|
-
@set_identifier = options[:set_identifier]
|
|
20
|
-
@alias_target = options[:alias_target]
|
|
21
|
-
validate()
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def get_cf_type
|
|
25
|
-
"AWS::Route53::RecordSet"
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def get_cf_attributes
|
|
29
|
-
{}
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def get_cf_properties
|
|
33
|
-
result = {}
|
|
34
|
-
result["Name"] = @record_name
|
|
35
|
-
result["Type"] = @record_type
|
|
36
|
-
result["Comment"] = @comment unless @comment.nil?
|
|
37
|
-
result["HostedZoneId"] = @hosted_zone_id unless @hosted_zone_id.nil?
|
|
38
|
-
result["HostedZoneName"] = @hosted_zone_name unless @hosted_zone_name.nil?
|
|
39
|
-
result["Region"] = @region unless @region.nil?
|
|
40
|
-
result["TTL"] = @ttl unless @ttl.nil?
|
|
41
|
-
result["Weight"] = @weight unless @weight.nil?
|
|
42
|
-
result["SetIdentifier"] = @set_identifier unless @set_identifier.nil?
|
|
43
|
-
result["ResourceRecords"] = CfHelper.print_array(@resource_records) unless @resource_records.nil?
|
|
44
|
-
result["AliasTarget"] = @alias_target.generate unless @alias_target.nil?
|
|
45
|
-
result
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
private
|
|
49
|
-
|
|
50
|
-
def validate
|
|
51
|
-
if @hosted_zone_id.nil? && @hosted_zone_name.nil?
|
|
52
|
-
raise Exception.new("either :hosted_zone_id or :hosted_zone_name must be specified")
|
|
53
|
-
end
|
|
54
|
-
if !@ttl.nil? && @resource_records.nil?
|
|
55
|
-
raise Exception.new("when :ttl specified, :resource_records must also be specified (and vice versa)")
|
|
56
|
-
end
|
|
57
|
-
if !@weight.nil? && @set_identifier.nil?
|
|
58
|
-
raise Exception.new("when :weight specified, :set_identifier must also be specified (and vice versa)")
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
end
|
|
63
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
module CfFactory
|
|
3
|
+
class CfRoute53RecordSet
|
|
4
|
+
include CfBase
|
|
5
|
+
|
|
6
|
+
def initialize(name, record_name, record_type, options)
|
|
7
|
+
@name = name
|
|
8
|
+
@record_name = record_name
|
|
9
|
+
@record_type = record_type
|
|
10
|
+
|
|
11
|
+
@comment = options[:comment]
|
|
12
|
+
@region = options[:region]
|
|
13
|
+
@hosted_zone_id = options[:hosted_zone_id]
|
|
14
|
+
@hosted_zone_name = options[:hosted_zone_name]
|
|
15
|
+
@region = options[:region]
|
|
16
|
+
@ttl = options[:ttl]
|
|
17
|
+
@resource_records = options[:resource_records]
|
|
18
|
+
@weight = options[:weight]
|
|
19
|
+
@set_identifier = options[:set_identifier]
|
|
20
|
+
@alias_target = options[:alias_target]
|
|
21
|
+
validate()
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def get_cf_type
|
|
25
|
+
"AWS::Route53::RecordSet"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def get_cf_attributes
|
|
29
|
+
{}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def get_cf_properties
|
|
33
|
+
result = {}
|
|
34
|
+
result["Name"] = @record_name
|
|
35
|
+
result["Type"] = @record_type
|
|
36
|
+
result["Comment"] = @comment unless @comment.nil?
|
|
37
|
+
result["HostedZoneId"] = @hosted_zone_id unless @hosted_zone_id.nil?
|
|
38
|
+
result["HostedZoneName"] = @hosted_zone_name unless @hosted_zone_name.nil?
|
|
39
|
+
result["Region"] = @region unless @region.nil?
|
|
40
|
+
result["TTL"] = @ttl unless @ttl.nil?
|
|
41
|
+
result["Weight"] = @weight unless @weight.nil?
|
|
42
|
+
result["SetIdentifier"] = @set_identifier unless @set_identifier.nil?
|
|
43
|
+
result["ResourceRecords"] = CfHelper.print_array(@resource_records) unless @resource_records.nil?
|
|
44
|
+
result["AliasTarget"] = @alias_target.generate unless @alias_target.nil?
|
|
45
|
+
result
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
def validate
|
|
51
|
+
if @hosted_zone_id.nil? && @hosted_zone_name.nil?
|
|
52
|
+
raise Exception.new("either :hosted_zone_id or :hosted_zone_name must be specified")
|
|
53
|
+
end
|
|
54
|
+
if !@ttl.nil? && @resource_records.nil?
|
|
55
|
+
raise Exception.new("when :ttl specified, :resource_records must also be specified (and vice versa)")
|
|
56
|
+
end
|
|
57
|
+
if !@weight.nil? && @set_identifier.nil?
|
|
58
|
+
raise Exception.new("when :weight specified, :set_identifier must also be specified (and vice versa)")
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
#not yet working
|
|
2
|
-
|
|
3
|
-
require 'cf_factory/base/cf_base'
|
|
4
|
-
module CfFactory
|
|
5
|
-
class CfRoute53RecordSetGroup
|
|
6
|
-
include CfBase
|
|
7
|
-
|
|
8
|
-
def initialize(name, record_sets, options)
|
|
9
|
-
raise Exception.new("don't use for now")
|
|
10
|
-
@name = name
|
|
11
|
-
@record_sets = record_sets
|
|
12
|
-
@hosted_zone_id = options[:hosted_zone_id]
|
|
13
|
-
@hosted_zone_name = options[:hosted_zone_name]
|
|
14
|
-
@comment = options[:comment]
|
|
15
|
-
validate()
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def get_cf_type
|
|
19
|
-
"AWS::Route53::RecordSetGroup"
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def get_cf_attributes
|
|
23
|
-
{}
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def get_cf_properties
|
|
27
|
-
result = {}
|
|
28
|
-
result["RecordSets"] = CfHelper.generate_inner_array(@record_sets)
|
|
29
|
-
result["Comment"] = @comment unless @comment.nil?
|
|
30
|
-
result["HostedZoneId"] = @hosted_zone_id unless @hosted_zone_id.nil?
|
|
31
|
-
result["HostedZoneName"] = @hosted_zone_name unless @hosted_zone_name.nil?
|
|
32
|
-
result
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
private
|
|
36
|
-
|
|
37
|
-
def validate
|
|
38
|
-
if @hosted_zone_id.nil? && @hosted_zone_name.nil?
|
|
39
|
-
raise Exception.new("either :hosted_zone_id or :hosted_zone_name must be specified")
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
end
|
|
44
|
-
end
|
|
1
|
+
#not yet working
|
|
2
|
+
|
|
3
|
+
require 'cf_factory/base/cf_base'
|
|
4
|
+
module CfFactory
|
|
5
|
+
class CfRoute53RecordSetGroup
|
|
6
|
+
include CfBase
|
|
7
|
+
|
|
8
|
+
def initialize(name, record_sets, options)
|
|
9
|
+
raise Exception.new("don't use for now")
|
|
10
|
+
@name = name
|
|
11
|
+
@record_sets = record_sets
|
|
12
|
+
@hosted_zone_id = options[:hosted_zone_id]
|
|
13
|
+
@hosted_zone_name = options[:hosted_zone_name]
|
|
14
|
+
@comment = options[:comment]
|
|
15
|
+
validate()
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def get_cf_type
|
|
19
|
+
"AWS::Route53::RecordSetGroup"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def get_cf_attributes
|
|
23
|
+
{}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_cf_properties
|
|
27
|
+
result = {}
|
|
28
|
+
result["RecordSets"] = CfHelper.generate_inner_array(@record_sets)
|
|
29
|
+
result["Comment"] = @comment unless @comment.nil?
|
|
30
|
+
result["HostedZoneId"] = @hosted_zone_id unless @hosted_zone_id.nil?
|
|
31
|
+
result["HostedZoneName"] = @hosted_zone_name unless @hosted_zone_name.nil?
|
|
32
|
+
result
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def validate
|
|
38
|
+
if @hosted_zone_id.nil? && @hosted_zone_name.nil?
|
|
39
|
+
raise Exception.new("either :hosted_zone_id or :hosted_zone_name must be specified")
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
module CfFactory
|
|
3
|
-
class CfS3Bucket
|
|
4
|
-
include CfBase
|
|
5
|
-
|
|
6
|
-
def initialize(name, options = {})
|
|
7
|
-
@name = name
|
|
8
|
-
@access_control = options[:access_control]
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def set_deletion_policy(deletion_policy)
|
|
12
|
-
@deletion_policy = deletion_policy
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def get_cf_type
|
|
16
|
-
"AWS::S3::Bucket"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def get_cf_attributes
|
|
20
|
-
result = super
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def get_cf_properties
|
|
24
|
-
result = {}
|
|
25
|
-
result["AccessControl"] = @access_control unless @access_control.nil?
|
|
26
|
-
result
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def short_domain_name
|
|
30
|
-
CfHelper.join([self.generate_ref, ".s3.amazonaws.com"])
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
end
|
|
34
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
module CfFactory
|
|
3
|
+
class CfS3Bucket
|
|
4
|
+
include CfBase
|
|
5
|
+
|
|
6
|
+
def initialize(name, options = {})
|
|
7
|
+
@name = name
|
|
8
|
+
@access_control = options[:access_control]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def set_deletion_policy(deletion_policy)
|
|
12
|
+
@deletion_policy = deletion_policy
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def get_cf_type
|
|
16
|
+
"AWS::S3::Bucket"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def get_cf_attributes
|
|
20
|
+
result = super
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def get_cf_properties
|
|
24
|
+
result = {}
|
|
25
|
+
result["AccessControl"] = @access_control unless @access_control.nil?
|
|
26
|
+
result
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def short_domain_name
|
|
30
|
+
CfHelper.join([self.generate_ref, ".s3.amazonaws.com"])
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_inner'
|
|
2
|
-
|
|
3
|
-
module CfFactory
|
|
4
|
-
class CfWebSiteConfig
|
|
5
|
-
include CfInner
|
|
6
|
-
|
|
7
|
-
attr_reader(:id)
|
|
8
|
-
|
|
9
|
-
def additional_indent
|
|
10
|
-
2
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def initialize(index_doc, error_doc)
|
|
14
|
-
@index_doc = index_doc
|
|
15
|
-
@error_doc = error_doc
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def get_cf_attributes
|
|
19
|
-
result = {}
|
|
20
|
-
result["IndexDocument"] = @index_doc
|
|
21
|
-
result["ErrorDocument"] = @error_doc
|
|
22
|
-
result
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
end
|
|
26
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_inner'
|
|
2
|
+
|
|
3
|
+
module CfFactory
|
|
4
|
+
class CfWebSiteConfig
|
|
5
|
+
include CfInner
|
|
6
|
+
|
|
7
|
+
attr_reader(:id)
|
|
8
|
+
|
|
9
|
+
def additional_indent
|
|
10
|
+
2
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(index_doc, error_doc)
|
|
14
|
+
@index_doc = index_doc
|
|
15
|
+
@error_doc = error_doc
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def get_cf_attributes
|
|
19
|
+
result = {}
|
|
20
|
+
result["IndexDocument"] = @index_doc
|
|
21
|
+
result["ErrorDocument"] = @error_doc
|
|
22
|
+
result
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
require 'cf_factory/base/cf_base'
|
|
2
|
-
require 'cf_factory/base/cf_helper'
|
|
3
|
-
|
|
4
|
-
module CfFactory
|
|
5
|
-
class CfSqsQueue
|
|
6
|
-
include CfBase
|
|
7
|
-
|
|
8
|
-
def initialize(name, options = {})
|
|
9
|
-
@name = name
|
|
10
|
-
@visibility_timeout = options[:visibility_timeout]
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def get_cf_type
|
|
14
|
-
"AWS::SQS::Queue"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def get_cf_attributes
|
|
18
|
-
{}
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def get_cf_properties
|
|
22
|
-
result = {}
|
|
23
|
-
result["VisibilityTimeout"] = @visibility_timeout unless @visibility_timeout.nil?
|
|
24
|
-
result
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
end
|
|
1
|
+
require 'cf_factory/base/cf_base'
|
|
2
|
+
require 'cf_factory/base/cf_helper'
|
|
3
|
+
|
|
4
|
+
module CfFactory
|
|
5
|
+
class CfSqsQueue
|
|
6
|
+
include CfBase
|
|
7
|
+
|
|
8
|
+
def initialize(name, options = {})
|
|
9
|
+
@name = name
|
|
10
|
+
@visibility_timeout = options[:visibility_timeout]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def get_cf_type
|
|
14
|
+
"AWS::SQS::Queue"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def get_cf_attributes
|
|
18
|
+
{}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def get_cf_properties
|
|
22
|
+
result = {}
|
|
23
|
+
result["VisibilityTimeout"] = @visibility_timeout unless @visibility_timeout.nil?
|
|
24
|
+
result
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|