Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template to process from remote datasource (such as aws+ssm) #963

Closed
hongkongkiwi opened this issue Oct 16, 2020 · 7 comments · Fixed by #1336
Closed

Template to process from remote datasource (such as aws+ssm) #963

hongkongkiwi opened this issue Oct 16, 2020 · 7 comments · Fixed by #1336
Assignees

Comments

@hongkongkiwi
Copy link

I read the documentation but couldn't quite figure the answer to my question.

What I would like to do is to store the complete template in AWS SSM Parameter Store. Inside the template is the datasources etc. This way I can use the standard gomplate docker and keep the template easily updatable.

The template is then output to an application specific config file.

Is there a way to dynamically grab the template itself? Then process the downloaded template.

@hongkongkiwi hongkongkiwi changed the title Template from remote datasource Template to process from remote datasource (such as aws+ssm) Oct 16, 2020
@hongkongkiwi
Copy link
Author

To answer my own question, I just saw that you can pass the template via stdin, so for now the way to accomplish my goal is to run gomplate to pull the template, then pass that to another instance of gomplate. e.g. gomplate...... | gomplate

I think this way should work, but am I missing a flag that allows doing this with one instance of gomplate?

@hairyhenderson
Copy link
Owner

Hi @hongkongkiwi, thanks for logging this!

Interestingly, a similar idea came up in Slack today 😉. This is also related to #589.

I'm definitely open to doing this, and this recent interest is good motivation to work on it soon 😉

You could also work around this for now by treating the input template as a datasource instead, like this:

$ gomplate -d mytemplate=aws+ssm://whatever... -i '{{ include "mytemplate" | tmpl.Inline }}'

See https://docs.gomplate.ca/functions/data/#include and https://docs.gomplate.ca/functions/tmpl/#tmpl-inline for the docs on those functions.

@hongkongkiwi
Copy link
Author

That's a great workaround thank you.

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment or this will be automatically closed in a few days.

@github-actions github-actions bot added the Stale label Apr 10, 2023
@hairyhenderson
Copy link
Owner

No movement has happened here yet, but it's still valid. Once #1336 is completed, this will automatically be accomplished.

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment or this will be automatically closed in a few days.

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no
activity. If it is no longer relevant or necessary, please close it.
Given no action, it will be closed in 14 days.

If it's still relevant, one of the following will remove the stale
marking:

  • A maintainer can add this issue to a milestone to indicate that
    it's been accepted and will be worked on
  • A maintainer can remove the stale label
  • Anyone can post an update or other comment

@github-actions github-actions bot added the Stale label Aug 19, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants