convection 2.2.28.pre.beta.1 → 2.2.28.pre.beta.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fbe7aab1182d0692cd7926a0d50c79e4195f1c6
4
- data.tar.gz: 9fa54b2f868199fb201999e9ffb1c35caac158b2
3
+ metadata.gz: d68fad6ffffdcdf41d18869fe4d301247a8d6714
4
+ data.tar.gz: c5e3d4b20b7134131bd0008f7d1247ca58450634
5
5
  SHA512:
6
- metadata.gz: 02d1f7ed2f1e86f8c3f07a8bb965dd9b3382c84e5e1100ff15265728aa43f091e75af599588a1f7b0567f2ace3cfc6c2d38fd221924e86d79f383b572a4be9aa
7
- data.tar.gz: 81baef0f5ea21fa02f9054227524e422901d9caa2a8dd533126b57d7a49f7dc76ba4d6e31d6fb556bf2104b96f6afd3a37a135538bafe74cf59e190a44ff4633
6
+ metadata.gz: 425b25c950fba12434a0296815b735377ddaa2ca2b0959743134fccdb45b6b153a89c9d2ee9c75c9268ce10575a617c5fd70dc82fb23404502f19dca0553baf7
7
+ data.tar.gz: e297cabb5ab408c2f0ac9570d869385737542bb8c74e32ee764e0d791434d794aba10c4143b6a4e3288d671c0f2e6917046b4c08781327a1115cf41aea6d76b0
@@ -0,0 +1,77 @@
1
+ require_relative '../resource'
2
+
3
+ module Convection
4
+ module Model
5
+ class Template
6
+ class Resource
7
+ ##
8
+ # AWS::DynamoDB::Table
9
+ #
10
+ # @example
11
+ # dynamodb_table 'TestTable' do
12
+ # #A attribute definitions { 'AttributeName' : String, 'AttributeType' : String }
13
+ # attribute_definitions 'AttributeName' => 'Name', 'AttributeType' => 'Type'
14
+ # #A key schema { 'AttributeName' : String, 'KeyType' : 'HASH or RANGE' }
15
+ # key_schema 'AttributeName' => 'Name', 'KeyType' => 'HASH'
16
+ # #Provisioned throughout hash { 'ReadCapacityUnits' : Number, 'WriteCapacityUnits' : Number }
17
+ # provisioned_throughput 'ReadCapacityUnits' => 100, 'WriteCapacityUnits' => 100
18
+ # #optional
19
+ # #A global seconday index { 'IndexName' : String, 'KeySchema' : [KeySchema, ... ],
20
+ # 'Projection' : { Projection }, 'ProvisionedThroughput' : { ProvisionedThroughput }}
21
+ # global_secondary_indexes 'IndexName' => 'Name', 'KeySchema' => [{' AttributeName' => 'Name', 'KeyType' => 'HASH' }],
22
+ # 'Projection' => { 'NonKeyAttributes' => [{ 'AttributeName' => 'Name2', 'AttributeType' => 'Type' }], 'ProjectionType'=>'Type' },
23
+ # 'ProvisionedThroughput' =>{ 'ReadCapacityUnits' => 100, 'WriteCapacityUnits' => 100 }
24
+ # #A local secondary index { 'IndexName' : String, 'KeySchema' : [ KeySchema, ...], 'Projection' : { Projection }}
25
+ # local_secondary_indexes 'IndexName' => 'Name', 'KeySchema' => [{ 'AttributeName' => 'Name', 'KeyType' => 'HASH' }],
26
+ # 'Projection' => {'NonKeyAttributes' =>[ {'AttributeName' => 'Name2', 'AttributeType' => 'Type'} ], 'ProjectionType'=>'Type' }
27
+ # #A point in time recovery specification { 'PointInTimeRecoveryEnabled' : Boolean}
28
+ # point_in_time_recovery_specification 'PointInTimeRecoveryEnabled' => true
29
+ # #A sse specification { 'SSEEnabled' : Boolean }
30
+ # sse_specification 'SSEEnabled' => false
31
+ # #A stream specification { 'StreamViewType' : String }
32
+ # stream_specification 'StreamViewType' => 'Type'
33
+ # table_name 'TableName'
34
+ # #A time to live specification { 'AttributeName' : String, 'Enabled' : Boolean }
35
+ # time_to_live_specification 'AttributeName' => 'Name', 'Enabled' => true
36
+ # tag 'Name', 'Test'
37
+ # end
38
+ ##
39
+ class DynamoDBTable < Resource
40
+ include Model::Mixin::Taggable
41
+
42
+ type 'AWS::DynamoDB::Table', :dynamodb_table
43
+
44
+ # required
45
+ # A attribute definitions {"AttributeName" : String, "AttributeType" : String}
46
+ # type can be s for string, n for numeric, or b for binary data
47
+ property :attribute_definitions, 'AttributeDefinitions', :type => :list # list of attribute definitions
48
+ # A key schema {"AttributeName" : String, "KeyType" : "HASH or RANGE"}
49
+ property :key_schema, 'KeySchema', :type => :list # list of key schema
50
+ # Provisioned throughout hash {"ReadCapacityUnits" : Number, "WriteCapacityUnits" : Number}
51
+ property :provisioned_throughput, 'ProvisionedThroughput'
52
+ # optional
53
+ # A global seconday index { "IndexName" : String, "KeySchema" : [KeySchema, ... ],
54
+ # "Projection" : { Projection }, "ProvisionedThroughput" : { ProvisionedThroughput }}
55
+ property :global_secondary_indexes, 'GlobalSecondaryIndexes', :type => :list # list of global secondary indexes
56
+ # A local secondary index { "IndexName" : String, "KeySchema" : [ KeySchema, ...], "Projection" : { Projection }}
57
+ property :local_secondary_indexes, 'LocalSecondaryIndexes', :type => :list
58
+ # A point in time recovery specification { "PointInTimeRecoveryEnabled" : Boolean}
59
+ property :point_in_time_recovery_specification, 'PointInTimeRecoverySpecification'
60
+ # A sse specification { "SSEEnabled" : Boolean}
61
+ property :sse_specification, 'SSESpecification'
62
+ # A stream specification { "StreamViewType" : String}
63
+ property :stream_specification, 'StreamSpecification'
64
+ property :table_name, 'TableName'
65
+ # A time to live specification { "AttributeName" : String, "Enabled" : Boolean}
66
+ property :time_to_live_specification, 'TimeToLiveSpecification'
67
+
68
+ def render(*args)
69
+ super.tap do |resource|
70
+ render_tags(resource)
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,101 @@
1
+ require 'spec_helper'
2
+
3
+ class Convection::Model::Template::Resource
4
+ describe DynamoDBTable do
5
+ let(:template) do
6
+ Convection.template do
7
+ dynamodb_table 'TestTable' do
8
+ # A attribute definitions { 'AttributeName' : String, 'AttributeType' : String }
9
+ attribute_definitions 'AttributeName' => 'Name', 'AttributeType' => 'Type'
10
+ # A key schema { 'AttributeName' : String, 'KeyType' : 'HASH or RANGE' }
11
+ key_schema 'AttributeName' => 'Name', 'KeyType' => 'HASH'
12
+ # Provisioned throughout hash {'ReadCapacityUnits' : Number, 'WriteCapacityUnits' : Number }
13
+ provisioned_throughput 'ReadCapacityUnits' => 100, 'WriteCapacityUnits' => 100
14
+ # optional
15
+ # A global seconday index { 'IndexName' : String, 'KeySchema' : [KeySchema, ...], 'Projection' : { Projection },
16
+ # 'ProvisionedThroughput' : { ProvisionedThroughput }}
17
+ global_secondary_indexes 'IndexName' => 'Name', 'KeySchema' => [{ 'AttributeName' => 'Name', 'KeyType' => 'HASH' }],
18
+ 'Projection' => { 'NonKeyAttributes' => [{ 'AttributeName' => 'Name2', 'AttributeType' => 'Type' }], 'ProjectionType' => 'Type' },
19
+ 'ProvisionedThroughput' => { 'ReadCapacityUnits' => 100, 'WriteCapacityUnits' => 100 }
20
+ # A local secondary index { 'IndexName' : String, 'KeySchema' : [ KeySchema, ...], 'Projection' : { Projection }}
21
+ local_secondary_indexes 'IndexName' => 'Name', 'KeySchema' => [{ 'AttributeName' => 'Name', 'KeyType' => 'HASH' }],
22
+ 'Projection' => { 'NonKeyAttributes' => [{ 'AttributeName' => 'Name2', 'AttributeType' => 'Type' }], 'ProjectionType' => 'Type' }
23
+ # A point in time recovery specification { 'PointInTimeRecoveryEnabled' : Boolean }
24
+ point_in_time_recovery_specification 'PointInTimeRecoveryEnabled' => true
25
+ # A sse specification { 'SSEEnabled' : Boolean }
26
+ sse_specification 'SSEEnabled' => false
27
+ # A stream specification { 'StreamViewType' : String }
28
+ stream_specification 'StreamViewType' => 'Type'
29
+ table_name 'TableName'
30
+ # A time to live specification { 'AttributeName' : String, 'Enabled' : Boolean }
31
+ time_to_live_specification 'AttributeName' => 'Name', 'Enabled' => true
32
+ tag 'Name', 'Test'
33
+ end
34
+ end
35
+ end
36
+
37
+ subject do
38
+ template_json
39
+ .fetch('Resources')
40
+ .fetch('TestTable')
41
+ .fetch('Properties')
42
+ end
43
+
44
+ it 'sets the AttributeDefinitions' do
45
+ expect(subject['AttributeDefinitions']).to include(hash_including('AttributeName' => 'Name', 'AttributeType' => 'Type'))
46
+ end
47
+
48
+ it 'sets the KeySchema' do
49
+ expect(subject['KeySchema']).to include(hash_including('AttributeName' => 'Name', 'KeyType' => 'HASH'))
50
+ end
51
+
52
+ it 'sets the ProvisionedThroughput' do
53
+ expect(subject['ProvisionedThroughput']).to include('ReadCapacityUnits' => 100, 'WriteCapacityUnits' => 100)
54
+ end
55
+
56
+ it 'sets the GlobalSecondaryIndexes' do
57
+ expect(subject['GlobalSecondaryIndexes']).to include(hash_including('IndexName' => 'Name',
58
+ 'KeySchema' => [{ 'AttributeName' => 'Name', 'KeyType' => 'HASH' }],
59
+ 'Projection' => { 'NonKeyAttributes' => [{ 'AttributeName' => 'Name2', 'AttributeType' => 'Type' }],
60
+ 'ProjectionType' => 'Type' },
61
+ 'ProvisionedThroughput' => { 'ReadCapacityUnits' => 100, 'WriteCapacityUnits' => 100 }))
62
+ end
63
+
64
+ it 'sets the LocalSecondaryIndexes' do
65
+ expect(subject['LocalSecondaryIndexes']).to include(hash_including('IndexName' => 'Name',
66
+ 'KeySchema' => [{ 'AttributeName' => 'Name', 'KeyType' => 'HASH' }],
67
+ 'Projection' => { 'NonKeyAttributes' => [{ 'AttributeName' => 'Name2', 'AttributeType' => 'Type' }],
68
+ 'ProjectionType' => 'Type' }))
69
+ end
70
+
71
+ it 'sets the PointInTimeRecoverySpecification' do
72
+ expect(subject['PointInTimeRecoverySpecification']).to include('PointInTimeRecoveryEnabled' => true)
73
+ end
74
+
75
+ it 'sets the SSESpecification' do
76
+ expect(subject['SSESpecification']).to include('SSEEnabled' => false)
77
+ end
78
+
79
+ it 'sets the StreamSpecification' do
80
+ expect(subject['StreamSpecification']).to include('StreamViewType' => 'Type')
81
+ end
82
+
83
+ it 'sets the TableName' do
84
+ expect(subject['TableName']).to eq('TableName')
85
+ end
86
+
87
+ it 'sets the TimeToLiveSpecification' do
88
+ expect(subject['TimeToLiveSpecification']).to include('AttributeName' => 'Name', 'Enabled' => true)
89
+ end
90
+
91
+ it 'sets tags' do
92
+ expect(subject['Tags']).to include(hash_including('Key' => 'Name', 'Value' => 'Test'))
93
+ end
94
+
95
+ private
96
+
97
+ def template_json
98
+ JSON.parse(template.to_json)
99
+ end
100
+ end
101
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convection
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.28.pre.beta.1
4
+ version: 2.2.28.pre.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Manero
@@ -173,6 +173,7 @@ files:
173
173
  - lib/convection/model/template/resource/aws_cloud_watch_alarm.rb
