idlc-sdk-deploy 1.0.13 → 1.0.14

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: 8cc1c73f22974bd19614ad69810a9eeb602a88407d3346afb8f90aeb6ec858a2
4
- data.tar.gz: 8df5136c24e87d46808fd10d3a7232859c5df11615bbe6437f3da302471c9027
3
+ metadata.gz: b7c09fbfe1bbad55c136e3a6861ed2e705510ef0e7df7d28d87aa2248ff5ecc4
4
+ data.tar.gz: 10c084ff29eac6495ce0af24607f16b10a5edeca12dd156ab8fbe56321399098
5
5
  SHA512:
6
- metadata.gz: 0d8bd3b18808d41b9f49284a85af9451a79842b5950c7fe3da59f9ded989782e05c60cadd9dcdd8839ca9b54e67894975e570b731977208b2e61ceb6518af675
7
- data.tar.gz: de46a096cd156b6d777d8591358a65f9501ded8c624569b602a69a436e261887d2fbbdcd40b2a05b87135be5e1dab5c151823600f495352879763cf1072c2b10
6
+ metadata.gz: b31d096b3dd0bd0b5ba6417ad020d5e142102fcfaa41ccc2081b375cc8858f7875298bf5f078fbfaa71fd38b542b53d3f28f6ac0bae921f400c91e1cd1a948ef
7
+ data.tar.gz: 1ae1b19fd117c2e9a26f4f565f0d3c8d4ed51e4e16793511d9a565fc51e5a98262296202d48c94f5fd57200f489476d4fdefe4f3ba55bd7e2b370b14fb5242c2
@@ -40,6 +40,54 @@ module Idlc
40
40
  # return environment metadata
41
41
  get_env_metadata(instance['tags']['environment_key'])
42
42
  end
43
+
44
+ def get_env_metadata(env_key)
45
+ client = Idlc::AWSLambdaProxy.new()
46
+
47
+ request = {
48
+ service: 'deploy',
49
+ method: 'GET',
50
+ lambda: 'metadata',
51
+ pathParameters: {
52
+ jobName: env_key
53
+ }
54
+ }
55
+ metadata = client.fetch(request)['deployments'].first
56
+
57
+ request = {
58
+ service: 'config',
59
+ method: 'GET',
60
+ lambda: "accounts",
61
+ pathParameters: {
62
+ accountName: metadata['environment']['account_alias']
63
+ }
64
+ }
65
+ account = client.fetch(request)
66
+
67
+ metadata['account'] = account['accounts'].first
68
+
69
+ request = {
70
+ service: 'config',
71
+ method: 'GET',
72
+ lambda: "applications",
73
+ pathParameters: {
74
+ appName: metadata['environment']['application_name'].downcase
75
+ }
76
+ }
77
+ application = client.fetch(request)
78
+
79
+ metadata['application'] = application['applications'].first
80
+
81
+ # find db instance
82
+ metadata['instances'].each do |instance|
83
+ if instance['hostname'].start_with? 'db'
84
+ metadata['db_instance'] = instance
85
+ break
86
+ end
87
+ end
88
+
89
+ metadata
90
+ end
43
91
  end
44
92
 
45
93
  def initialize(region)
@@ -118,54 +166,6 @@ module Idlc
118
166
  hostname
119
167
  end
120
168
 
121
- def get_env_metadata(env_key)
122
- client = Idlc::AWSLambdaProxy.new()
123
-
124
- request = {
125
- service: 'deploy',
126
- method: 'GET',
127
- lambda: 'metadata',
128
- pathParameters: {
129
- jobName: env_key
130
- }
131
- }
132
- metadata = client.fetch(request)['deployments'].first
133
-
134
- request = {
135
- service: 'config',
136
- method: 'GET',
137
- lambda: "accounts",
138
- pathParameters: {
139
- accountName: metadata['environment']['account_alias']
140
- }
141
- }
142
- account = client.fetch(request)
143
-
144
- metadata['account'] = account['accounts'].first
145
-
146
- request = {
147
- service: 'config',
148
- method: 'GET',
149
- lambda: "applications",
150
- pathParameters: {
151
- appName: metadata['environment']['application_name'].downcase
152
- }
153
- }
154
- application = client.fetch(request)
155
-
156
- metadata['application'] = application['applications'].first
157
-
158
- # find db instance
159
- metadata['instances'].each do |instance|
160
- if instance['hostname'].start_with? 'db'
161
- metadata['db_instance'] = instance
162
- break
163
- end
164
- end
165
-
166
- metadata
167
- end
168
-
169
169
  def configure_tfstatev8(bucket, sub_bucket, working_directory)
170
170
  args = []
171
171
  args << '-backend=s3'
@@ -1,5 +1,5 @@
1
1
  module Idlc
2
2
  module Deploy
3
- VERSION = '1.0.13'.freeze
3
+ VERSION = '1.0.14'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idlc-sdk-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Cazell