pangea 0.0.18 → 0.0.19

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 746e86daf200ae24f179f3eddc322306015901c34568441fb6d99253a830e08a
4
- data.tar.gz: 1f880f91d76a69c5b01c8b7b78aab0fea581f6288ddc6efad79cf3dd92907d54
3
+ metadata.gz: 12e73dbb5bbcbde2a5c66a219663f748e2ca4880f5f04984faeedf3cdbc56425
4
+ data.tar.gz: 52c2729a3f9236e7189e960d34835027599ed119e06f47efd2db1b936aa42583
5
5
  SHA512:
6
- metadata.gz: f4d3bd435c5882dd4212201c49db423f7da6ec94506db0ef1691109b17179559bcf6b735df924f9aef69c8150a39998d5283295950b348b2f7ab395db6ef98c5
7
- data.tar.gz: 45a1696bd7c5d8d095d2a1cf54069d81a4e1cf8442c05581efcb44aaf26cb00d884c65303fc95e4c9c27abc1d62ccd5036f813b1911173d85b825408d4ef62ad
6
+ metadata.gz: f7f3ccfe178b11fbc8c781f1c5b93e6c2579433627528eb6f147a3568c42d346c9fa70d075bf547dd77634393879f2f15bf7aea7f572a03c56d7f57f7e48883c
7
+ data.tar.gz: fd3f4dff05a1fe467cc42c767a7532bb975bb88ee7c6a31bdec7fa7648b7ef0ccba5988fadc430f600521d0199fecb16a13f9372f8e5c991d396c32c06706303
@@ -3,6 +3,7 @@ require %(pangea/synthesizer/config)
3
3
  require %(pangea/cli/config)
4
4
  require %(json)
5
5
  require %(aws-sdk-dynamodb)
6
+ require %(aws-sdk-s3)
6
7
 
7
8
  class ConfigCommand < PangeaCommand
8
9
  usage do
@@ -37,6 +38,14 @@ class ConfigCommand < PangeaCommand
37
38
  return false
38
39
  end
39
40
 
41
+ def s3
42
+ @s3 ||= Aws::S3::Resource.new
43
+ end
44
+
45
+ def bucket_exist?(name)
46
+ s3.bucket(name).exists?
47
+ end
48
+
40
49
  def dynamodb
41
50
  @dynamodb ||= Aws::DynamoDB::Client.new
42
51
  end
@@ -77,6 +86,10 @@ class ConfigCommand < PangeaCommand
77
86
  ns.each_key do |ctx_name|
78
87
  ctx = ns[ctx_name]
79
88
  if ctx[:state_config][:terraform][:s3]
89
+ ###################################################################
90
+ # dynamodb table setup
91
+ ###################################################################
92
+
80
93
  unless table_exists?(ctx[:state_config][:terraform][:s3][:dynamodb_table])
81
94
  begin
82
95
  result = dynamodb.create_table(
@@ -89,6 +102,22 @@ class ConfigCommand < PangeaCommand
89
102
  puts error.message.to_s
90
103
  end
91
104
  end
105
+
106
+ # dynamodb table setup
107
+
108
+ ###################################################################
109
+ # s3 bucket setup
110
+ ###################################################################
111
+ if bucket_exist?(ctx[:state_config][:terraform][:s3][:bucket])
112
+ puts "bucket already exists: #{ctx[:state_config][:terraform][:s3][:bucket]}"
113
+ else
114
+ s3.create_bucket(
115
+ bucket: ctx[:state_config][:terrraform][:s3][:bucket]
116
+ )
117
+ end
118
+
119
+ # end s3 bucket setup
120
+
92
121
  end
93
122
  end
94
123
  end
@@ -1,3 +1,3 @@
1
1
  module Pangea
2
- VERSION = %(0.0.18).freeze
2
+ VERSION = %(0.0.19).freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pangea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - drzthslnt@gmail.com