This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit bcdce5e163b1cba9af94e5363587cd0f51309f65 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Jul 11 15:17:54 2022 +0200 CAMEL-18208 - vault: allow to retrieve a specific secret version/revision - AWS Secret Manager --- .../main/docs/aws-secrets-manager-component.adoc | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/components/camel-aws/camel-aws-secrets-manager/src/main/docs/aws-secrets-manager-component.adoc b/components/camel-aws/camel-aws-secrets-manager/src/main/docs/aws-secrets-manager-component.adoc index 0bb1193c83c..f2edb9ac825 100644 --- a/components/camel-aws/camel-aws-secrets-manager/src/main/docs/aws-secrets-manager-component.adoc +++ b/components/camel-aws/camel-aws-secrets-manager/src/main/docs/aws-secrets-manager-component.adoc @@ -153,6 +153,44 @@ You could specify a default value in case the particular field of secret is not In this case if the secret doesn't exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value. +There is also the syntax to get a particular version of the secret for both the approach, with field/default value specified or only with secret: + +[source,xml] +---- +<camelContext> + <route> + <from uri="direct:start"/> + <to uri="{{aws:route@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/> + </route> +</camelContext> +---- + +This approach will return the RAW route secret with version 'bf9b4f4b-8e63-43fd-a73c-3e2d3748b451'. + +[source,xml] +---- +<camelContext> + <route> + <from uri="direct:start"/> + <to uri="{{aws:route:default@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/> + </route> +</camelContext> +---- + +This approach will return the route secret value with version 'bf9b4f4b-8e63-43fd-a73c-3e2d3748b451' or default value in case the secret doesn't exist or the version doesn't exist. + +[source,xml] +---- +<camelContext> + <route> + <from uri="direct:start"/> + <log message="Username is {{aws:database/username:admin@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/> + </route> +</camelContext> +---- + +This approach will return the username field of the database secret with version 'bf9b4f4b-8e63-43fd-a73c-3e2d3748b451' or admin in case the secret doesn't exist or the version doesn't exist. + For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done. The only requirement is adding the camel-aws-secrets-manager jar to your Camel application.