backup

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 26 Imported by: 0

README

Backup

Parity grade: A · SDK aws-sdk-go-v2/service/backup@v1.54.8 · last audited 2026-07-12 (d56dc525)

Coverage

Metric Value
Operations audited 17 (15 ok, 1 partial, 1 gap)
Feature families 11 (11 ok)
Known gaps 4
Deferred items 4
Resource leaks clean
Known gaps
  • TieringConfiguration backend data model doesn't match AWS: real API keys tiering configs by TieringConfigurationName (CreateTieringConfigurationInput.TieringConfiguration has BackupVaultName + ResourceSelection nested inside), gopherstack keys by vault name and has no TieringConfigurationName/ResourceSelection concept at all. Routing constant (pathTieringConf="/backup-vault-tiering") is also NOT AWS's real path ("/tiering-configurations", "/tiering-configurations/{Name}"). Needs a backend redesign, not a routing patch -- deliberately left alone this pass.
  • RestoreAccessVault List/Revoke real paths are NESTED under the source air-gapped vault (GET/DELETE /logically-air-gapped-backup-vaults/{BackupVaultName}/restore-access-backup-vaults[/{RestoreAccessBackupVaultArn}]), not the flat /restore-access-backup-vaults collection gopherstack currently uses for List/Revoke. Create (flat /restore-access-backup-vaults, now PUT) is fixed; List/Revoke are still unroutable against a real SDK client.
  • ListRecoveryPointsByLegalHold backend always returns an empty slice -- legal-hold-to-recovery-point association is never tracked anywhere (CreateLegalHold takes no resource selectors in this emulator). Now at least routable; the empty-list behavior is a pre-existing simplification, not something this pass introduced or fixed.
  • DescribeBackupVault omits MpaApprovalTeamArn/MpaSessionArn/LatestMpaApprovalTeamUpdate/EncryptionKeyType even though AssociateBackupVaultMpaApprovalTeam state is tracked (b.mpaApprovals) -- minor completeness gap, not a functional break.
Deferred
  • CopyJob family (StartCopyJob/ListCopyJobs/DescribeCopyJob) -- routing verified correct against real SDK paths, but response-shape/error-code depth not re-audited this pass.
  • RestoreJob family beyond DescribeRestoreJob (StartRestoreJob, ListRestoreJobs, GetRestoreJobMetadata, PutRestoreValidationResult) -- routing verified correct, response shapes not deep-audited.
  • Framework/ReportPlan controls/settings nested shapes (FrameworkControl.ControlScope, ReportSetting) -- not wire-diffed against SDK this pass.
  • Restore testing selection ProtectedResourceType/Conditions deep shape -- not wire-diffed this pass.

More

Documentation

Index

Constants

View Source
const (
	VaultTypeBackupVault = "BACKUP_VAULT"
	VaultTypeAirGapped   = "LOGICALLY_AIR_GAPPED_BACKUP_VAULT"
)

Variables

View Source
var (
	ErrNotFound      = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	ErrAlreadyExists = awserr.New("AlreadyExistsException", awserr.ErrConflict)
	ErrValidation    = awserr.New("ValidationException", awserr.ErrInvalidParameter)
)

Functions

func ParseTimeFilter

func ParseTimeFilter(s string) *time.Time

ParseTimeFilter parses an RFC3339 timestamp string into a *time.Time. Returns nil if the string is empty or invalid.

Types

type AdvancedBackupSetting

type AdvancedBackupSetting struct {
	BackupOptions map[string]string `json:"backupOptions,omitempty"`
	ResourceType  string            `json:"resourceType"`
}

AdvancedBackupSetting enables resource-type-specific backup options (e.g., Windows VSS).

type CalculatedLifecycle

type CalculatedLifecycle struct {
	MoveToColdStorageAt *time.Time `json:"moveToColdStorageAt,omitempty"`
	DeleteAt            *time.Time `json:"deleteAt,omitempty"`
}

CalculatedLifecycle holds computed lifecycle transition timestamps for a recovery point.

type ConfigProvider

type ConfigProvider interface {
	GetBackupSettings() Settings
}

ConfigProvider is a private interface to extract Backup configuration from the abstract AppContext Config.

type CopyAction

type CopyAction struct {
	DestinationBackupVaultArn string    `json:"destinationBackupVaultArn"`
	Lifecycle                 Lifecycle `json:"lifecycle,omitzero"`
}

CopyAction defines a cross-vault copy triggered by a backup rule.

type CopyJob

type CopyJob struct {
	CreationDate              time.Time  `json:"creationDate"`
	CompletionDate            *time.Time `json:"completionDate,omitempty"`
	CopyJobID                 string     `json:"copyJobId"`
	SourceBackupVaultArn      string     `json:"sourceBackupVaultArn,omitempty"`
	DestinationBackupVaultArn string     `json:"destinationBackupVaultArn,omitempty"`
	ResourceArn               string     `json:"resourceArn,omitempty"`
	ResourceType              string     `json:"resourceType,omitempty"`
	IAMRoleArn                string     `json:"iamRoleArn,omitempty"`
	State                     string     `json:"state"`
	AccountID                 string     `json:"accountId"`
	Region                    string     `json:"region"`
}

CopyJob represents an AWS Backup copy job.

type Framework

type Framework struct {
	CreationTime         time.Time          `json:"creationTime"`
	Tags                 *tags.Tags         `json:"tags,omitempty"`
	FrameworkName        string             `json:"frameworkName"`
	FrameworkArn         string             `json:"frameworkArn"`
	FrameworkDescription string             `json:"frameworkDescription,omitempty"`
	FrameworkStatus      string             `json:"frameworkStatus,omitempty"`
	DeploymentStatus     string             `json:"deploymentStatus,omitempty"`
	FrameworkControls    []FrameworkControl `json:"frameworkControls,omitempty"`
}

Framework represents an AWS Backup audit framework.

type FrameworkControl

type FrameworkControl struct {
	ControlInputParameters map[string]string `json:"controlInputParameters,omitempty"`
	ControlScope           map[string]any    `json:"controlScope,omitempty"`
	ControlName            string            `json:"controlName"`
}

FrameworkControl represents a compliance control within an audit framework.

type Handler

