Trait lambda_runtime_types::rotate::RotateRunner [−][src]
pub trait RotateRunner<Shared, Secret> where
Shared: Default + Send + Sync,
Secret: 'static + Send, {
fn setup<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>;
fn create<'life0, 'life1, 'life2, 'async_trait>(
shared: &'life0 Shared,
secret_cur: SecretContainer<Secret>,
smc: &'life1 Smc,
region: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<SecretContainer<Secret>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn set<'life0, 'life1, 'async_trait>(
shared: &'life0 Shared,
secret_cur: SecretContainer<Secret>,
secret_new: SecretContainer<Secret>,
region: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait;
fn test<'life0, 'life1, 'async_trait>(
shared: &'life0 Shared,
secret_new: SecretContainer<Secret>,
region: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait;
fn finish<'life0, 'life1, 'async_trait>(
_shared: &'life0 Shared,
_secret_new: SecretContainer<Secret>,
_region: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
{ ... }
}
This is supported on crate feature
rotate
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
fn create<'life0, 'life1, 'life2, 'async_trait>(
shared: &'life0 Shared,
secret_cur: SecretContainer<Secret>,
smc: &'life1 Smc,
region: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<SecretContainer<Secret>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create<'life0, 'life1, 'life2, 'async_trait>(
shared: &'life0 Shared,
secret_cur: SecretContainer<Secret>,
smc: &'life1 Smc,
region: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<SecretContainer<Secret>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
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
Provided methods
Perform any work which may be necessary to complete rotation