Trait lambda_runtime_types::rotate::RotateRunner
source · [−]pub trait RotateRunner<'a, Shared, Secret> where
Shared: Send + Sync + 'a,
Secret: 'static + Send, {
fn setup<'async_trait>(
region: &'a str
) -> Pin<Box<dyn Future<Output = Result<Shared>> + Send + 'async_trait>>
where
'a: 'async_trait;
fn create<'life0, 'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
smc: &'life0 Smc
) -> Pin<Box<dyn Future<Output = Result<SecretContainer<Secret>>> + Send + 'async_trait>>
where
'a: 'async_trait,
'life0: 'async_trait;
fn set<'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
secret_new: SecretContainer<Secret>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'a: 'async_trait;
fn test<'async_trait>(
shared: &'a Shared,
secret_new: SecretContainer<Secret>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'a: 'async_trait;
fn finish<'async_trait>(
_shared: &'a Shared,
_secret_cur: SecretContainer<Secret>,
_secret_new: SecretContainer<Secret>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'a: 'async_trait,
{ ... }
}
Available on crate features
rotate_rusoto
or rotate_aws_sdk
only.Expand description
Defines a type which is executed every time a lambda
is invoced. This type is made for SecretManager
rotation lambdas.
Types:
Shared
: Type which is shared between lambda invocations. Note that lambda will create multiple environments for simulations invokations and environments are only kept alive for a certain time. It is thus not guaranteed that data can be reused, but with this types its possible.Secret
: The structure of the secret stored in theSecretManager
. May contain only necessary fields, as other undefined fields are internally preserved.
Required Methods
See documentation of super::Runner::setup
Create a new secret without setting it yet. Only called if there is no pending secret available (which may happen if rotation fails at any stage)
Set the secret in the service
Only called if password is not already set, checked by
calling test
with new password beforehand. The reason
for that it, that a failure in a later stage means all
stages are called again with set failing as the old password
does not work anymore