pub trait Query: Sealed { }
Expand description
A query for a specific Secret
in AWS Secrets Manager. See Manager::get_secret
for usage.
§Sealed
You cannot implement this trait yourself.
Implementors§
impl Query for VersionIdQuery<'_>
Query by the version id of the secret as well as the secret name or ARN.
use aws_parameters_and_secrets_lambda::QueryBuilder;
let query = QueryBuilder::new("secret-name")
.with_version_id("18b94218-543d-4d67-aec5-f8e6a41f7813");
let secret = manager.get_secret(query);
impl Query for VersionStageQuery<'_>
Query by the stage of the secret as well as the secret name or ARN.
use aws_parameters_and_secrets_lambda::QueryBuilder;
let query = QueryBuilder::new("secret-name")
.with_version_stage("AWSPREVIOUS");
let secret = manager.get_secret(query);
impl<T: AsRef<str>> Query for T
Query by the secret name or ARN.
This returns the current value of the secret (stage = “AWSCURRENT”) and is usually what you want to use.
Any string-like type can be used, including String
, &str
, and std::borrow::Cow<str>
.
let secret = manager.get_secret("secret-name");