type Handler struct {
	Backend *InMemoryBackend
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for AWS Backup operations (REST-JSON protocol).

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new Backup handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this Backup instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the Backup operation name from the REST path.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the primary resource identifier from the URL path.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported Backup operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for Backup requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset implements service.Resettable by delegating to the backend.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches AWS Backup REST requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker starts the background janitor if configured.

func (*Handler) WithJanitor

func (h *Handler) WithJanitor(
	interval, jobTTL time.Duration,
	taskTimeout ...time.Duration,
) *Handler

WithJanitor attaches a background janitor to the handler. The optional taskTimeout bounds each sweep; 0 means no per-task timeout.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend is the in-memory store for AWS Backup resources.

Resource collections are *store.Table[T] (see pkgs/store's package doc). PERSISTED tables are registered on registry; VOLATILE tables (never part of backendSnapshot) are constructed but deliberately not registered -- see store_setup.go for the full split and rationale. A handful of maps remain plain map[string]string because their values are not *T (mirroring services/ses's "policies" precedent).

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory Backup backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the AWS account ID this backend is configured for.

func (*InMemoryBackend) AddRecoveryPoint

func (b *InMemoryBackend) AddRecoveryPoint(vaultName string, rp *RecoveryPoint) error

AddRecoveryPoint adds a recovery point to a vault (used internally and in tests).

func (*InMemoryBackend) AssociateBackupVaultMpaApprovalTeam

func (b *InMemoryBackend) AssociateBackupVaultMpaApprovalTeam(
	vaultName, mpaApprovalTeamArn string,
) error

AssociateBackupVaultMpaApprovalTeam associates an MPA approval team with a backup vault.

func (*InMemoryBackend) CancelLegalHold

func (b *InMemoryBackend) CancelLegalHold(legalHoldID string) error

CancelLegalHold cancels (deletes) a legal hold by ID.

func (*InMemoryBackend) CompleteBackupJob

func (b *InMemoryBackend) CompleteBackupJob(jobID string) error

CompleteBackupJob transitions a job from CREATED to COMPLETED and creates a recovery point. This models AWS's asynchronous job completion in a synchronous way for the emulator.

func (*InMemoryBackend) CreateBackupPlan

func (b *InMemoryBackend) CreateBackupPlan(
	planName string,
	rules []Rule,
	advancedSettings []AdvancedBackupSetting,
	kv map[string]string,
) (*Plan, error)

CreateBackupPlan creates a new backup plan.

func (*InMemoryBackend) CreateBackupPlanValidated

func (b *InMemoryBackend) CreateBackupPlanValidated(
	planName string,
	rules []Rule,
	advancedSettings []AdvancedBackupSetting,
	kv map[string]string,
) (*Plan, error)

CreateBackupPlanValidated creates a backup plan after validating its rules.

func (*InMemoryBackend) CreateBackupSelection

func (b *InMemoryBackend) CreateBackupSelection(
	planID, selectionName, iamRoleArn string,
	resources, notResources []string,
	listOfTags []TagCondition,
	conditions *SelectionConditions,
) (*Selection, error)

CreateBackupSelection creates a backup selection for a plan.

func (*InMemoryBackend) CreateBackupVault

func (b *InMemoryBackend) CreateBackupVault(
	name, encryptionKeyArn, creatorRequestID string,
	kv map[string]string,
) (*Vault, error)

CreateBackupVault creates a new backup vault.

func (*InMemoryBackend) CreateFramework

func (b *InMemoryBackend) CreateFramework(
	name, description string,
	controls []FrameworkControl,
) (*Framework, error)

CreateFramework creates an audit framework.

func (*InMemoryBackend) CreateLegalHold

func (b *InMemoryBackend) CreateLegalHold(title, description string) (*LegalHold, error)

CreateLegalHold creates a legal hold.

func (*InMemoryBackend) CreateLogicallyAirGappedBackupVault

func (b *InMemoryBackend) CreateLogicallyAirGappedBackupVault(
	name, creatorRequestID string,
	minRetentionDays, maxRetentionDays int64,
	kv map[string]string,
) (*Vault, error)

CreateLogicallyAirGappedBackupVault creates a logically air-gapped backup vault.

func (*InMemoryBackend) CreateReportPlan

func (b *InMemoryBackend) CreateReportPlan(
	name, description string,
	deliveryChannel *ReportDeliveryChannel,
	setting *ReportSetting,
) (*ReportPlan, error)

CreateReportPlan creates a report plan.

func (*InMemoryBackend) CreateRestoreAccessBackupVault

func (b *InMemoryBackend) CreateRestoreAccessBackupVault(
	sourceVaultArn, vaultName string,
	_ string,
	_ map[string]string,
) (*RestoreAccessVault, error)

CreateRestoreAccessBackupVault creates a restore access backup vault.

func (*InMemoryBackend) CreateRestoreTestingPlan

func (b *InMemoryBackend) CreateRestoreTestingPlan(
	name, scheduleExpression string,
	startWindowHours int64,
) (*RestoreTestingPlan, error)

CreateRestoreTestingPlan creates a restore testing plan.

func (*InMemoryBackend) CreateRestoreTestingSelection

func (b *InMemoryBackend) CreateRestoreTestingSelection(
	planName, selectionName, protectedResourceType string,
) (*RestoreTestingSelection, error)

CreateRestoreTestingSelection creates a selection within a restore testing plan.

func (*InMemoryBackend) CreateTieringConfiguration

func (b *InMemoryBackend) CreateTieringConfiguration(vaultName string) error

CreateTieringConfiguration creates a tiering configuration for a vault.

func (*InMemoryBackend) DeleteBackupPlan

func (b *InMemoryBackend) DeleteBackupPlan(idOrName string) error

DeleteBackupPlan deletes a backup plan by ID or name.

func (*InMemoryBackend) DeleteBackupPlanChecked

func (b *InMemoryBackend) DeleteBackupPlanChecked(idOrName string) (*Plan, error)

DeleteBackupPlanChecked deletes a backup plan, returning an error if selections exist.

func (*InMemoryBackend) DeleteBackupSelection

func (b *InMemoryBackend) DeleteBackupSelection(planID, selectionID string) error

DeleteBackupSelection deletes a backup selection.

func (*InMemoryBackend) DeleteBackupVault

func (b *InMemoryBackend) DeleteBackupVault(name string) error

DeleteBackupVault deletes a vault by name.

func (*InMemoryBackend) DeleteBackupVaultAccessPolicy

func (b *InMemoryBackend) DeleteBackupVaultAccessPolicy(vaultName string) error

DeleteBackupVaultAccessPolicy deletes the access policy for a vault.

func (*InMemoryBackend) DeleteBackupVaultChecked

func (b *InMemoryBackend) DeleteBackupVaultChecked(name string) error

DeleteBackupVaultChecked deletes a vault, enforcing lock and recovery point constraints.

func (*InMemoryBackend) DeleteBackupVaultLockConfiguration

func (b *InMemoryBackend) DeleteBackupVaultLockConfiguration(vaultName string) error

DeleteBackupVaultLockConfiguration deletes the lock configuration for a vault.

func (*InMemoryBackend) DeleteBackupVaultNotifications

func (b *InMemoryBackend) DeleteBackupVaultNotifications(vaultName string) error

DeleteBackupVaultNotifications deletes notification configuration for a vault.

func (*InMemoryBackend) DeleteFramework

func (b *InMemoryBackend) DeleteFramework(name string) error

DeleteFramework deletes a framework.

func (*InMemoryBackend) DeleteRecoveryPoint

func (b *InMemoryBackend) DeleteRecoveryPoint(vaultName, recoveryPointArn string) error

DeleteRecoveryPoint deletes a recovery point from a vault.

func (*InMemoryBackend) DeleteReportPlan

func (b *InMemoryBackend) DeleteReportPlan(name string) error

DeleteReportPlan deletes a report plan.

func (*InMemoryBackend) DeleteRestoreTestingPlan

func (b *InMemoryBackend) DeleteRestoreTestingPlan(planName string) error

DeleteRestoreTestingPlan deletes a restore testing plan and all its selections.

func (*InMemoryBackend) DeleteRestoreTestingSelection

func (b *InMemoryBackend) DeleteRestoreTestingSelection(planName, selectionName string) error

DeleteRestoreTestingSelection deletes a restore testing selection.

func (*InMemoryBackend) DeleteTieringConfiguration

func (b *InMemoryBackend) DeleteTieringConfiguration(vaultName string) error

DeleteTieringConfiguration removes a tiering configuration.

func (*InMemoryBackend) DescribeBackupJob

func (b *InMemoryBackend) DescribeBackupJob(jobID string) (*Job, error)

DescribeBackupJob returns a backup job by ID.

func (*InMemoryBackend) DescribeBackupVault

func (b *InMemoryBackend) DescribeBackupVault(name string) (*Vault, error)

DescribeBackupVault returns a vault by name.

func (*InMemoryBackend) DescribeCopyJob

func (b *InMemoryBackend) DescribeCopyJob(copyJobID string) (*CopyJob, error)

DescribeCopyJob returns a copy job by ID.

func (*InMemoryBackend) DescribeFramework

func (b *InMemoryBackend) DescribeFramework(name string) (*Framework, error)

DescribeFramework returns a framework by name.

func (*InMemoryBackend) DescribeGlobalSettings

func (b *InMemoryBackend) DescribeGlobalSettings() (map[string]string, time.Time)

DescribeGlobalSettings returns the account-level global backup settings.

func (*InMemoryBackend) DescribeProtectedResource

func (b *InMemoryBackend) DescribeProtectedResource(
	resourceArn string,
) (*ProtectedResource, error)

DescribeProtectedResource returns a protected resource by ARN.

func (*InMemoryBackend) DescribeRecoveryPoint

func (b *InMemoryBackend) DescribeRecoveryPoint(
	vaultName, recoveryPointArn string,
) (*RecoveryPoint, error)

DescribeRecoveryPoint returns a specific recovery point.

func (*InMemoryBackend) DescribeRegionSettings

func (b *InMemoryBackend) DescribeRegionSettings() *RegionSettings

DescribeRegionSettings returns the regional backup preferences.

func (*InMemoryBackend) DescribeReportJob

func (b *InMemoryBackend) DescribeReportJob(reportJobID string) (*ReportJob, error)

DescribeReportJob returns a report job by ID.

func (*InMemoryBackend) DescribeReportPlan

func (b *InMemoryBackend) DescribeReportPlan(name string) (*ReportPlan, error)

DescribeReportPlan returns a report plan by name.

func (*InMemoryBackend) DescribeRestoreJob

func (b *InMemoryBackend) DescribeRestoreJob(restoreJobID string) (*RestoreJob, error)

DescribeRestoreJob returns a restore job by ID.

func (*InMemoryBackend) DescribeScanJob

func (b *InMemoryBackend) DescribeScanJob(scanJobID string) (*ScanJob, error)

DescribeScanJob returns a scan job by ID.

func (*InMemoryBackend) DisassociateBackupVaultMpaApprovalTeam

func (b *InMemoryBackend) DisassociateBackupVaultMpaApprovalTeam(vaultName string) error

DisassociateBackupVaultMpaApprovalTeam removes the MPA approval team for a vault.

func (*InMemoryBackend) DisassociateRecoveryPoint

func (b *InMemoryBackend) DisassociateRecoveryPoint(vaultName, recoveryPointArn string) error

DisassociateRecoveryPoint disassociates a recovery point from a vault.

func (*InMemoryBackend) DisassociateRecoveryPointFromParent

func (b *InMemoryBackend) DisassociateRecoveryPointFromParent(
	vaultName, recoveryPointArn string,
) error

DisassociateRecoveryPointFromParent disassociates a recovery point from its parent.

func (*InMemoryBackend) ExportBackupPlanTemplate

func (b *InMemoryBackend) ExportBackupPlanTemplate(planID string) (string, error)

ExportBackupPlanTemplate exports a plan as a template JSON string.

func (*InMemoryBackend) GetBackupPlan

func (b *InMemoryBackend) GetBackupPlan(idOrName string) (*Plan, error)

GetBackupPlan returns a backup plan by ID or name.

func (*InMemoryBackend) GetBackupSelection

func (b *InMemoryBackend) GetBackupSelection(planID, selectionID string) (*Selection, error)

GetBackupSelection returns a specific backup selection.

func (*InMemoryBackend) GetBackupVaultAccessPolicy

func (b *InMemoryBackend) GetBackupVaultAccessPolicy(vaultName string) (*VaultAccessPolicy, error)

GetBackupVaultAccessPolicy returns the access policy for a vault.

func (*InMemoryBackend) GetBackupVaultLockConfig

func (b *InMemoryBackend) GetBackupVaultLockConfig(vaultName string) (*VaultLockConfig, error)

GetBackupVaultLockConfig returns the lock configuration for a vault.

func (*InMemoryBackend) GetBackupVaultNotifications

func (b *InMemoryBackend) GetBackupVaultNotifications(
	vaultName string,
) (*VaultNotificationConfig, error)

GetBackupVaultNotifications returns notification configuration for a vault.

func (*InMemoryBackend) GetLegalHold

func (b *InMemoryBackend) GetLegalHold(legalHoldID string) (*LegalHold, error)

GetLegalHold returns a legal hold by ID.

func (*InMemoryBackend) GetRecoveryPointIndexDetails

func (b *InMemoryBackend) GetRecoveryPointIndexDetails(
	vaultName, recoveryPointArn string,
) (string, error)

GetRecoveryPointIndexDetails returns index details for a recovery point.

func (*InMemoryBackend) GetRecoveryPointRestoreMetadata

func (b *InMemoryBackend) GetRecoveryPointRestoreMetadata(
	vaultName, recoveryPointArn string,
) (map[string]string, error)

GetRecoveryPointRestoreMetadata returns restore metadata for a recovery point.

func (*InMemoryBackend) GetRestoreTestingPlan

func (b *InMemoryBackend) GetRestoreTestingPlan(planName string) (*RestoreTestingPlan, error)

GetRestoreTestingPlan returns a restore testing plan by name.

func (*InMemoryBackend) GetRestoreTestingSelection

func (b *InMemoryBackend) GetRestoreTestingSelection(
	planName, selectionName string,
) (*RestoreTestingSelection, error)

GetRestoreTestingSelection returns a specific restore testing selection.

func (*InMemoryBackend) GetTieringConfiguration

func (b *InMemoryBackend) GetTieringConfiguration(vaultName string) (*TieringConfiguration, error)

GetTieringConfiguration returns the tiering configuration for a vault.

func (*InMemoryBackend) IsVaultLocked

func (b *InMemoryBackend) IsVaultLocked(vaultName string) bool

IsVaultLocked reports whether the vault's lock date has passed (vault is now immutable).

func (*InMemoryBackend) ListBackupJobSummaries

func (b *InMemoryBackend) ListBackupJobSummaries() []map[string]any

ListBackupJobSummaries returns a summary of backup jobs by resource type and status.

func (*InMemoryBackend) ListBackupJobs

func (b *InMemoryBackend) ListBackupJobs(vaultName string) []*Job

ListBackupJobs returns all backup jobs, optionally filtered by vault name. Results are sorted by creation time (newest first).

func (*InMemoryBackend) ListBackupJobsFiltered

func (b *InMemoryBackend) ListBackupJobsFiltered(f ListBackupJobsFilter) ([]*Job, string)

ListBackupJobsFiltered returns backup jobs matching the filter, with pagination. Returns (jobs, nextToken).

func (*InMemoryBackend) ListBackupPlanVersions

func (b *InMemoryBackend) ListBackupPlanVersions(planID string) ([]*Plan, error)

ListBackupPlanVersions returns all versions of a backup plan.

func (*InMemoryBackend) ListBackupPlans

func (b *InMemoryBackend) ListBackupPlans() []*Plan

ListBackupPlans returns all backup plans sorted by name.

func (*InMemoryBackend) ListBackupPlansPaged

func (b *InMemoryBackend) ListBackupPlansPaged(f ListPlansFilter) ([]*Plan, string)

ListBackupPlansPaged returns backup plans with pagination.

func (*InMemoryBackend) ListBackupSelections

func (b *InMemoryBackend) ListBackupSelections(planID string) ([]*Selection, error)

ListBackupSelections returns all backup selections for a plan.

func (*InMemoryBackend) ListBackupVaults

func (b *InMemoryBackend) ListBackupVaults() []*Vault

ListBackupVaults returns all backup vaults sorted by name.

func (*InMemoryBackend) ListBackupVaultsFiltered

func (b *InMemoryBackend) ListBackupVaultsFiltered(f ListVaultsFilter) ([]*Vault, string)

ListBackupVaultsFiltered returns vaults with optional type filter and pagination.

func (*InMemoryBackend) ListCopyJobSummaries

func (b *InMemoryBackend) ListCopyJobSummaries() []map[string]any

ListCopyJobSummaries returns a summary of copy jobs.

func (*InMemoryBackend) ListCopyJobs

func (b *InMemoryBackend) ListCopyJobs() []*CopyJob

ListCopyJobs returns all copy jobs.

func (*InMemoryBackend) ListCopyJobsFiltered

func (b *InMemoryBackend) ListCopyJobsFiltered(f ListCopyJobsFilter) ([]*CopyJob, string)

ListCopyJobsFiltered returns copy jobs matching the filter, with pagination.

func (*InMemoryBackend) ListFrameworks

func (b *InMemoryBackend) ListFrameworks() []*Framework

ListFrameworks returns all frameworks.

func (*InMemoryBackend) ListIndexedRecoveryPoints

func (b *InMemoryBackend) ListIndexedRecoveryPoints() []*RecoveryPoint

ListIndexedRecoveryPoints returns recovery points with an active index.

func (*InMemoryBackend) ListLegalHolds

func (b *InMemoryBackend) ListLegalHolds() []*LegalHold

ListLegalHolds returns all legal holds.

func (*InMemoryBackend) ListProtectedResources

func (b *InMemoryBackend) ListProtectedResources() []*ProtectedResource

ListProtectedResources returns all protected resources.

func (*InMemoryBackend) ListProtectedResourcesByBackupVault

func (b *InMemoryBackend) ListProtectedResourcesByBackupVault(
	vaultName string,
) []*ProtectedResource

ListProtectedResourcesByBackupVault returns protected resources for a vault.

func (*InMemoryBackend) ListRecoveryPointsByBackupVault

func (b *InMemoryBackend) ListRecoveryPointsByBackupVault(
	vaultName string,
) ([]*RecoveryPoint, error)

ListRecoveryPointsByBackupVault returns all recovery points for a vault.

func (*InMemoryBackend) ListRecoveryPointsByLegalHold

func (b *InMemoryBackend) ListRecoveryPointsByLegalHold(legalHoldID string) []*RecoveryPoint

ListRecoveryPointsByLegalHold returns recovery points associated with a legal hold. In this implementation, returns all recovery points (legal hold → RP association not tracked).

func (*InMemoryBackend) ListRecoveryPointsByResource

func (b *InMemoryBackend) ListRecoveryPointsByResource(resourceArn string) []*RecoveryPoint

ListRecoveryPointsByResource returns recovery points for a given resource ARN across all vaults.

func (*InMemoryBackend) ListRecoveryPointsFiltered

func (b *InMemoryBackend) ListRecoveryPointsFiltered(
	vaultName string,
	f ListRPFilter,
) ([]*RecoveryPoint, string, error)

ListRecoveryPointsFiltered returns recovery points for a vault with optional filters and pagination.

func (*InMemoryBackend) ListReportJobs

func (b *InMemoryBackend) ListReportJobs(reportPlanName string) []*ReportJob

ListReportJobs returns all report jobs, optionally filtered by report plan name.

func (*InMemoryBackend) ListReportPlans

func (b *InMemoryBackend) ListReportPlans() []*ReportPlan

ListReportPlans returns all report plans.

func (*InMemoryBackend) ListRestoreAccessBackupVaults

func (b *InMemoryBackend) ListRestoreAccessBackupVaults() []*RestoreAccessVault

ListRestoreAccessBackupVaults returns all restore access vaults.

func (*InMemoryBackend) ListRestoreJobs

func (b *InMemoryBackend) ListRestoreJobs() []*RestoreJob

ListRestoreJobs returns all restore jobs.

func (*InMemoryBackend) ListRestoreJobsByProtectedResource

func (b *InMemoryBackend) ListRestoreJobsByProtectedResource(resourceArn string) []*RestoreJob

ListRestoreJobsByProtectedResource returns restore jobs for a given resource ARN.

func (*InMemoryBackend) ListRestoreTestingPlans

func (b *InMemoryBackend) ListRestoreTestingPlans() []*RestoreTestingPlan

ListRestoreTestingPlans returns all restore testing plans.

func (*InMemoryBackend) ListRestoreTestingSelections

func (b *InMemoryBackend) ListRestoreTestingSelections(
	planName string,
) ([]*RestoreTestingSelection, error)

ListRestoreTestingSelections returns all selections for a restore testing plan.

func (*InMemoryBackend) ListScanJobs

func (b *InMemoryBackend) ListScanJobs() []*ScanJob

ListScanJobs returns all scan jobs.

func (*InMemoryBackend) ListTags

func (b *InMemoryBackend) ListTags(resourceArn string) (map[string]string, error)

ListTags returns tags for a resource by ARN. Supported resource types: backup vaults, backup plans, frameworks, report plans.

func (*InMemoryBackend) ListTieringConfigurations

func (b *InMemoryBackend) ListTieringConfigurations() []*TieringConfiguration

ListTieringConfigurations returns all tiering configurations.

func (*InMemoryBackend) PutBackupVaultAccessPolicy

func (b *InMemoryBackend) PutBackupVaultAccessPolicy(vaultName, policy string) error

PutBackupVaultAccessPolicy sets an access policy for a vault. The policy must be valid JSON representing an IAM policy document.

func (*InMemoryBackend) PutBackupVaultLockConfiguration

func (b *InMemoryBackend) PutBackupVaultLockConfiguration(
	vaultName string,
	cfg *VaultLockConfig,
) error

PutBackupVaultLockConfiguration sets the lock configuration for a vault. If a LockDate already exists and has passed, the configuration is immutable.

func (*InMemoryBackend) PutBackupVaultNotifications

func (b *InMemoryBackend) PutBackupVaultNotifications(
	vaultName string,
	cfg *VaultNotificationConfig,
) error

PutBackupVaultNotifications sets notification configuration for a vault. Events are validated against the canonical AWS Backup event enum.

func (*InMemoryBackend) PutProtectedResource

func (b *InMemoryBackend) PutProtectedResource(resourceArn, resourceType, vaultName string)

PutProtectedResource adds or updates a protected resource record (called internally by StartBackupJob).

func (*InMemoryBackend) PutRestoreValidationResult

func (b *InMemoryBackend) PutRestoreValidationResult(restoreJobID, validationStatus string)

PutRestoreValidationResult records validation for a restore job.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state, returning the backend to a clean initial state. Tags resources are properly closed before discarding.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) RevokeRestoreAccessBackupVault

func (b *InMemoryBackend) RevokeRestoreAccessBackupVault(vaultName string) error

RevokeRestoreAccessBackupVault removes a restore access vault.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartBackupJob

func (b *InMemoryBackend) StartBackupJob(
	vaultName, resourceArn, iamRoleArn, resourceType string,
) (*Job, error)

StartBackupJob starts a new backup job.

func (*InMemoryBackend) StartCopyJob

func (b *InMemoryBackend) StartCopyJob(
	recoveryPointArn, sourceVaultArn, destVaultArn, iamRoleArn string,
) *CopyJob

StartCopyJob creates a new copy job.

func (*InMemoryBackend) StartReportJob

func (b *InMemoryBackend) StartReportJob(reportPlanName string) *ReportJob

StartReportJob creates a new report job for a report plan.

func (*InMemoryBackend) StartRestoreJob

func (b *InMemoryBackend) StartRestoreJob(
	recoveryPointArn, iamRoleArn, resourceType string,
	metadata map[string]string,
) *RestoreJob

StartRestoreJob creates a new restore job.

func (*InMemoryBackend) StartScanJob

func (b *InMemoryBackend) StartScanJob(backupVaultArn string) *ScanJob

StartScanJob creates a new scan job for a backup vault.

func (*InMemoryBackend) StopBackupJob

func (b *InMemoryBackend) StopBackupJob(jobID string) error

StopBackupJob cancels a running backup job.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceArn string, kv map[string]string) error

TagResource adds tags to a resource by ARN. Supported resource types: backup vaults, backup plans, frameworks, report plans.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error

UntagResource removes the given tag keys from a resource identified by ARN. Supported resource types: backup vaults, backup plans, frameworks, report plans.

func (*InMemoryBackend) UpdateBackupPlan

func (b *InMemoryBackend) UpdateBackupPlan(
	idOrName string,
	rules []Rule,
	advancedSettings []AdvancedBackupSetting,
) (*Plan, error)

UpdateBackupPlan updates an existing backup plan.

func (*InMemoryBackend) UpdateBackupPlanValidated

func (b *InMemoryBackend) UpdateBackupPlanValidated(
	idOrName string,
	rules []Rule,
	advancedSettings []AdvancedBackupSetting,
) (*Plan, error)

UpdateBackupPlanValidated updates a backup plan after validating rules.

func (*InMemoryBackend) UpdateFramework

func (b *InMemoryBackend) UpdateFramework(name, description string) (*Framework, error)

UpdateFramework updates a framework's description.

func (*InMemoryBackend) UpdateGlobalSettings

func (b *InMemoryBackend) UpdateGlobalSettings(settings map[string]string)

