updateRecoveryPointLifecycle method

Future<UpdateRecoveryPointLifecycleOutput> updateRecoveryPointLifecycle({
  1. required String backupVaultName,
  2. required String recoveryPointArn,
  3. Lifecycle? lifecycle,
})

Sets the transition lifecycle of a recovery point.

The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.

Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

May throw ResourceNotFoundException. May throw InvalidParameterValueException. May throw MissingParameterValueException. May throw ServiceUnavailableException.

Parameter backupVaultName : The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Parameter recoveryPointArn : An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

Parameter lifecycle : The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.

Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

Implementation

Future<UpdateRecoveryPointLifecycleOutput> updateRecoveryPointLifecycle({
  required String backupVaultName,
  required String recoveryPointArn,
  Lifecycle? lifecycle,
}) async {
  ArgumentError.checkNotNull(backupVaultName, 'backupVaultName');
  ArgumentError.checkNotNull(recoveryPointArn, 'recoveryPointArn');
  final $payload = <String, dynamic>{
    if (lifecycle != null) 'Lifecycle': lifecycle,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/backup-vaults/${Uri.encodeComponent(backupVaultName)}/recovery-points/${Uri.encodeComponent(recoveryPointArn)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateRecoveryPointLifecycleOutput.fromJson(response);
}