How to access a plugin? #1371
-
Hello I am working with AWS and have defined a plugin in .gomplate.yaml.
How can I use it in a template? With a datasource I would use the function datasource. Passing the plugin via command line is not an option. Normally I would use the function aws.Account. But this function fails with an STS timeout error in 1 region. I am using multiple regions. So I must be able to specify a timeout. Plugins allow this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you're having timeouts, maybe have a look at adjusting the As far as using plugins, the As a general note, since you're piping output in your particular command you'll probably need to put that in a shell script, or at least interpret it with Hope that helps! |
Beta Was this translation helpful? Give feedback.
If you're having timeouts, maybe have a look at adjusting the
AWS_TIMEOUT
environment variable - see Configuring AWS for details.As far as using plugins, the
plugins
docs should cover usage. In short, it makes a new function available with the same name that you use in your config. In your case that would beawsAccount
.As a general note, since you're piping output in your particular command you'll probably need to put that in a shell script, or at least interpret it with
sh
(likecmd: sh -c "curl 169.254.169.254/latest/meta-data/identity-credentials/ec2/info 2>/dev/null | jq '.AccountId'"
), because pipes (2>
and|
in your command) are shell-specific constructs.Hope that helps!