cloud_former 0.1.0

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.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +51 -0
  3. data/.rspec +3 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +21 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +30 -0
  8. data/Rakefile +1 -0
  9. data/cloud_former.gemspec +26 -0
  10. data/lib/cloud_former/boolean.rb +5 -0
  11. data/lib/cloud_former/functions/base_64.rb +28 -0
  12. data/lib/cloud_former/functions/find_in_map.rb +36 -0
  13. data/lib/cloud_former/functions/function.rb +5 -0
  14. data/lib/cloud_former/functions/get_att.rb +19 -0
  15. data/lib/cloud_former/functions/get_azs.rb +14 -0
  16. data/lib/cloud_former/functions/join.rb +36 -0
  17. data/lib/cloud_former/has_properties_and_attributes.rb +104 -0
  18. data/lib/cloud_former/makes_json.rb +64 -0
  19. data/lib/cloud_former/metadata_resources/cloud_formation/authentication.rb +28 -0
  20. data/lib/cloud_former/metadata_resources/cloud_formation/authentication_item.rb +29 -0
  21. data/lib/cloud_former/metadata_resources/cloud_formation/config_set.rb +35 -0
  22. data/lib/cloud_former/metadata_resources/cloud_formation/config_set_command.rb +27 -0
  23. data/lib/cloud_former/metadata_resources/cloud_formation/config_set_file.rb +29 -0
  24. data/lib/cloud_former/metadata_resources/cloud_formation/config_set_group.rb +17 -0
  25. data/lib/cloud_former/metadata_resources/cloud_formation/config_set_item.rb +70 -0
  26. data/lib/cloud_former/metadata_resources/cloud_formation/config_set_service.rb +27 -0
  27. data/lib/cloud_former/metadata_resources/cloud_formation/config_set_user.rb +24 -0
  28. data/lib/cloud_former/metadata_resources/cloud_formation/init.rb +33 -0
  29. data/lib/cloud_former/metadata_resources/metadata_resource.rb +15 -0
  30. data/lib/cloud_former/parameters/commma_delimited_list_parameter.rb +9 -0
  31. data/lib/cloud_former/parameters/number_parameter.rb +9 -0
  32. data/lib/cloud_former/parameters/parameter.rb +30 -0
  33. data/lib/cloud_former/parameters/string_parameter.rb +9 -0
  34. data/lib/cloud_former/property_or_attribute.rb +49 -0
  35. data/lib/cloud_former/pseudo_parameters/account_id_parameter.rb +7 -0
  36. data/lib/cloud_former/pseudo_parameters/no_value_parameter.rb +7 -0
  37. data/lib/cloud_former/pseudo_parameters/notification_arns_parameter.rb +7 -0
  38. data/lib/cloud_former/pseudo_parameters/pseudo_parameter.rb +5 -0
  39. data/lib/cloud_former/pseudo_parameters/region_parameter.rb +7 -0
  40. data/lib/cloud_former/pseudo_parameters/stack_id_parameter.rb +7 -0
  41. data/lib/cloud_former/pseudo_parameters/stack_name_parameter.rb +7 -0
  42. data/lib/cloud_former/resource_properties/auto_scaling/block_device_mapping.rb +11 -0
  43. data/lib/cloud_former/resource_properties/auto_scaling/ebs_block_device.rb +12 -0
  44. data/lib/cloud_former/resource_properties/auto_scaling/metrics_collection.rb +9 -0
  45. data/lib/cloud_former/resource_properties/auto_scaling/notification_configuration.rb +16 -0
  46. data/lib/cloud_former/resource_properties/auto_scaling/tag.rb +10 -0
  47. data/lib/cloud_former/resource_properties/cloud_formation/resource_tag.rb +9 -0
  48. data/lib/cloud_former/resource_properties/cloud_front/cache_behavior.rb +15 -0
  49. data/lib/cloud_former/resource_properties/cloud_front/custom_error_response.rb +13 -0
  50. data/lib/cloud_former/resource_properties/cloud_front/custom_origin.rb +10 -0
  51. data/lib/cloud_former/resource_properties/cloud_front/default_cache_behavior.rb +14 -0
  52. data/lib/cloud_former/resource_properties/cloud_front/distribution_configuration.rb +27 -0
  53. data/lib/cloud_former/resource_properties/cloud_front/forwarded_values.rb +9 -0
  54. data/lib/cloud_former/resource_properties/cloud_front/forwarded_values_cookies.rb +9 -0
  55. data/lib/cloud_former/resource_properties/cloud_front/geo_restriction.rb +9 -0
  56. data/lib/cloud_former/resource_properties/cloud_front/logging.rb +10 -0
  57. data/lib/cloud_former/resource_properties/cloud_front/origin.rb +11 -0
  58. data/lib/cloud_former/resource_properties/cloud_front/restriction.rb +8 -0
  59. data/lib/cloud_former/resource_properties/cloud_front/s3_origin.rb +8 -0
  60. data/lib/cloud_former/resource_properties/cloud_front/viewer_certificate.rb +10 -0
  61. data/lib/cloud_former/resource_properties/cloud_watch/metric_dimension.rb +9 -0
  62. data/lib/cloud_former/resource_properties/ec2/security_group_rule.rb +15 -0
  63. data/lib/cloud_former/resource_properties/elastic_load_balancing/access_logging_policy.rb +11 -0
  64. data/lib/cloud_former/resource_properties/elastic_load_balancing/app_cookie_stickiness_policy.rb +9 -0
  65. data/lib/cloud_former/resource_properties/elastic_load_balancing/connection_draining_policy.rb +9 -0
  66. data/lib/cloud_former/resource_properties/elastic_load_balancing/health_check.rb +12 -0
  67. data/lib/cloud_former/resource_properties/elastic_load_balancing/lb_cookie_stickiness_policy.rb +9 -0
  68. data/lib/cloud_former/resource_properties/elastic_load_balancing/listener.rb +13 -0
  69. data/lib/cloud_former/resource_properties/elastic_load_balancing/policy.rb +12 -0
  70. data/lib/cloud_former/resource_properties/resource_property.rb +13 -0
  71. data/lib/cloud_former/resource_properties/s3/cors_configuration.rb +8 -0
  72. data/lib/cloud_former/resource_properties/s3/cors_rule.rb +13 -0
  73. data/lib/cloud_former/resource_properties/s3/lifecycle_configuration.rb +8 -0
  74. data/lib/cloud_former/resource_properties/s3/lifecycle_rule.rb +13 -0
  75. data/lib/cloud_former/resource_properties/s3/lifecycle_rule_transition.rb +10 -0
  76. data/lib/cloud_former/resource_properties/s3/logging_configuration.rb +9 -0
  77. data/lib/cloud_former/resource_properties/s3/notification_configuration.rb +11 -0
  78. data/lib/cloud_former/resource_properties/s3/notification_topic_configuration.rb +9 -0
  79. data/lib/cloud_former/resource_properties/s3/versioning_configuration.rb +8 -0
  80. data/lib/cloud_former/resource_properties/s3/website_configuration.rb +16 -0
  81. data/lib/cloud_former/resource_properties/s3/website_configuration_redirect_all_requests_to.rb +9 -0
  82. data/lib/cloud_former/resource_properties/s3/website_configuration_routing_rules.rb +13 -0
  83. data/lib/cloud_former/resource_properties/s3/website_configuration_routing_rules_redirect_rule.rb +12 -0
  84. data/lib/cloud_former/resource_properties/s3/website_configuration_routing_rules_routing_rule_condition.rb +9 -0
  85. data/lib/cloud_former/resource_properties/sns/subscription.rb +9 -0
  86. data/lib/cloud_former/resources/auto_scaling/auto_scaling_group.rb +31 -0
  87. data/lib/cloud_former/resources/auto_scaling/launch_configuration.rb +26 -0
  88. data/lib/cloud_former/resources/cloud_formation/wait_condition.rb +10 -0
  89. data/lib/cloud_former/resources/cloud_formation/wait_condition_handle.rb +7 -0
  90. data/lib/cloud_former/resources/cloud_front/distribution.rb +9 -0
  91. data/lib/cloud_former/resources/cloud_watch/alarm.rb +22 -0
  92. data/lib/cloud_former/resources/ec2/security_group.rb +21 -0
  93. data/lib/cloud_former/resources/elastic_load_balancing/load_balancer.rb +35 -0
  94. data/lib/cloud_former/resources/iam/access_key.rb +10 -0
  95. data/lib/cloud_former/resources/iam/group.rb +13 -0
  96. data/lib/cloud_former/resources/iam/policy.rb +12 -0
  97. data/lib/cloud_former/resources/iam/user.rb +15 -0
  98. data/lib/cloud_former/resources/resource.rb +31 -0
  99. data/lib/cloud_former/resources/s3/bucket.rb +29 -0
  100. data/lib/cloud_former/resources/sns/topic.rb +10 -0
  101. data/lib/cloud_former/template.rb +42 -0
  102. data/lib/cloud_former/version.rb +3 -0
  103. data/lib/cloud_former.rb +134 -0
  104. data/spec/metadata_spec.rb +152 -0
  105. data/spec/parameter_spec.rb +46 -0
  106. data/spec/resources/auto_scaling/auto_scaling_group_spec.rb +33 -0
  107. data/spec/resources/auto_scaling/launch_configuration_spec.rb +11 -0
  108. data/spec/resources/auto_scaling/notification_configuration_spec.rb +20 -0
  109. data/spec/resources/iam/access_key_spec.rb +43 -0
  110. data/spec/resources/iam/user_spec.rb +141 -0
  111. data/spec/spec_helper.rb +81 -0
  112. data/spec/template_spec.rb +53 -0
  113. data/spec/type_enforcement.rb +8 -0
  114. metadata +223 -0