UpdateGlobalSettings updates the account-level global backup settings.

func (*InMemoryBackend) UpdateRecoveryPointIndexSettings

func (b *InMemoryBackend) UpdateRecoveryPointIndexSettings(
	vaultName, recoveryPointArn, indexStatus string,
) error

UpdateRecoveryPointIndexSettings updates indexing settings for a recovery point.

func (*InMemoryBackend) UpdateRecoveryPointLifecycle

func (b *InMemoryBackend) UpdateRecoveryPointLifecycle(
	vaultName, recoveryPointArn string,
	moveToColdStorageAfterDays, deleteAfterDays int64,
) error

UpdateRecoveryPointLifecycle updates the lifecycle of a recovery point, recomputing its CalculatedLifecycle transition timestamps from CreationDate.

func (*InMemoryBackend) UpdateRegionSettings

func (b *InMemoryBackend) UpdateRegionSettings(
	mgmtPref map[string]bool,
	optInPref map[string]bool,
)

UpdateRegionSettings updates the regional backup preferences.

func (*InMemoryBackend) UpdateReportPlan

func (b *InMemoryBackend) UpdateReportPlan(name, description string) (*ReportPlan, error)

UpdateReportPlan updates a report plan's description.

func (*InMemoryBackend) UpdateRestoreTestingPlan

