humidifier 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/humidifier/props.rb +2 -2
  3. data/lib/humidifier/stack.rb +9 -3
  4. data/lib/humidifier/version.rb +1 -1
  5. data/lib/humidifier.rb +1 -0
  6. data/specs/ApiGateway-Account.cf +1 -1
  7. data/specs/AutoScaling-AutoScalingGroup.cf +20 -20
  8. data/specs/CloudFormation-Authentication.cf +12 -13
  9. data/specs/CloudFormation-CustomResource.cf +1 -1
  10. data/specs/EC2-Instance.cf +1 -1
  11. data/specs/EC2-SecurityGroupEgress.cf +9 -9
  12. data/specs/EC2-SecurityGroupIngress.cf +12 -12
  13. data/specs/EC2-Subnet.cf +1 -1
  14. data/specs/EC2-SubnetNetworkAclAssociation.cf +2 -2
  15. data/specs/EC2-SubnetRouteTableAssociation.cf +1 -1
  16. data/specs/EC2-VPNConnectionRoute.cf +2 -2
  17. data/specs/ECS-Cluster.cf +4 -4
  18. data/specs/ECS-TaskDefinition.cf +2 -0
  19. data/specs/ElastiCache-SubnetGroup.cf +1 -1
  20. data/specs/Elasticsearch-Domain.cf +1 -0
  21. data/specs/IAM-Group.cf +7 -7
  22. data/specs/IAM-Policy.cf +8 -8
  23. data/specs/IoT-Thing.cf +1 -1
  24. data/specs/KMS-Alias.cf +7 -0
  25. data/specs/KMS-Key.cf +1 -1
  26. data/specs/RDS-DBClusterParameterGroup.cf +1 -1
  27. data/specs/RDS-DBInstance.cf +3 -1
  28. data/specs/RDS-DBParameterGroup.cf +1 -1
  29. data/specs/RDS-DBSecurityGroupIngress.cf +2 -3
  30. data/specs/RDS-OptionGroup.cf +1 -1
  31. data/specs/Redshift-Cluster.cf +2 -2
  32. data/specs/Redshift-ClusterParameterGroup.cf +2 -2
  33. data/specs/Redshift-ClusterSecurityGroup.cf +2 -2
  34. data/specs/Redshift-ClusterSecurityGroupIngress.cf +2 -2
  35. data/specs/Redshift-ClusterSubnetGroup.cf +2 -2
  36. data/specs/Route53-HealthCheck.cf +1 -1
  37. data/specs/Route53-HostedZone.cf +1 -1
  38. data/specs/Route53-RecordSet.cf +1 -1
  39. data/specs/SDB-Domain.cf +5 -5
  40. data/specs/SQS-Queue.cf +2 -2
  41. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a07ab82ec7c365e45ec51d10ace4298d4a46bb92
4
- data.tar.gz: 2b490e6f34bc98bba5636c844bb2a166a5a4b5e8
3
+ metadata.gz: 863d092d0a370d1be17700cec8aef43db0251862
4
+ data.tar.gz: 54da29ac011bca15c26e05421b6c80be5dff3ba9
5
5
  SHA512:
6
- metadata.gz: 26c04eb793aead4760c0016459dd8b27c694419c39560a77f25687c5d0af679de3358717a249cabe54af50fb78f56ecf5764e0e4aaa0329b7b44fd6c3e4bc78d
7
- data.tar.gz: 8d3ebb5a2b3ebb6509388e563c17fd137103cc65deedfedd1d9d3aae87f7cd7fba628cccf97274259c322ab408b6fa89c6b5366116a3249a8fca661048fff39c
6
+ metadata.gz: c6ee1838f70d9381af2ea8f1b3427a5f81a147f58519e8107659d5d00e716d0306cdc026ccc6769096214da492542a7beca1f1601c92493e45e10ac5f19499c9
7
+ data.tar.gz: f6a08f16ad0e82014576b519932a4184b0a2c74ae106c6e978c9c7ae7585c1792d5e2744aca2195be5636968fffe0d7354c7015f974aa263226c193048878c95
@@ -77,9 +77,9 @@ module Humidifier
77
77
  value.to_i
78
78
  end
79
79
 
80
- # true if it is whitelisted or a Fixnum
80
+ # true if it is whitelisted or a Integer
81
81
  def valid?(value)
82
- whitelisted_value?(value) || value.is_a?(Fixnum)
82
+ whitelisted_value?(value) || value.is_a?(Integer)
83
83
  end
84
84
  end
85
85
 
@@ -33,8 +33,13 @@ module Humidifier
33
33
  end
34
34
 