@@ -0,0 +1,70 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html#aws-resource-init-commands
2
+ module CloudFormer
3
+
4
+ module CloudFormation
5
+ class ConfigSetItem < MetadataResource
6
+
7
+ def initialize
8
+ super
9
+ @aws_type = 'AWS::CloudFormation::ConfigSet'
10
+ end
11
+
12
+ def commands(items=nil)
13
+ @commands = items if items
14
+ @commands
15
+ end
16
+
17
+ def files(items=nil)
18
+ @files = items if items
19
+ @files
20
+ end
21
+
22
+ def groups(items=nil)
23
+ @groups = items if items
24
+ @groups
25
+ end
26
+
27
+ def packages(items=nil)
28
+ @packages = items if items
29
+ @packages
30
+ end
31
+
32
+ def services(items=nil)
33
+ @services = items if items
34
+ @services
35
+ end
36
+
37
+ def sources(items=nil)
38
+ @sources = items if items
39
+ @sources
40
+ end
41
+
42
+ def users(items=nil)
43
+ @users = items if items
44
+ @users
45
+ end
46
+
47
+ def name(val=nil)
48
+ @name = val if val
49
+ @name
50
+ end
51
+
52
+ def dump_json
53
+ res = {}
54
+ %w(commands files groups packages services sources users).each do |type|
55
+ vals = nil
56
+ if instance_variable_defined?("@#{type}")
57
+ vals = instance_variable_get("@#{type}")
58
+ end
59
+ if vals && vals.any?
60
+ res[type] = {}
61
+ vals.each do |val|
62
+ res[type][val.name] = val.dump_json
63
+ end
64
+ end
65
+ end
66
+ res
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,27 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html#aws-resource-init-commands
2
+ module CloudFormer
3
+
4
+ module CloudFormation
5
+ class ConfigSetService < MetadataResource
6
+
7
+ aws_attribute :ensure_running, name: 'ensureRunning', type: Boolean
8
+ aws_attribute :enabled, name: 'enabled', type: Boolean
9
+ aws_attribute :files, name: 'files', list: true, type: String
10
+ aws_attribute :sources, name: 'sources', list: true, type: String
11
+ aws_attribute :packages, name: 'packages', list: true, type: String
12
+ aws_attribute :commands, name: 'commands', list: true, type: String
13
+
14
+ def initialize
15
+ super
16
+ @aws_type = 'AWS::CloudFormation::ConfigSetUser'
17
+ end
18
+
19
+ def name(val=nil)
20
+ if val
21
+ @name = val
22
+ end
23
+ @name
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,24 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html#aws-resource-init-commands
2
+ module CloudFormer
3
+
4
+ module CloudFormation
5
+ class ConfigSetUser < MetadataResource
6
+
7
+ aws_attribute :uid, name: 'uid', type: String
8
+ aws_attribute :groups, name: 'groups', list: true, type: String
9
+ aws_attribute :home_dir, name: 'homeDir', type: String
10
+
11
+ def initialize
12
+ super
13
+ @aws_type = 'AWS::CloudFormation::ConfigSetUser'
14
+ end
15
+
16
+ def name(val=nil)
17
+ if val
18
+ @name = val
19
+ end
20
+ @name
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,33 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html#aws-resource-init-commands
2
+ module CloudFormer
3
+
4
+ module CloudFormation
5
+ class Init < MetadataResource
6
+
7
+ def initialize
8
+ super
9
+ @aws_type = 'AWS::CloudFormation::Init'
10
+ end
11
+
12
+ def config_sets(values=nil)
13
+ if values
14
+ @config_sets = values
15
+ end
16
+ @config_sets
17
+ end
18
+
19
+ def dump_json
20
+ res = { 'configSets' => {} }
21
+ (@config_sets || []).each do |set|
22
+ res['configSets'][set.name] = (set.items || []).map do |item|
23
+ item.name
24
+ end
25
+ (set.items || []).each do |item|
26
+ res[item.name] = item.dump_json
27
+ end
28
+ end
29
+ res
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,15 @@
1
+ module CloudFormer
2
+ class MetadataResource
3
+
4
+ include HasPropertiesAndAttributes
5
+ include MakesJson
6
+
7
+ attr_reader :aws_type
8
+
9
+ def initialize(&block)
10
+ if block_given?
11
+ self.instance_eval(&block)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ module CloudFormer
2
+ class CommaDelimitedListParameter < Parameter
3
+
4
+ def initialize(name)
5
+ super(name)
6
+ @type = 'CommaDelimitedList'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module CloudFormer
2
+ class NumberParameter < Parameter
3
+
4
+ def initialize(name)
5
+ super(name)
6
+ @type = 'Number'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,30 @@
1
+ module CloudFormer
2
+ class Parameter
3
+
4
+ include HasPropertiesAndAttributes
5
+ include MakesJson
6
+
7
+ aws_attribute :allowed_pattern, type: String
8
+ aws_attribute :allowed_values, list: true, type: String
9
+ aws_attribute :constraint_description, type: String
10
+ aws_attribute :default, type: Object
11
+ aws_attribute :description, type: String
12
+ aws_attribute :max_length, type: String
13
+ aws_attribute :max_value, type: Integer
14
+ aws_attribute :min_length, type: String
15
+ aws_attribute :min_value, type: Integer
16
+ aws_attribute :no_echo, type: Boolean
17
+
18
+ attr_reader :type
19
+ attr_reader :name
20
+
21
+ json_attribute(:type)
22
+
23
+ def initialize(name, &block)
24
+ @name = name
25
+ if block_given?
26
+ self.instance_eval(&block)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,9 @@
1
+ module CloudFormer
2
+ class StringParameter < Parameter
3
+
4
+ def initialize(name)
5
+ super(name)
6
+ @type = 'String'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,49 @@
1
+ module CloudFormer
2
+ class PropertyOrAttribute
3
+
4
+ attr_reader :name
5
+ attr_reader :options
6
+
7
+ def initialize(name, options)
8
+ @name = name
9
+ @options = options
10
+ end
11
+
12
+ def as_json_for(instance)
13
+ val_as_json(instance.send(name))
14
+ end
15
+
16
+ private
17
+
18
+ def val_as_json(val)
19
+ if val.is_a?(Parameter) || val.is_a?(PseudoParameter)
20
+ { 'Ref' => val.name }
21
+ elsif val.is_a?(Function)
22
+ val.dump_json
23
+ elsif val.is_a?(Resource) || val.is_a?(ResourceProperty)
24
+ if options[:embed]
25
+ thing = val.dump_json
26
+ thing.delete('Type')
27
+ if options[:skip_properties]
28
+ props = thing.delete('Properties')
29
+ props.each do |name, value|
30
+ thing[name] = value
31
+ end
32
+ end
33
+ thing
34
+ else
35
+ if val.name.nil? || val.name.empty?
36
+ raise ArgumentError.new("Attempting to reference a resource of type #{val.class.name} with no name")
37
+ end
38
+ { 'Ref' => val.name }
39
+ end
40
+ elsif val.is_a?(Array)
41
+ val.map do |v|
42
+ val_as_json(v)
43
+ end
44
+ else
45
+ val
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,7 @@
1
+ module CloudFormer
2
+ class AccountIdParameter < PseudoParameter
3
+ def initialize
4
+ @name = 'AWS::AccountId'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module CloudFormer
2
+ class NoValueParameter < PseudoParameter
3
+ def initialize
4
+ @name = 'AWS::NoValue'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module CloudFormer
2
+ class NotificationARNsParameter < PseudoParameter
3
+ def initialize
4
+ @name = 'AWS::NotificationARNs'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module CloudFormer
2
+ class PseudoParameter
3
+ attr_reader :name
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module CloudFormer
2
+ class RegionParameter < PseudoParameter
3
+ def initialize
4
+ @name = 'AWS::Region'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module CloudFormer
2
+ class StackIdParameter < PseudoParameter
3
+ def initialize
4
+ @name = 'AWS::StackId'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module CloudFormer
2
+ class StackNameParameter < PseudoParameter
3
+ def initialize
4
+ @name = 'AWS::StackName'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-mapping.html
2
+ module CloudFormer
3
+ module AutoScaling
4
+ class BlockDeviceMapping < ResourceProperty
5
+ aws_attribute :device_name, type: String
6
+ aws_attribute :ebs, embed: true, type: EbsBlockDevice
7
+ aws_attribute :no_device, type: Boolean
8
+ aws_attribute :virtual_name, type: String
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-template.html
2
+ module CloudFormer
3
+ module AutoScaling
4
+ class EbsBlockDevice < ResourceProperty
5
+ aws_attribute :delete_on_termination, type: Boolean
6
+ aws_attribute :iops, type: Integer
7
+ aws_attribute :snapshot_id, type: String
8
+ aws_attribute :volume_size, type: Integer
9
+ aws_attribute :volume_type, type: String
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-metricscollection.html
2
+ module CloudFormer
3
+ module AutoScaling
4
+ class MetricsCollection < ResourceProperty
5
+ aws_attribute :granularity, type: String
6
+ aws_attribute :metrics, list: true, type: String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-notificationconfiguration.html
2
+ module CloudFormer
3
+ module AutoScaling
4
+ class NotificationConfiguration < ResourceProperty
5
+
6
+ LAUNCH = 'autoscaling:EC2_INSTANCE_LAUNCH'
7
+ LAUNCH_ERROR = 'autoscaling:EC2_INSTANCE_LAUNCH_ERROR'
8
+ TERMINATE = 'autoscaling:EC2_INSTANCE_TERMINATE'
9
+ TERMINATE_ERROR = 'autoscaling:EC2_INSTANCE_TERMINATE_ERROR'
10
+ TEST = 'autoscaling:TEST_NOTIFICATION'
11
+
12
+ aws_attribute :topic_arn, name: 'TopicARN', type: String
13
+ aws_attribute :notification_types, list: true, type: String
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-tags.html
2
+ module CloudFormer
3
+ module AutoScaling
4
+ class Tag < ResourceProperty
5
+ aws_attribute :key, type: String
6
+ aws_attribute :value, type: String
7
+ aws_attribute :propagate_at_launch, type: Boolean
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html
2
+ module CloudFormer
3
+ module CloudFormation
4
+ class ResourceTag < ResourceProperty
5
+ aws_attribute :key, type: String
6
+ aws_attribute :value, type: String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachebehavior.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class CacheBehavior < ResourceProperty
5
+ aws_attribute :allowed_methods, list: true, type: String
6
+ aws_attribute :forwarded_values, embed: true, type: ForwardedValues
7
+ aws_attribute :min_ttl, name: 'MinTTL', type: String
8
+ aws_attribute :path_pattern, type: String
9
+ aws_attribute :smooth_streaming, type: Boolean
10
+ aws_attribute :target_origin_id, type: String
11
+ aws_attribute :trusted_signers, list: true, type: String
12
+ aws_attribute :viewer_protocol_policy, type: String
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distributionconfig-customerrorresponse.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class CustomErrorResponse < ResourceProperty
5
+ aws_attribute :error_caching_min_ttl,
6
+ name: 'ErrorCachingMinTTL',
7
+ type: Integer
8
+ aws_attribute :error_code, type: Integer
9
+ aws_attribute :response_code, type: Integer
10
+ aws_attribute :response_page_path, type: String
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-customorigin.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class CustomOrigin < ResourceProperty
5
+ aws_attribute :http_port, name: 'HTTPPort', type: String
6
+ aws_attribute :https_port, name: 'HTTPSPort', type: String
7
+ aws_attribute :origin_protocol_policy, type: String
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-defaultcachebehavior.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class DefaultCacheBehavior < ResourceProperty
5
+ aws_attribute :allowed_methods, list: true, type: String
6
+ aws_attribute :forwarded_values, embed: true, type: ForwardedValues
7
+ aws_attribute :min_ttl, name: 'MinTTL', type: String
8
+ aws_attribute :smooth_streaming, type: Boolean
9
+ aws_attribute :target_origin_id, type: String
10
+ aws_attribute :trusted_signers, list: true, type: String
11
+ aws_attribute :viewer_protocol_policy, type: String
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,27 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distributionconfig.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class DistributionConfiguration < ResourceProperty
5
+ aws_attribute :aliases, list: true, type: String
6
+ aws_attribute :cache_behaviors,
7
+ embed: true,
8
+ list: true,
9
+ type: CacheBehavior
10
+ aws_attribute :comment, type: String
11
+ aws_attribute :custom_error_responses,
12
+ embed: true,
13
+ list: true,
14
+ type: CustomErrorResponse
15
+ aws_attribute :default_cache_behavior,
16
+ embed: true,
17
+ type: DefaultCacheBehavior
18
+ aws_attribute :default_root_object, type: String
19
+ aws_attribute :enabled, type: Boolean
20
+ aws_attribute :logging, embed: true, type: Logging
21
+ aws_attribute :origins, embed: true, list: true, type: Origin
22
+ aws_attribute :price_class, type: String
23
+ aws_attribute :restrictions, type: Restriction
24
+ aws_attribute :viewer_certificate, type: ViewerCertificate
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-forwardedvalues.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class ForwardedValues < ResourceProperty
5
+ aws_attribute :cookies, embed: true, type: ForwardedValuesCookies
6
+ aws_attribute :query_string, type: Boolean
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-forwardedvalues-cookies.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class ForwardedValuesCookies < ResourceProperty
5
+ aws_attribute :forward, type: String
6
+ aws_attribute :whitelisted_names, list: true, type: String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distributionconfig-restrictions-georestriction.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class GeoRestriction < ResourceProperty
5
+ aws_attribute :locations, list: true, type: String
6
+ aws_attribute :restriction_type, type: String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-logging.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class Logging < ResourceProperty
5
+ aws_attribute :bucket, type: String
6
+ aws_attribute :include_cookies, type: Boolean
7
+ aws_attribute :prefix, type: String
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-origin.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class Origin < ResourceProperty
5
+ aws_attribute :custom_origin_config, embed: true, type: CustomOrigin
6
+ aws_attribute :domain_name, type: String
7
+ aws_attribute :id, type: String
8
+ aws_attribute :s3_origin_config, embed: true, type: S3Origin
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distributionconfig-restrictions.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class Restriction < ResourceProperty
5
+ aws_attribute :geo_restriction, embed: true, type: GeoRestriction
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-s3origin.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class S3Origin < ResourceProperty
5
+ aws_attribute :origin_access_identity, type: String
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distributionconfig-viewercertificate.html
2
+ module CloudFormer
3
+ module CloudFront
4
+ class ViewerCertificate < ResourceProperty
5
+ aws_attribute :cloud_front_default_certificate, type: Boolean
6
+ aws_attribute :iam_certificate_id, type: String
7
+ aws_attribute :ssl_support_method, type: String
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-dimension.html
2
+ module CloudFormer
3
+ module CloudWatch
4
+ class MetricDimension < ResourceProperty
5
+ aws_attribute :name, type: String
6
+ aws_attribute :value, type: String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group-rule.html
2
+ module CloudFormer
3
+ module EC2
4
+ class SecurityGroupRule < ResourceProperty
5
+ aws_attribute :cidr_ip, type: String
6
+ aws_attribute :from_port, type: Integer
7
+ aws_attribute :ip_protocol, type: String
8
+ aws_attribute :source_security_group_id, type: String
9
+ aws_attribute :source_security_group_name, type: String
10
+ aws_attribute :source_security_group_owner_id, type: String
11
+ aws_attribute :destination_security_group_id, type: String
12
+ aws_attribute :to_port, type: Integer
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-accessloggingpolicy.html
2
+ module CloudFormer
3
+ module ElasticLoadBalancing
4
+ class AccessLoggingPolicy < ResourceProperty
5
+ aws_attribute :emit_interval, type: Integer
6
+ aws_attribute :enabled, type: Boolean
7
+ aws_attribute :s3_bucket_name, name: 'S3BucketName', type: String
8
+ aws_attribute :s3_bucket_prefix, name: 'S3BucketPrefix', type: String
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-AppCookieStickinessPolicy.html
2
+ module CloudFormer
3
+ module ElasticLoadBalancing
4
+ class AppCookieStickinessPolicy < ResourceProperty
5
+ aws_attribute :cookie_name, type: String
6
+ aws_attribute :policy_name, type: String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-connectiondrainingpolicy.html
2
+ module CloudFormer
3
+ module ElasticLoadBalancing
4
+ class ConnectionDrainingPolicy < ResourceProperty
5
+ aws_attribute :enabled, type: Boolean
6
+ aws_attribute :timeout, type: Integer
7
+ end
8
+ end
9
+ end