174
174
  - lib/convection/model/template/resource/aws_cloudfront_distribution.rb
175
175
  - lib/convection/model/template/resource/aws_directory_service_simple_ad.rb
176
+ - lib/convection/model/template/resource/aws_dynamodb_table.rb
176
177
  - lib/convection/model/template/resource/aws_ec2_customer_gateway.rb
177
178
  - lib/convection/model/template/resource/aws_ec2_dhcp_options.rb
178
179
  - lib/convection/model/template/resource/aws_ec2_eip.rb
@@ -337,6 +338,7 @@ files:
337
338
  - spec/convection/model/cloudfile_spec.rb
338
339
  - spec/convection/model/template/condition_spec.rb
339
340
  - spec/convection/model/template/resource/aws_auto_scaling_auto_scaling_group_spec.rb
341
+ - spec/convection/model/template/resource/aws_dynamodb_table_spec.rb
340
342
  - spec/convection/model/template/resource/aws_efs_file_system_spec.rb
341
343
  - spec/convection/model/template/resource/aws_efs_mount_target_spec.rb
342
344
  - spec/convection/model/template/resource/aws_rds_db__clusterparametergroup_spec.rb
@@ -412,6 +414,7 @@ test_files:
412
414
  - spec/convection/model/cloudfile_spec.rb
413
415
  - spec/convection/model/template/condition_spec.rb
414
416
  - spec/convection/model/template/resource/aws_auto_scaling_auto_scaling_group_spec.rb
417
+ - spec/convection/model/template/resource/aws_dynamodb_table_spec.rb
415
418
  - spec/convection/model/template/resource/aws_efs_file_system_spec.rb
416
419
  - spec/convection/model/template/resource/aws_efs_mount_target_spec.rb
417
420
  - spec/convection/model/template/resource/aws_rds_db__clusterparametergroup_spec.rb