belt 0.2.1 → 0.2.3
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 +4 -4
- data/lib/belt/cli/tables_command.rb +23 -17
- data/lib/belt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f58b01f78d1a1b0b6fda926c2916b28bb0db5045c20585a866fff9738ce3d674
|
|
4
|
+
data.tar.gz: 426efc91999e3c39aab7f9bcf267addc2bdffd2fc62e74103fa0c5e0222acfb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41d8f9e02028ca0e19b79d70c87e660c28311cf3012d9b422574fb97e2559b7ae4b0d8e763a926fb4be5f6ffcc9ed7d200a21bba11780c29054feb551f9989d5
|
|
7
|
+
data.tar.gz: f7f77a0b00ed82d58523cf3a83fafc3b92fa075ee2d0e86c0973a427d86d4611ba21c849e5bd2048aae04c9c75cb9437ecd11f7a162f2180de8b4e0002671334
|
|
@@ -14,20 +14,11 @@ module Belt
|
|
|
14
14
|
include AppDetection
|
|
15
15
|
|
|
16
16
|
def self.run(args)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
puts 'Usage: belt setup tables [environment]'
|
|
21
|
-
puts "\nReads schema.tf.rb and generates dynamodb.tf in the app module."
|
|
22
|
-
puts 'You can also set BELT_ENV to skip the environment argument.'
|
|
23
|
-
puts "\nExamples:"
|
|
24
|
-
puts ' belt setup tables'
|
|
25
|
-
puts ' belt setup tables dev'
|
|
26
|
-
puts ' BELT_ENV=dev belt setup tables'
|
|
27
|
-
exit 1
|
|
28
|
-
end
|
|
17
|
+
# Environment argument accepted for backwards compatibility but unused —
|
|
18
|
+
# dynamodb.tf lives in infrastructure/modules/app and uses var.environment.
|
|
19
|
+
EnvResolver.resolve(args)
|
|
29
20
|
|
|
30
|
-
new
|
|
21
|
+
new.run
|
|
31
22
|
end
|
|
32
23
|
|
|
33
24
|
# Automatically sync dynamodb.tf in the app module.
|
|
@@ -35,16 +26,14 @@ module Belt
|
|
|
35
26
|
def self.sync_all_environments
|
|
36
27
|
return unless schema_file_path
|
|
37
28
|
|
|
38
|
-
|
|
39
|
-
new(nil, quiet: true).run
|
|
29
|
+
new(quiet: true).run
|
|
40
30
|
end
|
|
41
31
|
|
|
42
32
|
def self.schema_file_path
|
|
43
33
|
SCHEMA_FILE_CANDIDATES.find { |f| File.exist?(f) }
|
|
44
34
|
end
|
|
45
35
|
|
|
46
|
-
def initialize(
|
|
47
|
-
@env = env
|
|
36
|
+
def initialize(quiet: false)
|
|
48
37
|
@quiet = quiet
|
|
49
38
|
@app_name = detect_app_name
|
|
50
39
|
end
|
|
@@ -136,6 +125,23 @@ module Belt
|
|
|
136
125
|
type = "S"
|
|
137
126
|
}
|
|
138
127
|
|
|
128
|
+
attribute {
|
|
129
|
+
name = "_recent_pk"
|
|
130
|
+
type = "S"
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
attribute {
|
|
134
|
+
name = "createdAt"
|
|
135
|
+
type = "S"
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
global_secondary_index {
|
|
139
|
+
name = "RecentIndex"
|
|
140
|
+
hash_key = "_recent_pk"
|
|
141
|
+
range_key = "createdAt"
|
|
142
|
+
projection_type = "ALL"
|
|
143
|
+
}
|
|
144
|
+
|
|
139
145
|
tags = {
|
|
140
146
|
Name = "#{name}"
|
|
141
147
|
Environment = var.environment
|
data/lib/belt/version.rb
CHANGED