aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-08-13 14:53:03 -0400
committerBen Burwell <ben@benburwell.com>2019-08-13 14:53:03 -0400
commit8455351e962997b84aac02c53e9f6db4f739cad9 (patch)
tree7083abd283a91918b8b75faeed9fe087ff08cd63
parent510b0c47434347f899e6d6815c60522434d7d5b9 (diff)
jq: adopt
-rw-r--r--templates/.jq/aws.jq12
1 files changed, 12 insertions, 0 deletions
diff --git a/templates/.jq/aws.jq b/templates/.jq/aws.jq
new file mode 100644
index 0000000..2a3cd54
--- /dev/null
+++ b/templates/.jq/aws.jq
@@ -0,0 +1,12 @@
+def gettag(name): .Tags[] | select(.Key == name).Value;
+
+def getInstanceMetadata: .Reservations[].Instances[] |
+ [
+ .PrivateIpAddress,
+ .PublicIpAddress // "--",
+ gettag("Name") // "--",
+ .InstanceId,
+ .InstanceType
+ ] |
+ join("\t");
+