func (b *InMemoryBackend) UpdateRestoreTestingPlan(
	planName, scheduleExpression string,
	startWindowHours int64,
) (*RestoreTestingPlan, error)

UpdateRestoreTestingPlan updates a restore testing plan.

func (*InMemoryBackend) UpdateRestoreTestingSelection

func (b *InMemoryBackend) UpdateRestoreTestingSelection(
	planName, selectionName, protectedResourceType string,
) (*RestoreTestingSelection, error)

UpdateRestoreTestingSelection updates a restore testing selection.

func (*InMemoryBackend) UpdateTieringConfiguration

func (b *InMemoryBackend) UpdateTieringConfiguration(vaultName string) error

UpdateTieringConfiguration updates a tiering configuration (no-op: config has no mutable fields in this mock).

type Janitor

type Janitor struct {
	Backend     *InMemoryBackend
	Interval    time.Duration
	JobTTL      time.Duration
	TaskTimeout time.Duration
}

Janitor is the Backup background worker that evicts completed backup jobs after a configurable TTL to prevent unbounded growth of in-memory state.

func NewJanitor

func NewJanitor(backend *InMemoryBackend, interval, jobTTL time.Duration) *Janitor

NewJanitor creates a new Backup Janitor for the given backend. Zero values for interval or jobTTL fall back to defaults.

func (*Janitor) Run

func (j *Janitor) Run(ctx context.Context)

Run runs the janitor loop until ctx is cancelled.

func (*Janitor) SweepOnce

func (j *Janitor) SweepOnce(ctx context.Context)

SweepOnce runs a single sweep pass. Exposed for testing.

type Job

type Job struct {
	CreationTime              time.Time  `json:"creationTime"`
	CompletionTime            *time.Time `json:"completionTime,omitempty"`
	ExpectedCompletionDate    *time.Time `json:"expectedCompletionDate,omitempty"`
	StartBy                   *time.Time `json:"startBy,omitempty"`
	ResourceArn               string     `json:"resourceArn,omitempty"`
	BackupJobID               string     `json:"backupJobId"`
	BackupVaultName           string     `json:"backupVaultName"`
	BackupVaultArn            string     `json:"backupVaultArn"`
	ResourceType              string     `json:"resourceType,omitempty"`
	IAMRoleArn                string     `json:"iamRoleArn,omitempty"`
	State                     string     `json:"state"`
	AccountID                 string     `json:"accountId"`
	Region                    string     `json:"region"`
	RecoveryPointArn          string     `json:"recoveryPointArn,omitempty"`
	PercentDone               string     `json:"percentDone,omitempty"`
	MessageCategory           string     `json:"messageCategory,omitempty"`
	ParentJobID               string     `json:"parentJobId,omitempty"`
	CompositeMemberIdentifier string     `json:"compositeMemberIdentifier,omitempty"`
	BytesTransferred          int64      `json:"bytesTransferred,omitempty"`
	BackupSizeInBytes         int64      `json:"backupSizeInBytes,omitempty"`
	IsParent                  bool       `json:"isParent,omitempty"`
}

Job represents an AWS Backup job.

type LegalHold

type LegalHold struct {
	CreationDate time.Time `json:"creationDate"`
	Title        string    `json:"title"`
	Description  string    `json:"description"`
	LegalHoldID  string    `json:"legalHoldId"`
	LegalHoldArn string    `json:"legalHoldArn"`
	Status       string    `json:"status"`
}

LegalHold represents an AWS Backup legal hold.

type Lifecycle

type Lifecycle struct {
	MoveToColdStorageAfterDays          int64 `json:"moveToColdStorageAfterDays,omitempty"`
	DeleteAfterDays                     int64 `json:"deleteAfterDays,omitempty"`
	OptInToArchiveForSupportedResources bool  `json:"optInToArchiveForSupportedResources,omitempty"`
}

Lifecycle holds backup retention lifecycle settings for a rule or recovery point.

type ListBackupJobsFilter

type ListBackupJobsFilter struct {
	CreatedAfter  *time.Time
	CreatedBefore *time.Time
	VaultName     string
	State         string
	ResourceArn   string
	ResourceType  string
	AccountID     string
	ParentJobID   string
	NextToken     string
	MaxResults    int
}

ListBackupJobsFilter contains optional filter parameters for listing backup jobs.

type ListCopyJobsFilter

type ListCopyJobsFilter struct {
	CreatedAfter              *time.Time
	CreatedBefore             *time.Time
	State                     string
	ResourceArn               string
	ResourceType              string
	SourceBackupVaultArn      string
	DestinationBackupVaultArn string
	AccountID                 string
	NextToken                 string
	MaxResults                int
}

ListCopyJobsFilter contains optional filter parameters for listing copy jobs.

type ListPlansFilter

type ListPlansFilter struct {
	NextToken  string
	MaxResults int
}

ListPlansFilter contains pagination parameters for listing backup plans.

type ListRPFilter

type ListRPFilter struct {
	CreatedAfter           *time.Time
	CreatedBefore          *time.Time
	ResourceArn            string
	ResourceType           string
	ParentRecoveryPointArn string
	NextToken              string
	MaxResults             int
}

ListRPFilter contains optional filter parameters for listing recovery points.

type ListVaultsFilter

type ListVaultsFilter struct {
	VaultType  string
	NextToken  string
	MaxResults int
}

ListVaultsFilter contains optional filter parameters for listing backup vaults.

type Plan