35
35
  # A string representation of the stack that's valid for CFN
36
- def to_cf
37
- JSON.pretty_generate(enumerable_resources.merge(static_resources))
36
+ def to_cf(serializer = :json)
37
+ resources = static_resources.merge(enumerable_resources)
38
+
39
+ case serializer
40
+ when :json then JSON.pretty_generate(resources)
41
+ when :yaml then YAML.dump(resources)
42
+ end
38
43
  end
39
44
 
40
45
  %i[condition mapping output parameter].each do |resource_type|
@@ -49,7 +54,8 @@ module Humidifier
49
54
 
50
55
  # Increment the default identifier
51
56
  def self.next_default_identifier
52
- @count = (@count || 0) + 1
57
+ @count ||= 0
58
+ @count += 1
53
59
  "humidifier-stack-template-#{@count}"
54
60
  end
55
61
 
@@ -1,4 +1,4 @@
1
1
  module Humidifier
2
2
  # Gem version
3
- VERSION = '0.5.0'.freeze
3
+ VERSION = '0.6.0'.freeze
4
4
  end
data/lib/humidifier.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'forwardable'
2
2
  require 'json'
3
3
  require 'pathname'
4
+ require 'yaml'
4
5
 
5
6
  require 'humidifier/humidifier'
6
7
  require 'humidifier/utils'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "Type" : "AWS::ApiGateway::Account",
3
3
  "Properties" : {
4
- "CloudWatchRoleArn" : String
4
+ "CloudWatchRoleArn": String
5
5
  }
6
6
  }
@@ -1,22 +1,22 @@
1
1
  {
2
- "Type" : "AWS::AutoScaling::AutoScalingGroup",
3
- "Properties" : {
4
- "AvailabilityZones" : [ String, ... ],
5
- "Cooldown" : String,
6
- "DesiredCapacity" : String,
7
- "HealthCheckGracePeriod" : Integer,
8
- "HealthCheckType" : String,
9
- "InstanceId" : String,
10
- "LaunchConfigurationName" : String,
11
- "LoadBalancerNames" : [ String, ... ],
12
- "MaxSize" : String,
13
- "MetricsCollection" : [ MetricsCollection, ... ]
14
- "MinSize" : String,
15
- "NotificationConfigurations" : [ NotificationConfigurations, ... ],
16
- "PlacementGroup" : String,
17
- "Tags" : [ Auto Scaling Tag, ..., ],
18
- "TargetGroupARNs" : [ String, ... ],
19
- "TerminationPolicies" : [ String, ..., ],
20
- "VPCZoneIdentifier" : [ String, ... ]
21
- }
2
+ "Type" : "AWS::AutoScaling::AutoScalingGroup",
3
+ "Properties" : {
4
+ "AvailabilityZones" : [ String, ... ],
5
+ "Cooldown" : String,
6
+ "DesiredCapacity" : String,
7
+ "HealthCheckGracePeriod" : Integer,
8
+ "HealthCheckType" : String,
9
+ "InstanceId" : String,
10
+ "LaunchConfigurationName" : String,
11
+ "LoadBalancerNames" : [ String, ... ],
12
+ "MaxSize" : String,
13
+ "MetricsCollection" : [ MetricsCollection, ... ]
14
+ "MinSize" : String,
15
+ "NotificationConfigurations" : [ NotificationConfigurations, ... ],
16
+ "PlacementGroup" : String,
17
+ "Tags" : [ Auto Scaling Tag, ... ],
18
+ "TargetGroupARNs" : [ String, ... ],
19
+ "TerminationPolicies" : [ String, ..., ],
20
+ "VPCZoneIdentifier" : [ String, ... ]
21
+ }
22
22
  }
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "Type": "AWS::CloudFormation::Authentication",
3
3
  "Properties" : {
4
- "Type" : "AWS::CloudFormation::Authentication" {
5
- "String" : {
6
- "accessKeyId" : String,
7
- "buckets" : [ String, ... ],
8
- "password" : String,
9
- "secretKey" : String,
10
- "type" : String,
11
- "uris" : [ String, ... ],
12
- "username" : String,
13
- "roleName" : String
14
- },
15
- ...
16
- }
4
+ "Type" : "AWS::CloudFormation::Authentication" {
5
+ "String" : {
6
+ "accessKeyId" : String,
7
+ "buckets" : [ String, ... ],
8
+ "password" : String,
9
+ "secretKey" : String,
10
+ "type" : String,
11
+ "uris" : [ String, ... ],
12
+ "username" : String,
13
+ "roleName" : String
14
+ }
15
+ }
17
16
  }
18
17
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "Type" : "AWS::CloudFormation::CustomResource",
2
+ "Type" : "Custom::String",
3
3
  "Version" : "1.0",
4
4
  "Properties" : {
5
5
  "ServiceToken" : String,
@@ -21,7 +21,7 @@
21
21
  "SecurityGroupIds" : [ String, ... ],
22
22
  "SecurityGroups" : [ String, ... ],
23
23
  "SourceDestCheck" : Boolean,
24
- "SsmAssociations" : [ SSMAssociation, ... ]
24
+ "SsmAssociations" : [ SSMAssociation, ... ],
25
25
  "SubnetId" : String,
26
26
  "Tags" : [ Resource Tag, ... ],
27
27
  "Tenancy" : String,
@@ -1,11 +1,11 @@
1
1
  {
2
- "Type": "AWS::EC2::SecurityGroupEgress",
2
+ "Type" : "AWS::EC2::SecurityGroupEgress",
3
3
  "Properties" : {
4
- "CidrIp" : String,
5
- "DestinationSecurityGroupId" : String,
6
- "FromPort" : Integer,
7
- "GroupId" : String,
8
- "IpProtocol" : String,
9
- "ToPort" : Integer
10
- }
11
- }
4
+ "CidrIp" : String,
5
+ "DestinationSecurityGroupId" : String,
6
+ "FromPort" : Integer,
7
+ "GroupId" : String,
8
+ "IpProtocol" : String,
9
+ "ToPort" : Integer
10
+ }
11
+ }
@@ -1,14 +1,14 @@
1
1
  {
2
- "Type": "AWS::EC2::SecurityGroupIngress",
2
+ "Type" : "AWS::EC2::SecurityGroupIngress",
3
3
  "Properties" : {
4
- "CidrIp" : String,
5
- "FromPort" : Integer,
6
- "GroupId" : String,
7
- "GroupName" : String,
8
- "IpProtocol" : String,
9
- "SourceSecurityGroupName" : String,
10
- "SourceSecurityGroupId" : String,
11
- "SourceSecurityGroupOwnerId" : String,
12
- "ToPort" : Integer
13
- }
14
- }
4
+ "CidrIp" : String,
5
+ "FromPort" : Integer,
6
+ "GroupId" : String,
7
+ "GroupName" : String,
8
+ "IpProtocol" : String,
9
+ "SourceSecurityGroupName" : String,
10
+ "SourceSecurityGroupId" : String,
11
+ "SourceSecurityGroupOwnerId" : String,
12
+ "ToPort" : Integer
13
+ }
14
+ }
data/specs/EC2-Subnet.cf CHANGED
@@ -5,6 +5,6 @@
5
5
  "CidrBlock" : String,
6
6
  "MapPublicIpOnLaunch" : Boolean,
7
7
  "Tags" : [ Resource Tag, ... ],
8
- "VpcId" : { "Ref" : String }
8
+ "VpcId" : String
9
9
  }
10
10
  }
@@ -1,5 +1,5 @@
1
1
  "Type" : "AWS::EC2::SubnetNetworkAclAssociation",
2
2
  "Properties" : {
3
- "SubnetId" : { String },
4
- "NetworkAclId" : { String }
3
+ "SubnetId" : String,
4
+ "NetworkAclId" : String
5
5
  }
@@ -2,6 +2,6 @@
2
2
  "Type" : "AWS::EC2::SubnetRouteTableAssociation",
3
3
  "Properties" : {
4
4
  "RouteTableId" : String,
5
- "SubnetId" : String,
5
+ "SubnetId" : String
6
6
  }
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "Type" : "AWS::EC2::VPNConnectionRoute",
3
3
  "Properties" : {
4
- "DestinationCidrBlock" : String
5
- "VpnConnectionId" : String,
4
+ "DestinationCidrBlock" : String,
5
+ "VpnConnectionId" : String
6
6
  }
7
7
  }
data/specs/ECS-Cluster.cf CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "Type": "AWS::ECS::Cluster",
2
+ "Type" : "AWS::ECS::Cluster",
3
3
  "Properties" : {
4
- "Type" : "AWS::ECS::Cluster"
5
- }
6
- }
4
+ "ClusterName" : String
5
+ }
6
+ }
@@ -2,6 +2,8 @@
2
2
  "Type" : "AWS::ECS::TaskDefinition",
3
3
  "Properties" : {
4
4
  "ContainerDefinitions" : [ Container Definition, ... ],
5
+ "Family" : String,
6
+ "TaskRoleArn" : String,
5
7
  "Volumes" : [ Volume Definition, ... ]
6
8
  }
7
9
  }
@@ -1,4 +1,4 @@
1
- "SubnetGroup" : {
1
+ {
2
2
  "Type" : "AWS::ElastiCache::SubnetGroup",
3
3
  "Properties" : {
4
4
  "Description" : String,
@@ -6,6 +6,7 @@
6
6
  "DomainName" : String,
7
7
  "EBSOptions" : EBS Options,
8
8
  "ElasticsearchClusterConfig" : Elasticsearch Cluster Config,
9
+ "ElasticsearchVersion" : String,
9
10
  "SnapshotOptions" : Snapshot Options,
10
11
  "Tags" : [ Resource Tag, ... ]
11
12
  }
data/specs/IAM-Group.cf CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "Type": "AWS::IAM::Group",
3
- "Properties": {
4
- "GroupName": String,
5
- "ManagedPolicyArns": [ String, ... ],
6
- "Path": String,
7
- "Policies": [ Policies, ... ]
8
- }
2
+ "Type": "AWS::IAM::Group",
3
+ "Properties": {
4
+ "GroupName": String,
5
+ "ManagedPolicyArns": [ String, ... ],
6
+ "Path": String,
7
+ "Policies": [ Policies, ... ]
8
+ }
9
9
  }
data/specs/IAM-Policy.cf CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "Type": "AWS::IAM::Policy",
3
- "Properties": {
4
- "Groups" : [ String, ... ],
5
- "PolicyDocument" : JSON object,
6
- "PolicyName" : String,
7
- "Roles" : [ String, ... ],
8
- "Users" : [ String, ... ]
9
- }
2
+ "Type" : "AWS::IAM::Policy"
3
+ "Properties" : {
4
+ "Groups" : [ String, ... ],
5
+ "PolicyDocument" : JSON object,
6
+ "PolicyName" : String,
7
+ "Roles" : [ String, ... ],
8
+ "Users" : [ String, ... ]
9
+ }
10
10
  }
data/specs/IoT-Thing.cf CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "Type": "AWS::IoT::Thing",
3
- "Properties" : {
3
+ "Properties": {
4
4
  "AttributePayload": { String:String, ... },
5
5
  "ThingName": String
6
6
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "Type" : "AWS::KMS::Alias",
3
+ "Properties" : {
4
+ "AliasName" : String,
5
+ "TargetKeyId" : String
6
+ }
7
+ }
data/specs/KMS-Key.cf CHANGED
@@ -4,6 +4,6 @@
4
4
  "Description" : String,
5
5
  "Enabled" : Boolean,
6
6
  "EnableKeyRotation" : Boolean,
7
- "KeyPolicy" : JSON object
7
+ "KeyPolicy" : JSON object
8
8
  }
9
9
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "Type": "AWS::RDS::DBClusterParameterGroup",
2
+ "Type" : "AWS::RDS::DBClusterParameterGroup",
3
3
  "Properties" : {
4
4
  "Description" : String,
5
5
  "Family" : String,
@@ -23,6 +23,8 @@
23
23
  "LicenseModel" : String,
24
24
  "MasterUsername" : String,
25
25
  "MasterUserPassword" : String,
26
+ "MonitoringInterval" : Integer,
27
+ "MonitoringRoleArn" : String,
26
28
  "MultiAZ" : Boolean,
27
29
  "MonitoringInterval" : Integer,
28
30
  "MonitoringRoleArn" : String,
@@ -34,7 +36,7 @@
34
36
  "SourceDBInstanceIdentifier" : String,
35
37
  "StorageEncrypted" : Boolean,
36
38
  "StorageType" : String,
37
- "Tags" : [ Resource Tag, ..., ],
39
+ "Tags" : [ Resource Tag, ... ],
38
40
  "VPCSecurityGroups" : [ String, ... ]
39
41
  }
