idlc-sdk-deploy 1.0.15 → 1.0.16
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/idlc-sdk-deploy/config.rb +39 -39
- data/lib/idlc-sdk-deploy/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: 8ca29ccf9ec0260df48a59d9c51c1794fdd98a177ca681704facf892bad60b3d
|
4
|
+
data.tar.gz: d1ea345c78f83de0cbe25cd083cb77498adfcc2c310b3b99b5cb39b029b5fd9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1ca60aee6f1406197e580e01311e1f3715dff89538407ffebdac64fa57a1666a1cd15ab9f1f66115c3a078ebda59a1119fba710a164a6205ecc79b5949eb497
|
7
|
+
data.tar.gz: 3e01334633f21e1d44cff1eea89ae4f1768a71b4b225763ca7da79b8e6f9ff60c94cc4261dbb4e922fa44f79d5c76c1caa45ecdb65be50f6fdf829342e1fbe24
|
@@ -85,6 +85,45 @@ module Idlc
|
|
85
85
|
|
86
86
|
metadata
|
87
87
|
end
|
88
|
+
|
89
|
+
def get_instance
|
90
|
+
# Get the current instance id from the instance metadata.
|
91
|
+
metadata_endpoint = 'http://169.254.169.254/latest/meta-data/'
|
92
|
+
instance_id = Net::HTTP.get( URI.parse( metadata_endpoint + 'instance-id' ) )
|
93
|
+
|
94
|
+
# Create instance object with instance id.
|
95
|
+
instance = Aws::EC2::Instance.new( id: instance_id, region: ENV['AWS_REGION'] )
|
96
|
+
instance['instance_id'] = instance_id
|
97
|
+
|
98
|
+
instance.tags.each do |tag|
|
99
|
+
# Grab all of the tags as node attributes
|
100
|
+
instance['tags'][tag.key] = tag.value
|
101
|
+
end
|
102
|
+
|
103
|
+
instance
|
104
|
+
end
|
105
|
+
|
106
|
+
def set_hostname (instance)
|
107
|
+
hostname = instance['tags']['Name']
|
108
|
+
|
109
|
+
unless (instance['tags']['Name'].start_with? 'db')
|
110
|
+
# Use instance id for unique hostname
|
111
|
+
hostname = instance['tags']['Name'][0..4] + '-' + instance['instance_id'][2..10]
|
112
|
+
end
|
113
|
+
|
114
|
+
instance.create_tags(
|
115
|
+
dry_run: false,
|
116
|
+
tags: [ # required
|
117
|
+
{
|
118
|
+
key: 'hostname',
|
119
|
+
value: hostname
|
120
|
+
}
|
121
|
+
]
|
122
|
+
)
|
123
|
+
|
124
|
+
#return
|
125
|
+
hostname
|
126
|
+
end
|
88
127
|
end
|
89
128
|
|
90
129
|
def initialize(region)
|
@@ -124,45 +163,6 @@ module Idlc
|
|
124
163
|
|
125
164
|
private
|
126
165
|
|
127
|
-
def get_instance
|
128
|
-
# Get the current instance id from the instance metadata.
|
129
|
-
metadata_endpoint = 'http://169.254.169.254/latest/meta-data/'
|
130
|
-
instance_id = Net::HTTP.get( URI.parse( metadata_endpoint + 'instance-id' ) )
|
131
|
-
|
132
|
-
# Create instance object with instance id.
|
133
|
-
instance = Aws::EC2::Instance.new( id: instance_id, region: ENV['AWS_REGION'] )
|
134
|
-
instance['instance_id'] = instance_id
|
135
|
-
|
136
|
-
instance.tags.each do |tag|
|
137
|
-
# Grab all of the tags as node attributes
|
138
|
-
instance['tags'][tag.key] = tag.value
|
139
|
-
end
|
140
|
-
|
141
|
-
instance
|
142
|
-
end
|
143
|
-
|
144
|
-
def set_hostname (instance)
|
145
|
-
hostname = instance['tags']['Name']
|
146
|
-
|
147
|
-
unless (instance['tags']['Name'].start_with? 'db')
|
148
|
-
# Use instance id for unique hostname
|
149
|
-
hostname = instance['tags']['Name'][0..4] + '-' + instance['instance_id'][2..10]
|
150
|
-
end
|
151
|
-
|
152
|
-
instance.create_tags(
|
153
|
-
dry_run: false,
|
154
|
-
tags: [ # required
|
155
|
-
{
|
156
|
-
key: 'hostname',
|
157
|
-
value: hostname
|
158
|
-
}
|
159
|
-
]
|
160
|
-
)
|
161
|
-
|
162
|
-
#return
|
163
|
-
hostname
|
164
|
-
end
|
165
|
-
|
166
166
|
def configure_tfstatev8(bucket, sub_bucket, working_directory)
|
167
167
|
args = []
|
168
168
|
args << '-backend=s3'
|