Search code examples
apache-camelapache-camel-aws

Trying to access an AWS Secret using Apache Camel "Vault" function for a secret that has a "/" in the name


I´m using this Apache Camel feature to load a secret from AWS Secrets Manager:

https://camel.apache.org/blog/2022/03/secrets-properties-functions/

That works as long as I use a test secret with no "/" in its name. However our secrets are named like this: "xxx/yyy/zzz"

I understand the "/" is used to query json values within the secret. In my case however, the "/" is part of the name of the secret.

Doing something like this does not work (I added ''): camel.vault.aws.secrets='name/of/the/secret' and {{aws:'name/of/the/secret':default}}. No matter what I do, it always tries to access a secret called "name".


Solution

  • This functionality is designed in such a way that the part before '/' is considered as key, and part after '/' is considered as subkey. So this will work correctly for secrets which does not have '/'. However you should be able to fetch the secret with '/' by using camel aws secrets manager component