convection 2.2.22 → 2.2.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/lib/convection/model/template/resource/aws_rds_db_cluster.rb +70 -0
- data/lib/convection/model/template/resource/aws_sns_subscription.rb +22 -0
- data/spec/convection/model/template/resource/aws_rds_db_cluster_spec.rb +120 -0
- data/spec/convection/model/template/resource/aws_sns_subscription_spec.rb +40 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e662d6e48792dd9a7a0ea181e7df3434298aed5d
|
4
|
+
data.tar.gz: '029532de61278ee217887620c0a3c9ed36e1f17c'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e93b1fb2eab063235a2265fc2bf624adbc8920a4c6bb0843ec9b99c8ec2fe3a942706ab128e12413270af44c11999c5adf886ad6930ef4245042282a83f001be
|
7
|
+
data.tar.gz: b0f378d0ec4cfc7974e2b304495e53d014f210da898f49bae3f5e3aa046fad307803a76182af541f63407326d9b4b2dd6cc9656ed96f8d1aedf2cdbd564b0c5d
|
data/.gitignore
CHANGED
@@ -0,0 +1,70 @@
|
|
1
|
+
require_relative '../resource'
|
2
|
+
|
3
|
+
module Convection
|
4
|
+
module Model
|
5
|
+
class Template
|
6
|
+
class Resource
|
7
|
+
##
|
8
|
+
# AWS::RDS::DBCluster
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# rds_cluster 'TestCluster' do
|
12
|
+
# availability_zone 'us-east-1','us-east-2'
|
13
|
+
# backup_retention 10
|
14
|
+
# database_name 'test_database'
|
15
|
+
# identifier 'cluster1'
|
16
|
+
# cluster_parameter_group_name 'default.aurora5.6'
|
17
|
+
# subnet_group 'subnet_group'
|
18
|
+
# engine 'aurora'
|
19
|
+
# engine_version '5.6.10a'
|
20
|
+
# kms_key_id 'kms_key'
|
21
|
+
# master_username 'username'
|
22
|
+
# master_password 'password'
|
23
|
+
# port '3306'
|
24
|
+
# preferred_backup_window '12:30-01:30'
|
25
|
+
# preferred_maintenance_window 'mon:2:30-mon:3:30'
|
26
|
+
# replication_source_identifier 'source_instance'
|
27
|
+
# snapshot_identifier
|
28
|
+
# storage_encrypted 'false'
|
29
|
+
# tag 'Name', 'Test'
|
30
|
+
# vpc_security_group 'test_security_group_1' ,'test_security_group_2'
|
31
|
+
# end
|
32
|
+
##
|
33
|
+
class RDSDBCluster < Resource
|
34
|
+
include Model::Mixin::Taggable
|
35
|
+
|
36
|
+
type 'AWS::RDS::DBCluster', :rds_cluster
|
37
|
+
|
38
|
+
property :availability_zone, 'AvailabilityZones', :type => :list
|
39
|
+
property :backup_retention, 'BackupRetentionPeriod'
|
40
|
+
property :database_name, 'DatabaseName'
|
41
|
+
property :identifier, 'DBClusterIdentifier'
|
42
|
+
property :cluster_parameter_group_name, 'DBClusterParameterGroupName'
|
43
|
+
property :subnet_group, 'DBSubnetGroupName'
|
44
|
+
property :engine, 'Engine'
|
45
|
+
property :engine_version, 'EngineVersion'
|
46
|
+
property :kms_key_id, 'KmsKeyId'
|
47
|
+
# only specify username and password if you do not specify SnapshotIdentifier
|
48
|
+
property :master_username, 'MasterUsername'
|
49
|
+
property :master_password, 'MasterUserPassword'
|
50
|
+
property :port, 'Port'
|
51
|
+
# backup window must be in the format hh24:mi-hh24:mi, atleast 30 mins long, UTC, cannot conflict with maintenance window.
|
52
|
+
property :preferred_backup_window, 'PreferredBackupWindow'
|
53
|
+
# backup window must be in the format ddd:hh24:mi-ddd:hh24:mi, atleast 30 mins long, UTC, cannot conflict with backup window.
|
54
|
+
property :preferred_maintenance_window, 'PreferredMaintenanceWindow'
|
55
|
+
property :replication_source_identifier, 'ReplicationSourceIdentifier'
|
56
|
+
property :snapshot_identifier, 'SnapshotIdentifier'
|
57
|
+
property :storage_encrypted, 'StorageEncrypted'
|
58
|
+
|
59
|
+
property :vpc_security_group, 'VPCSecurityGroupIds', :type => :list
|
60
|
+
|
61
|
+
def render(*args)
|
62
|
+
super.tap do |resource|
|
63
|
+
render_tags(resource)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative '../resource'
|
2
|
+
|
3
|
+
module Convection
|
4
|
+
module Model
|
5
|
+
class Template
|
6
|
+
class Resource
|
7
|
+
# @example
|
8
|
+
# sns_subscription 'MySubscription' do
|
9
|
+
# endpoint 'failures@example.com'
|
10
|
+
# protocol 'email'
|
11
|
+
# topic_arn 'arn:aws:sns:us-west-2:123456789012:example-topic'
|
12
|
+
# end
|
13
|
+
class SNSSubscription < Resource
|
14
|
+
type 'AWS::SNS::Subscription'
|
15
|
+
property :endpoint, 'Endpoint'
|
16
|
+
property :protocol, 'Protocol'
|
17
|
+
property :topic_arn, 'TopicArn'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class Convection::Model::Template::Resource
|
4
|
+
describe RDSDBCluster do
|
5
|
+
let(:template) do
|
6
|
+
Convection.template do
|
7
|
+
rds_cluster 'TestCluster' do
|
8
|
+
availability_zone 'us-east-1', 'us-east-2'
|
9
|
+
backup_retention 10
|
10
|
+
database_name 'test_database'
|
11
|
+
identifier 'cluster1'
|
12
|
+
cluster_parameter_group_name 'default.aurora5.6'
|
13
|
+
subnet_group 'subnet_group'
|
14
|
+
engine 'aurora'
|
15
|
+
engine_version '5.6.10a'
|
16
|
+
kms_key_id 'kms_key'
|
17
|
+
master_username 'username'
|
18
|
+
master_password 'password'
|
19
|
+
port '3306'
|
20
|
+
preferred_backup_window '12:30-01:30'
|
21
|
+
preferred_maintenance_window 'mon:2:30-mon:3:30'
|
22
|
+
replication_source_identifier 'source_instance'
|
23
|
+
snapshot_identifier
|
24
|
+
storage_encrypted 'false'
|
25
|
+
tag 'Name', 'Test'
|
26
|
+
vpc_security_group 'test-security-group-1', 'test-security-group-2'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
subject do
|
32
|
+
template_json
|
33
|
+
.fetch('Resources')
|
34
|
+
.fetch('TestCluster')
|
35
|
+
.fetch('Properties')
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'sets the DBClusterIdentifier' do
|
39
|
+
expect(subject['DBClusterIdentifier']).to eq('cluster1')
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'sets the Engine' do
|
43
|
+
expect(subject['Engine']).to eq('aurora')
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'sets the EngineVersion' do
|
47
|
+
expect(subject['EngineVersion']).to eq('5.6.10a')
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'sets the StorageEncrypted' do
|
51
|
+
expect(subject['StorageEncrypted']).to eq('false')
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'sets the Port' do
|
55
|
+
expect(subject['Port']).to eq('3306')
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'sets the BackupRetentionPeriod' do
|
59
|
+
expect(subject['BackupRetentionPeriod']).to eq(10)
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'sets the DatabaseName' do
|
63
|
+
expect(subject['DatabaseName']).to eq('test_database')
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'sets the MasterUsername' do
|
67
|
+
expect(subject['MasterUsername']).to eq('username')
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'sets the MasterUserPassword' do
|
71
|
+
expect(subject['MasterUserPassword']).to eq('password')
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'sets the KmsKeyId' do
|
75
|
+
expect(subject['KmsKeyId']).to eq('kms_key')
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'sets the PreferredBackupWindow' do
|
79
|
+
expect(subject['PreferredBackupWindow']).to eq('12:30-01:30')
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'sets the PreferredMaintenanceWindow' do
|
83
|
+
expect(subject['PreferredMaintenanceWindow']).to eq('mon:2:30-mon:3:30')
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'sets the AvailabilityZones' do
|
87
|
+
expect(subject['AvailabilityZones']).to match_array(['us-east-1', 'us-east-2'])
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'sets the DBSubnetGroupName' do
|
91
|
+
expect(subject['DBSubnetGroupName']).to eq('subnet_group')
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'sets the DBSubnetGroupName' do
|
95
|
+
expect(subject['DBSubnetGroupName']).to eq('subnet_group')
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'sets the VPCSecurityGroupIds' do
|
99
|
+
expect(subject['VPCSecurityGroupIds']).to match_array(['test-security-group-1', 'test-security-group-2'])
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'sets the ReplicationSourceIdentifier' do
|
103
|
+
expect(subject['ReplicationSourceIdentifier']).to eq('source_instance')
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'sets the DBClusterParameterGroupName' do
|
107
|
+
expect(subject['DBClusterParameterGroupName']).to eq('default.aurora5.6')
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'sets tags' do
|
111
|
+
expect(subject['Tags']).to include(hash_including('Key' => 'Name', 'Value' => 'Test'))
|
112
|
+
end
|
113
|
+
|
114
|
+
private
|
115
|
+
|
116
|
+
def template_json
|
117
|
+
JSON.parse(template.to_json)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class Convection::Model::Template::Resource
|
4
|
+
describe SNSSubscription do
|
5
|
+
let(:template) do
|
6
|
+
Convection.template do
|
7
|
+
sns_subscription 'MySubscription' do
|
8
|
+
endpoint 'failures@example.com'
|
9
|
+
protocol 'email'
|
10
|
+
topic_arn 'arn:aws:sns:us-west-2:123456789012:example-topic'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
subject do
|
16
|
+
template_json
|
17
|
+
.fetch('Resources')
|
18
|
+
.fetch('MySubscription')
|
19
|
+
.fetch('Properties')
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'sets the Endpoint' do
|
23
|
+
expect(subject['Endpoint']).to eq('failures@example.com')
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'sets the Protocol' do
|
27
|
+
expect(subject['Protocol']).to eq('email')
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'sets the TopicArn' do
|
31
|
+
expect(subject['TopicArn']).to eq('arn:aws:sns:us-west-2:123456789012:example-topic')
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def template_json
|
37
|
+
JSON.parse(template.to_json)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: convection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Manero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -233,6 +233,7 @@ files:
|
|
233
233
|
- lib/convection/model/template/resource/aws_lambda_version.rb
|
234
234
|
- lib/convection/model/template/resource/aws_logs_loggroup.rb
|
235
235
|
- lib/convection/model/template/resource/aws_logs_subscription_filter.rb
|
236
|
+
- lib/convection/model/template/resource/aws_rds_db_cluster.rb
|
236
237
|
- lib/convection/model/template/resource/aws_rds_db_instance.rb
|
237
238
|
- lib/convection/model/template/resource/aws_rds_db_parameter_group.rb
|
238
239
|
- lib/convection/model/template/resource/aws_rds_db_security_group.rb
|
@@ -243,6 +244,7 @@ files:
|
|
243
244
|
- lib/convection/model/template/resource/aws_route53_recordset.rb
|
244
245
|
- lib/convection/model/template/resource/aws_s3_bucket.rb
|
245
246
|
- lib/convection/model/template/resource/aws_s3_bucket_policy.rb
|
247
|
+
- lib/convection/model/template/resource/aws_sns_subscription.rb
|
246
248
|
- lib/convection/model/template/resource/aws_sns_topic.rb
|
247
249
|
- lib/convection/model/template/resource/aws_sns_topic_policy.rb
|
248
250
|
- lib/convection/model/template/resource/aws_sqs_queue.rb
|
@@ -335,6 +337,8 @@ files:
|
|
335
337
|
- spec/convection/model/template/resource/aws_auto_scaling_auto_scaling_group_spec.rb
|
336
338
|
- spec/convection/model/template/resource/aws_efs_file_system_spec.rb
|
337
339
|
- spec/convection/model/template/resource/aws_efs_mount_target_spec.rb
|
340
|
+
- spec/convection/model/template/resource/aws_rds_db_cluster_spec.rb
|
341
|
+
- spec/convection/model/template/resource/aws_sns_subscription_spec.rb
|
338
342
|
- spec/convection/model/template/resource/directoryservice_simple_ad_spec.rb
|
339
343
|
- spec/convection/model/template/resource/ec2_dhcp_options_spec.rb
|
340
344
|
- spec/convection/model/template/resource/ec2_security_group_spec.rb
|
@@ -407,6 +411,8 @@ test_files:
|
|
407
411
|
- spec/convection/model/template/resource/aws_auto_scaling_auto_scaling_group_spec.rb
|
408
412
|
- spec/convection/model/template/resource/aws_efs_file_system_spec.rb
|
409
413
|
- spec/convection/model/template/resource/aws_efs_mount_target_spec.rb
|
414
|
+
- spec/convection/model/template/resource/aws_rds_db_cluster_spec.rb
|
415
|
+
- spec/convection/model/template/resource/aws_sns_subscription_spec.rb
|
410
416
|
- spec/convection/model/template/resource/directoryservice_simple_ad_spec.rb
|
411
417
|
- spec/convection/model/template/resource/ec2_dhcp_options_spec.rb
|
412
418
|
- spec/convection/model/template/resource/ec2_security_group_spec.rb
|