summaryrefslogtreecommitdiff
path: root/funcs.go
diff options
context:
space:
mode:
authorJames Nugent <james@jen20.com>2020-07-10 12:19:04 -0500
committerJames Nugent <james@jen20.com>2020-07-12 11:50:58 -0500
commit2a30cb153fc6a1edecf571ba125b2daac12e404b (patch)
tree131d69345c65e17fd0cc0ebd6d8580a20c9a504e /funcs.go
parent65936317408b1c865487c669d44ba8ad611b0fbc (diff)
Add gcp.Meta function, equivalent to aws.EC2Meta
This commit adds a new namespace and function: `gcp.Meta`, which can be used to look up values from the GCP Instance Metadata service. An example usage: ``` echo '{{ gcp.Meta "id" }}' | gomplate ``` This also supports paths, so usage like this works: ``` echo '{{ gcp.Meta "network-interfaces/0/ip" }}' | gomplate ```
Diffstat (limited to 'funcs.go')
-rw-r--r--funcs.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/funcs.go b/funcs.go
index e63c9872..2c7e70f1 100644
--- a/funcs.go
+++ b/funcs.go
@@ -12,6 +12,7 @@ func Funcs(d *data.Data) template.FuncMap {
f := template.FuncMap{}
funcs.AddDataFuncs(f, d)
funcs.AWSFuncs(f)
+ funcs.AddGCPFuncs(f)
funcs.AddBase64Funcs(f)
funcs.AddNetFuncs(f)
funcs.AddReFuncs(f)