type Plan struct {
	CreationTime           time.Time               `json:"creationTime"`
	UpdateTime             *time.Time              `json:"updateTime,omitempty"`
	Tags                   *tags.Tags              `json:"tags,omitempty"`
	BackupPlanName         string                  `json:"backupPlanName"`
	BackupPlanArn          string                  `json:"backupPlanArn"`
	BackupPlanID           string                  `json:"backupPlanId"`
	VersionID              string                  `json:"versionId"`
	AccountID              string                  `json:"accountId"`
	Region                 string                  `json:"region"`
	Rules                  []Rule                  `json:"rules"`
	AdvancedBackupSettings []AdvancedBackupSetting `json:"advancedBackupSettings,omitempty"`
}

Plan represents an AWS Backup plan.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource / CreateBackupPlan.

type ProtectedResource

type ProtectedResource struct {
	LastBackupTime  time.Time `json:"lastBackupTime"`
	ResourceArn     string    `json:"resourceArn"`
	ResourceName    string    `json:"resourceName,omitempty"`
	ResourceType    string    `json:"resourceType"`
	BackupVaultName string    `json:"backupVaultName,omitempty"`
}

ProtectedResource represents a resource protected by AWS Backup.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS Backup.

func (*Provider) Init

Init initializes the Backup service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RecoveryPoint

type RecoveryPoint struct {
	CreationDate              time.Time            `json:"creationDate"`
	CompletionDate            *time.Time           `json:"completionDate,omitempty"`
	Lifecycle                 *Lifecycle           `json:"lifecycle,omitempty"`
	CalculatedLifecycle       *CalculatedLifecycle `json:"calculatedLifecycle,omitempty"`
	RecoveryPointArn          string               `json:"recoveryPointArn"`
	BackupVaultName           string               `json:"backupVaultName"`
	BackupVaultArn            string               `json:"backupVaultArn"`
	ResourceArn               string               `json:"resourceArn,omitempty"`
	ResourceType              string               `json:"resourceType,omitempty"`
	IAMRoleArn                string               `json:"iamRoleArn,omitempty"`
	Status                    string               `json:"status"`
	StorageClass              string               `json:"storageClass,omitempty"`
	EncryptionKeyArn          string               `json:"encryptionKeyArn,omitempty"`
	ParentRecoveryPointArn    string               `json:"parentRecoveryPointArn,omitempty"`
	CompositeMemberIdentifier string               `json:"compositeMemberIdentifier,omitempty"`
	SourceBackupVaultArn      string               `json:"sourceBackupVaultArn,omitempty"`
	BackupSizeInBytes         int64                `json:"backupSizeInBytes,omitempty"`
	IsEncrypted               bool                 `json:"isEncrypted,omitempty"`
}

RecoveryPoint represents an AWS Backup recovery point.

type RegionSettings

type RegionSettings struct {
	ResourceTypeManagementPreference map[string]bool `json:"resourceTypeManagementPreference"`
	ResourceTypeOptInPreference      map[string]bool `json:"resourceTypeOptInPreference"`
}

RegionSettings holds per-region backup preferences.

type ReportDeliveryChannel

type ReportDeliveryChannel struct {
	S3BucketName string   `json:"s3BucketName"`
	Formats      []string `json:"formats,omitempty"`
}

ReportDeliveryChannel specifies the S3 destination and format for report output.

type ReportJob

type ReportJob struct {
	CreationTime   time.Time  `json:"creationTime"`
	CompletionTime *time.Time `json:"completionTime,omitempty"`
	ReportJobID    string     `json:"reportJobId"`
	ReportPlanArn  string     `json:"reportPlanArn"`
	Status         string     `json:"status"`
}

ReportJob represents an AWS Backup report job.

type ReportPlan

type ReportPlan struct {
	Tags                  *tags.Tags             `json:"tags,omitempty"`
	ReportDeliveryChannel *ReportDeliveryChannel `json:"reportDeliveryChannel,omitempty"`
	ReportSetting         *ReportSetting         `json:"reportSetting,omitempty"`
	CreationTime          time.Time              `json:"creationTime"`
	ReportPlanName        string                 `json:"reportPlanName"`
	ReportPlanArn         string                 `json:"reportPlanArn"`
	ReportPlanDescription string                 `json:"reportPlanDescription,omitempty"`
}

ReportPlan represents an AWS Backup report plan.

type ReportSetting

type ReportSetting struct {
	ReportTemplate string   `json:"reportTemplate"`
	FrameworkArns  []string `json:"frameworkArns,omitempty"`
}

ReportSetting specifies the template and frameworks driving a report plan.

type RestoreAccessVault

type RestoreAccessVault struct {
	CreationDate                 time.Time `json:"creationDate"`
	RestoreAccessBackupVaultName string    `json:"restoreAccessBackupVaultName"`
	RestoreAccessBackupVaultArn  string    `json:"restoreAccessBackupVaultArn"`
	SourceBackupVaultArn         string    `json:"sourceBackupVaultArn"`
	VaultState                   string    `json:"vaultState"`
}

RestoreAccessVault represents an AWS Backup restore access backup vault.

type RestoreJob

type RestoreJob struct {
	CompletionDate    *time.Time        `json:"completionDate,omitempty"`
	Metadata          map[string]string `json:"metadata,omitempty"`
	StartTime         time.Time         `json:"startTime"`
	RestoreJobID      string            `json:"restoreJobId"`
	RecoveryPointArn  string            `json:"recoveryPointArn"`
	IAMRoleArn        string            `json:"iamRoleArn"`
	ResourceArn       string            `json:"resourceArn,omitempty"`
	ResourceType      string            `json:"resourceType,omitempty"`
	BackupVaultName   string            `json:"backupVaultName,omitempty"`
	Status            string            `json:"status"`
	StatusMessage     string            `json:"statusMessage,omitempty"`
	PercentDone       string            `json:"percentDone,omitempty"`
	BackupSizeInBytes int64             `json:"backupSizeInBytes,omitempty"`
}

RestoreJob represents an AWS Backup restore job.

type RestoreTestingPlan

type RestoreTestingPlan struct {
	CreationTime           time.Time `json:"creationTime"`
	RestoreTestingPlanName string    `json:"restoreTestingPlanName"`
	RestoreTestingPlanArn  string    `json:"restoreTestingPlanArn"`
	ScheduleExpression     string    `json:"scheduleExpression,omitempty"`
	StartWindowHours       int64     `json:"startWindowHours,omitempty"`
}

RestoreTestingPlan represents an AWS Backup restore testing plan.

type RestoreTestingSelection

type RestoreTestingSelection struct {
	CreationTime                time.Time `json:"creationTime"`
	RestoreTestingPlanName      string    `json:"restoreTestingPlanName"`
	RestoreTestingSelectionName string    `json:"restoreTestingSelectionName"`
	RestoreTestingPlanArn       string    `json:"restoreTestingPlanArn"`
	ProtectedResourceType       string    `json:"protectedResourceType,omitempty"`
}

RestoreTestingSelection represents a selection within a restore testing plan.

type Rule

type Rule struct {
	RecoveryPointTags          map[string]string `json:"recoveryPointTags,omitempty"`
	Lifecycle                  *Lifecycle        `json:"lifecycle,omitempty"`
	RuleName                   string            `json:"ruleName"`
	RuleID                     string            `json:"ruleId,omitempty"`
	TargetVaultName            string            `json:"targetVaultName"`
	ScheduleExpression         string            `json:"scheduleExpression,omitempty"`
	ScheduleExpressionTimezone string            `json:"scheduleExpressionTimezone,omitempty"`
	CopyActions                []CopyAction      `json:"copyActions,omitempty"`
	StartWindowMinutes         int64             `json:"startWindowMinutes,omitempty"`
	CompletionWindowMinutes    int64             `json:"completionWindowMinutes,omitempty"`
	EnableContinuousBackup     bool              `json:"enableContinuousBackup,omitempty"`
}

Rule represents a single rule in a backup plan.

type ScanJob

type ScanJob struct {
	CreationTime   time.Time  `json:"creationTime"`
	CompletionTime *time.Time `json:"completionTime,omitempty"`
	ScanJobID      string     `json:"scanJobId"`
	BackupVaultArn string     `json:"backupVaultArn"`
	Status         string     `json:"status"`
}

ScanJob represents an AWS Backup restore testing scan job.

type Selection

type Selection struct {
	CreationTime  time.Time            `json:"creationTime"`
	Conditions    *SelectionConditions `json:"conditions,omitempty"`
	SelectionName string               `json:"selectionName"`
	SelectionID   string               `json:"selectionId"`
	BackupPlanID  string               `json:"backupPlanId"`
	IAMRoleArn    string               `json:"iamRoleArn,omitempty"`
	Resources     []string             `json:"resources,omitempty"`
	NotResources  []string             `json:"notResources,omitempty"`
	ListOfTags    []TagCondition       `json:"listOfTags,omitempty"`
}

Selection represents an AWS Backup selection (resources assigned to a plan).

type SelectionConditions

type SelectionConditions struct {
	StringEquals    []StringCondition `json:"stringEquals,omitempty"`
	StringLike      []StringCondition `json:"stringLike,omitempty"`
	StringNotEquals []StringCondition `json:"stringNotEquals,omitempty"`
	StringNotLike   []StringCondition `json:"stringNotLike,omitempty"`
}

SelectionConditions holds fine-grained string-match conditions for resource selection.

type Settings

type Settings struct {
	JanitorInterval time.Duration `json:"janitor_interval" env:"BACKUP_JANITOR_INTERVAL" default:"1m"  help:"Janitor tick interval."` //nolint:lll // Kong struct tag makes this line long
	JobTTL          time.Duration ``                                                                                                  //nolint:lll // Kong struct tag makes this line long
	/* 129-byte string literal not displayed */
}

Settings holds service-level configuration for the Backup backend. Fields are picked up by the Kong CLI parser when this struct is embedded in the root CLI command.

type StringCondition

type StringCondition struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

StringCondition holds a single key/value match condition for resource selection.

type TagCondition

type TagCondition struct {
	ConditionType  string `json:"conditionType"`
	ConditionKey   string `json:"conditionKey"`
	ConditionValue string `json:"conditionValue"`
}

TagCondition is a single tag-based resource selection filter.

type TieringConfiguration

type TieringConfiguration struct {
	BackupVaultArn  string `json:"backupVaultArn"`
	BackupVaultName string `json:"backupVaultName"`
}

TieringConfiguration holds tiering settings for a backup vault.

type Vault

type Vault struct {
	CreationTime           time.Time  `json:"creationTime"`
	Tags                   *tags.Tags `json:"tags,omitempty"`
	BackupVaultName        string     `json:"backupVaultName"`
	BackupVaultArn         string     `json:"backupVaultArn"`
	EncryptionKeyArn       string     `json:"encryptionKeyArn,omitempty"`
	CreatorRequestID       string     `json:"creatorRequestId,omitempty"`
	VaultType              string     `json:"vaultType,omitempty"`
	AccountID              string     `json:"accountId"`
	Region                 string     `json:"region"`
	NumberOfRecoveryPoints int64      `json:"numberOfRecoveryPoints"`
	MinRetentionDays       int64      `json:"minRetentionDays,omitempty"`
	MaxRetentionDays       int64      `json:"maxRetentionDays,omitempty"`
}

Vault represents an AWS Backup vault.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource / CreateBackupVault.

type VaultAccessPolicy

type VaultAccessPolicy struct {
	VaultName string `json:"-"`
	Policy    string `json:"policy"`
}

VaultAccessPolicy holds an access policy document for a backup vault.

VaultName is not part of the AWS wire shape; it exists purely so store.Table's keyFn can derive a key from the value itself (this table is never persisted, so a json:"-" key field carries no round-trip risk -- see store_setup.go).

type VaultLockConfig

type VaultLockConfig struct {
	LockDate          *time.Time `json:"lockDate,omitempty"`
	VaultName         string     `json:"-"`
	MinRetentionDays  int64      `json:"minRetentionDays,omitempty"`
	MaxRetentionDays  int64      `json:"maxRetentionDays,omitempty"`
	ChangeableForDays int64      `json:"changeableForDays,omitempty"`
}

VaultLockConfig holds the lock configuration for a backup vault.

VaultName is not part of the AWS wire shape; it exists purely so store.Table's keyFn can derive a key from the value itself (this table is never persisted, so a json:"-" key field carries no round-trip risk -- see store_setup.go).

type VaultNotificationConfig

type VaultNotificationConfig struct {
	VaultName         string   `json:"-"`
	SNSTopicArn       string   `json:"snsTopicArn"`
	BackupVaultEvents []string `json:"backupVaultEvents"`
}

VaultNotificationConfig holds notification settings for a backup vault.

VaultName is not part of the AWS wire shape; it exists purely so store.Table's keyFn can derive a key from the value itself (this table is never persisted, so a json:"-" key field carries no round-trip risk -- see store_setup.go).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL