-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Secrets Manager Datasource Doesn't Appear to Work #2190
Comments
I think this may a duplicate to #2180 - as a workaround, try setting the region? |
It's not that unfortunately, the error message when I hadn't was very clear which was nice:
|
Ah - this reminds me of some strangeness I had to deal with in the old v3 implementation. Looks like some of that got lost in the v4/go-fsimple shuffle. |
This issue is stale because it has been open for 60 days with no If it's still relevant, one of the following will remove the stale
|
I'm not capable but a fix would still be much appreciated |
This issue is stale because it has been open for 60 days with no If it's still relevant, one of the following will remove the stale
|
And again. I'm not capable but a fix would still be much appreciated |
@sjiveson I'm sorry I haven't been able to solve this yet. My time available to work on gomplate is limited. I'll try to find some time over the next few days. |
@sjiveson I've actually started digging into this a bit - just to double-check - And, have you tried referring to the key directly? $ gomplate --verbose -d 'foo=aws+sm:goemplate' -i '{{ ds "foo" }}' It's somewhat unusual to specify the whole I think what's going on is the URL parsing has no special-case for the |
Hey. Thank you for responding - I know the feeling well, hence my own delay in responding 😏 . It was a typo with the secret name but I didn't bother changing it in Secrets Manager and it is the correct name of the secret. Referring to the key directly as you suggested - v3:
With v4:
I should be able to respond more quickly now I'm setup to test again. |
Thanks @sjiveson - that's strange. I've set up a few secrets in Secrets Manager and I think this is indeed the path issue I described above: $ aws secretsmanager create-secret --name one --secret-string "one's value"
...
$ aws secretsmanager create-secret --name /two --secret-string "two's value"
...
$ aws secretsmanager create-secret --name dir/three --secret-string "three's value"
...
$ aws secretsmanager create-secret --name /dir/four --secret-string "four's value"
... So there should be 4 secrets, accessible as
$ gomplate -d secret=aws+sm:one -i '{{ ds "secret" }}'
11:03:16 ERR err="renderTemplate: failed to render template <arg>: template: <arg>:1:3: executing \"<arg>\" at <ds \"secret\">: error calling ds: couldn't read datasource 'secret' (aws+sm:one): stat (url: \"aws+sm:///\", name: \"one\"): stat one: file does not exist"
$ gomplate -d secret=aws+sm:///two -i '{{ ds "secret" }}'
two's value
$ bin/gomplate -d secret=aws+sm:dir/three -i '{{ ds "secret" }}'
11:04:05 ERR err="renderTemplate: failed to render template <arg>: template: <arg>:1:3: executing \"<arg>\" at <ds \"secret\">: error calling ds: couldn't read datasource 'secret' (aws+sm:dir/three): stat (url: \"aws+sm:///\", name: \"dir/three\"): stat three: file does not exist"
$ bin/gomplate -d secret=aws+sm:///dir/four -i '{{ ds "secret" }}'
four's value |
I thought this was perhaps a $ bin/fscli_darwin-amd64 -base-url aws+sm: cat one
one's value
$ bin/fscli_darwin-amd64 -base-url aws+sm:/ cat two
two's value So, the bug is gomplate-specific. |
Ok I think I have a fix at #2284 |
Just checked this again and it seems I missed one use-case: $ gomplate --verbose -d 'sm=aws+sm:' -i '{{ ds "sm" "mysecret" }}'
23:26:51 DBG starting gomplate
23:26:51 DBG config is:
---
datasources:
sm:
header: {}
url: 'aws+sm:'
in: '{{ ds "s...'
version=4.2.1-91-g7eb7829d build=7eb7829d
23:26:51 DBG completed rendering templatesRendered=0 errors=1 duration=103.26749ms
23:26:51 ERR err="renderTemplate: failed to render template <arg>: template: <arg>:1:3: executing \"<arg>\" at <ds \"sm\" \"mysecret\">: error calling ds: couldn't read datasource 'sm' (aws+sm:///mysecret): stat (url: \"aws+sm:///\", name: \"mysecret\"): stat mysecret: file does not exist" Reopening to fix that... |
Many thanks for your efforts - that and your time are much appreciated. Cheers |
Hi,
I'm attempting to retrieve secrets using AWS Secrets Manager (on an EC2 instance), however, I'm getting this error:
Looking at my CloudTrail logs, I'm seeing this:
As you can see on that last line, a forward slash is being included at the start of the secretId when it shouldn't be. This also occurs if I specify, for instance, goemplate/something or goemplate/something/something.
Any assistance appreciated and thanks for a great tool.
The text was updated successfully, but these errors were encountered: