mirror of
https://github.com/floci-io/floci.git
synced 2026-11-28 16:11:48 -05:00
feat(backup): add CreateLogicallyAirGappedBackupVault (#6015)
* feat(backup): add CreateLogicallyAirGappedBackupVault
Route PUT /logically-air-gapped-backup-vaults/{name}. The vault shares the
standard vault namespace and ARN shape; DescribeBackupVault reports VaultType
LOGICALLY_AIR_GAPPED_BACKUP_VAULT, VaultState and the retention days. Both
retention values are required, MinRetentionDays >= 7, MaxRetentionDays >= Min.
The vault is locked at creation so the existing retention enforcement applies,
vault-lock put/delete are rejected on it, and ListBackupVaults honours the
vaultType filter.
Closes #4986
* docs(backup): correct the service matrix operation count
* fix(backup): fail a job whose vault was replaced before it completed
A backup job resolved its vault by name at completion. Deleting a
logically air-gapped (or locked) vault while a job was in flight is
allowed, since it holds no recovery point yet; recreating the name as a
standard vault then received the old job's recovery point, which the
unlocked replacement let be deleted inside the original vault's minimum
retention.
Completion now checks, under the vault-name monitor, that the vault
holding the name is the incarnation the job started in. If not, the job
ends FAILED with no recovery point, as it cannot land in a vault that no
longer exists.
* fix(backup): air-gapped vault LockDate at creation; standard vault VaultType BACKUP_VAULT
CreateLogicallyAirGappedBackupVault now sets LockDate to the creation
date, so the vault's lock reads as compliance mode (immutable) rather
than a governance lock with no LockDate. DescribeBackupVault and
ListBackupVaults report VaultType BACKUP_VAULT for standard vaults,
filled at read time so vaults stored with no VaultType are covered.
This commit is contained in:
1 parent
f8ab55f319
commit
65e35adf54
7 files changed
+409
-11
No files matched your search
@@ -429,4 +429,35 @@ class BackupTest {
|
||||
assertThatThrownBy(() -> backup.describeBackupVault(r -> r.backupVaultName(VAULT_NAME)))
|
||||
.isInstanceOf(ResourceNotFoundException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(90)
|
||||
@DisplayName("CreateLogicallyAirGappedBackupVault - DescribeBackupVault reports its type, state and retention")
|
||||
void logicallyAirGappedVaultRoundTrip() {
|
||||
String name = "compat-air-gapped-vault";
|
||||
try {
|
||||
CreateLogicallyAirGappedBackupVaultResponse created = backup.createLogicallyAirGappedBackupVault(r -> r
|
||||
.backupVaultName(name)
|
||||
.minRetentionDays(7L)
|
||||
.maxRetentionDays(30L)
|
||||
.backupVaultTags(Map.of("env", "compat-test")));
|
||||
assertThat(created.backupVaultName()).isEqualTo(name);
|
||||
assertThat(created.backupVaultArn()).endsWith(":backup-vault:" + name);
|
||||
assertThat(created.creationDate()).isNotNull();
|
||||
assertThat(created.vaultState()).isEqualTo(VaultState.AVAILABLE);
|
||||
|
||||
DescribeBackupVaultResponse described = backup.describeBackupVault(r -> r.backupVaultName(name));
|
||||
assertThat(described.vaultType()).isEqualTo(VaultType.LOGICALLY_AIR_GAPPED_BACKUP_VAULT);
|
||||
assertThat(described.vaultState()).isEqualTo(VaultState.AVAILABLE);
|
||||
assertThat(described.minRetentionDays()).isEqualTo(7L);
|
||||
assertThat(described.maxRetentionDays()).isEqualTo(30L);
|
||||
|
||||
assertThat(backup.listTags(r -> r.resourceArn(created.backupVaultArn())).tags())
|
||||
.containsEntry("env", "compat-test");
|
||||
} finally {
|
||||
backup.deleteBackupVault(r -> r.backupVaultName(name));
|
||||
}
|
||||
assertThatThrownBy(() -> backup.describeBackupVault(r -> r.backupVaultName(name)))
|
||||
.isInstanceOf(ResourceNotFoundException.class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user