@@ -21,6 +21,7 @@ The following commands are available when this module is loaded:
21
21
22
22
## <a name =" license " ></a >License
23
23
24
+ ```
24
25
Copyright 2015-2018 by Vegard IT GmbH, Germany, https://vegardit.com
25
26
SPDX-License-Identifier: Apache-2.0
26
27
@@ -35,6 +36,7 @@ distributed under the License is distributed on an "AS IS" BASIS,
35
36
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36
37
See the License for the specific language governing permissions and
37
38
limitations under the License.
39
+ ```
38
40
39
41
40
42
## <a name =" -aws-account-id " ></a >-aws-account-id
@@ -55,9 +57,9 @@ Options:
55
57
56
58
* Implementation:*
57
59
``` bash
58
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
60
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
59
61
60
- $get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /accountId/ {print $4}'
62
+ $http_get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /accountId/ {print $4}'
61
63
```
62
64
63
65
@@ -79,9 +81,9 @@ Options:
79
81
80
82
* Implementation:*
81
83
``` bash
82
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
84
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
83
85
84
- $get http://169.254.169.254/latest/meta-data/placement/availability-zone
86
+ $http_get http://169.254.169.254/latest/meta-data/placement/availability-zone
85
87
```
86
88
87
89
@@ -113,14 +115,14 @@ Options:
113
115
114
116
* Implementation:*
115
117
``` bash
116
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
118
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
117
119
118
120
if [[ ! $_region ]]; then
119
- local _region=$( $get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /region/ {print $4}' )
121
+ local _region=$( $http_get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /region/ {print $4}' )
120
122
fi
121
123
122
124
if [[ ! $_STACK_NAME ]]; then
123
- local instanceId=$( $get http://169.254.169.254/latest/meta-data/instance-id)
125
+ local instanceId=$( $http_get http://169.254.169.254/latest/meta-data/instance-id)
124
126
local _STACK_NAME=$( aws ec2 describe-instances --region $_region --instance-id $instanceId --query ' Reservations[*].Instances[*].Tags[?Key==`aws:cloudformation:stack-name`].Value' --output text)
125
127
fi
126
128
@@ -146,9 +148,9 @@ Options:
146
148
147
149
* Implementation:*
148
150
``` bash
149
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
151
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
150
152
151
- $get http://169.254.169.254/latest/meta-data/instance-id
153
+ $http_get http://169.254.169.254/latest/meta-data/instance-id
152
154
```
153
155
154
156
@@ -201,9 +203,9 @@ Options:
201
203
202
204
* Implementation:*
203
205
``` bash
204
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
206
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
205
207
206
- $get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /privateIp/ {print $4}'
208
+ $http_get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /privateIp/ {print $4}'
207
209
```
208
210
209
211
@@ -225,9 +227,9 @@ Options:
225
227
226
228
* Implementation:*
227
229
``` bash
228
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
230
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
229
231
230
- $get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /region/ {print $4}'
232
+ $http_get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /region/ {print $4}'
231
233
```
232
234
233
235
@@ -252,10 +254,10 @@ Options:
252
254
253
255
* Implementation:*
254
256
``` bash
255
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
257
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
256
258
257
- local region=$( $get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /region/ {print $4}' )
258
- local instanceId=$( $get http://169.254.169.254/latest/meta-data/instance-id)
259
+ local region=$( $http_get http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F\" ' /region/ {print $4}' )
260
+ local instanceId=$( $http_get http://169.254.169.254/latest/meta-data/instance-id)
259
261
aws ec2 describe-instances --region $region --instance-id $instanceId --query ' Reservations[*].Instances[*].Tags[?Key==`aws:cloudformation:stack-name`].Value' --output text
260
262
```
261
263
@@ -278,9 +280,10 @@ Options:
278
280
279
281
* Implementation:*
280
282
``` bash
281
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
283
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
282
284
283
- $get http://169.254.169.254/latest/meta-data/network/interfaces/macs/$( $get http://169.254.169.254/latest/meta-data/mac) /vpc-ipv4-cidr-block
285
+ local mac=$( $http_get http://169.254.169.254/latest/meta-data/mac)
286
+ $http_get http://169.254.169.254/latest/meta-data/network/interfaces/macs/$mac /vpc-ipv4-cidr-block
284
287
```
285
288
286
289
@@ -302,9 +305,10 @@ Options:
302
305
303
306
* Implementation:*
304
307
``` bash
305
- hash wget & > /dev/null && local get =" wget -qO-" || local get =" curl -s"
308
+ hash wget & > /dev/null && local http_get =" wget -qO-" || local http_get =" curl -s"
306
309
307
- $get http://169.254.169.254/latest/meta-data/network/interfaces/macs/$( $get http://169.254.169.254/latest/meta-data/mac) /vpc-id
310
+ local mac=$( $http_get http://169.254.169.254/latest/meta-data/mac)
311
+ $http_get http://169.254.169.254/latest/meta-data/network/interfaces/macs/$mac /vpc-id
308
312
```
309
313
310
314
0 commit comments