40
42
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "Type": "AWS::RDS::DBParameterGroup",
2
+ "Type" : "AWS::RDS::DBParameterGroup",
3
3
  "Properties" : {
4
4
  "Description" : String,
5
5
  "Family" : String,
@@ -1,10 +1,9 @@
1
1
  {
2
- "Type": "AWS::RDS::DBSecurityGroupIngress",
2
+ "Type" : "AWS::RDS::DBSecurityGroupIngress",
3
3
  "Properties" : {
4
4
  "CIDRIP": String,
5
5
  "DBSecurityGroupName": String,
6
6
  "EC2SecurityGroupId": String,
7
7
  "EC2SecurityGroupName": String,
8
8
  "EC2SecurityGroupOwnerId": String
9
- }
10
- }
9
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "Type": "AWS::RDS::OptionGroup",
2
+ "Type" : "AWS::RDS::OptionGroup",
3
3
  "Properties" : {
4
4
  "EngineName" : String,
5
5
  "MajorEngineVersion" : String,
@@ -1,6 +1,6 @@
1
1
  {
2
- "Type": "AWS::Redshift::Cluster",
3
- "Properties": {
2
+ "Type" : "AWS::Redshift::Cluster",
3
+ "Properties" : {
4
4
  "AllowVersionUpgrade" : Boolean,
5
5
  "AutomatedSnapshotRetentionPeriod" : Integer,
6
6
  "AvailabilityZone" : String,
@@ -1,6 +1,6 @@
1
1
  {
2
- "Type": "AWS::Redshift::ClusterParameterGroup",
3
- "Properties": {
2
+ "Type" : "AWS::Redshift::ClusterParameterGroup",
3
+ "Properties" : {
4
4
  "Description" : String,
5
5
  "ParameterGroupFamily" : String,
6
6
  "Parameters" : [ Parameter, ... ]
@@ -1,6 +1,6 @@
1
1
  {
2
- "Type": "AWS::Redshift::ClusterSecurityGroup",
3
- "Properties": {
2
+ "Type" : "AWS::Redshift::ClusterSecurityGroup",
3
+ "Properties" : {
4
4
  "Description" : String
5
5
  }
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "Type": "AWS::Redshift::ClusterSecurityGroupIngress",
3
- "Properties": {
2
+ "Type" : "AWS::Redshift::ClusterSecurityGroupIngress",
3
+ "Properties" : {
4
4
  "ClusterSecurityGroupName" : String,
5
5
  "CIDRIP" : String,
6
6
  "EC2SecurityGroupName" : String,
@@ -1,6 +1,6 @@
1
1
  {
2
- "Type": "AWS::Redshift::ClusterSubnetGroup",
3
- "Properties": {
2
+ "Type" : "AWS::Redshift::ClusterSubnetGroup",
3
+ "Properties" : {
4
4
  "Description" : String,
5
5
  "SubnetIds" : [ String, ... ]
6
6
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "Type" : "AWS::Route53::HealthCheck",
3
3
  "Properties" : {
4
- "HealthCheckConfig" : { HealthCheckConfig },
4
+ "HealthCheckConfig" : HealthCheckConfig,
5
5
  "HealthCheckTags" : [ HealthCheckTags, ... ]
6
6
  }
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "Type" : "AWS::Route53::HostedZone",
3
3
  "Properties" : {
4
- "HostedZoneConfig" : { HostedZoneConfig },
4
+ "HostedZoneConfig" : HostedZoneConfig,
5
5
  "HostedZoneTags" : [ HostedZoneTags, ... ],
6
6
  "Name" : String,
7
7
  "VPCs" : [ HostedZoneVPCs, ... ]
@@ -4,7 +4,7 @@
4
4
  "AliasTarget" : AliasTarget,
5
5
  "Comment" : String,
6
6
  "Failover" : String,
7
- "GeoLocation" : { GeoLocation },
7
+ "GeoLocation" : GeoLocation,
8
8
  "HealthCheckId" : String,
9
9
  "HostedZoneId" : String,
10
10
  "HostedZoneName" : String,
data/specs/SDB-Domain.cf CHANGED
@@ -1,6 +1,6 @@
1
- "MySDBDomain" : {
2
- "Type" : "AWS::SDB::Domain",
3
- "Properties" : {
4
- "Description" : "Other than this AWS CloudFormation Description property, SDB Domains have no properties."
5
- }
1
+ {
2
+ "Type" : "AWS::SDB::Domain",
3
+ "Properties" : {
4
+ "Description" : String
5
+ }
6
6
  }
data/specs/SQS-Queue.cf CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "Type": "AWS::SQS::Queue",
3
- "Properties": {
2
+ "Type" : "AWS::SQS::Queue",
3
+ "Properties" : {
4
4
  "DelaySeconds": Integer,
5
5
  "MaximumMessageSize": Integer,
6
6
  "MessageRetentionPeriod": Integer,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humidifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Localytics
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-15 00:00:00.000000000 Z
11
+ date: 2016-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -290,6 +290,7 @@ files:
290
290
  - specs/IoT-Thing.cf
291
291
  - specs/IoT-ThingPrincipalAttachment.cf
292
292
  - specs/IoT-TopicRule.cf
293
+ - specs/KMS-Alias.cf
293
294
  - specs/KMS-Key.cf
294
295
  - specs/Kinesis-Stream.cf
295
296
  - specs/KinesisFirehose-DeliveryStream.cf