backup

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 26 Imported by: 0

README

Backup

Parity grade: A · SDK aws-sdk-go-v2/service/backup@v1.59.4 · last audited 2026-08-13 (621eeacb)

Coverage

Metric Value
Operations audited 50 (48 ok, 2 partial)
Feature families 15 (15 ok)
Known gaps none
Deferred items 0
Resource leaks clean

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("InvalidParameterValueException", awserr.ErrInvalidParameter)
	// ErrInvalidRequest is for state-conflict validation failures (e.g.
	// deleting a non-empty or locked vault) that real AWS Backup reports as
	// InvalidRequestException rather than InvalidParameterValueException.
	ErrInvalidRequest = awserr.New("InvalidRequestException", awserr.ErrConflict)
)

Wire error codes match the real AWS Backup service-2.json model exactly (verified against botocore's backup/2018-11-15 model): every one of Backup's client-fault exceptions (ResourceNotFoundException, AlreadyExistsException, InvalidParameterValueException, MissingParameterValueException, InvalidRequestException, ...) has no explicit httpStatusCode override in the model, so the restJson1 protocol default of HTTP 400 applies uniformly -- Backup does NOT use 404 for not-found or 409 for conflict the way many other REST-JSON services do. "ValidationException" is NOT a real AWS Backup error code (gopherstack invention, since deleted); the real generic client-fault codes are InvalidParameterValueException / MissingParameterValueException, chosen in handleError based on whether the message names a missing field.

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 ControlInputParameter added in v1.2.0

type ControlInputParameter struct {
	ParameterName  string `json:"parameterName"`
	ParameterValue string `json:"parameterValue"`
}

ControlInputParameter is a single name/value pair configuring a framework control (e.g. ParameterName "requiredRetentionDays", ParameterValue "35").

type ControlScope added in v1.2.0

type ControlScope struct {
	Tags                    map[string]string `json:"tags,omitempty"`
	ComplianceResourceIDs   []string          `json:"complianceResourceIds,omitempty"`
	ComplianceResourceTypes []string          `json:"complianceResourceTypes,omitempty"`
}

ControlScope defines what a framework control evaluates: specific resource IDs, resource types, and/or a single tag key/value pair.

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"`
	DestinationRecoveryPointArn string     `json:"destinationRecoveryPointArn,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 DateRange added in v1.2.0

type DateRange struct {
	FromDate *time.Time `json:"fromDate,omitempty"`
	ToDate   *time.Time `json:"toDate,omitempty"`
}

DateRange is an inclusive Unix-time window ([FromDate, ToDate]) used to filter recovery points by CreationDate.

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 {
	ControlScope           *ControlScope           `json:"controlScope,omitempty"`
	ControlName            string                  `json:"controlName"`
	ControlInputParameters []ControlInputParameter `json:"controlInputParameters,omitempty"`
}

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), every one registered on registry so Snapshot/Restore covers it -- see store_setup.go. 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,
	sel *RecoveryPointSelection,
) (*LegalHold, error)

CreateLegalHold creates a legal hold. sel (RecoveryPointSelection) is stored on the hold and is what ListRecoveryPointsByLegalHold filters against; a nil or all-empty selection covers every recovery point.

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. sourceVaultArn must resolve to an existing backup vault (real AWS: the SOURCE of a restore access vault is always a logically air-gapped vault) -- ListRestoreAccessBackupVaults and RevokeRestoreAccessBackupVault both key off that source vault's NAME (see their real nested /logically-air-gapped-backup-vaults/{BackupVaultName}/... paths), so the name is resolved and stored here rather than re-derived from the ARN later.

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 string,
	in RestoreTestingSelectionInput,
) (*RestoreTestingSelection, error)

CreateRestoreTestingSelection creates a selection within a restore testing plan. IAMRoleArn and ProtectedResourceType are required by the real RestoreTestingSelectionForCreate shape.

func (*InMemoryBackend) CreateTieringConfiguration

func (b *InMemoryBackend) CreateTieringConfiguration(
	name, vaultName string,
	sel []ResourceSelection,
	creatorRequestID string,
) (*TieringConfiguration, error)

CreateTieringConfiguration creates a tiering configuration. name is the unique TieringConfigurationName (the real AWS key for this resource family); vaultName is "*" to apply to all vaults or a specific vault name. Idempotent: a repeat call with the same creatorRequestID returns the existing configuration instead of AlreadyExistsException.

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(name string) error

DeleteTieringConfiguration removes a tiering configuration by name.

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(name string) (*TieringConfiguration, error)

GetTieringConfiguration returns the tiering configuration for the given name.

func (*InMemoryBackend) GetVaultMpaApprovalTeamArn added in v1.2.0

func (b *InMemoryBackend) GetVaultMpaApprovalTeamArn(vaultName string) (string, bool)

GetVaultMpaApprovalTeamArn returns the MPA approval team ARN associated with vaultName (via AssociateBackupVaultMpaApprovalTeam), and false if none is associated. Surfaced by DescribeBackupVault's MpaApprovalTeamArn field.

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 the recovery points covered by a legal hold's RecoveryPointSelection (by vault name, resource ARN, and/or creation-date range -- see recoveryPointMatchesSelection). A legal hold with no selection (or an all-empty one) covers every recovery point, matching AWS's "no additional constraint" semantics. An unknown legalHoldID is not an error (ListRecoveryPointsByLegalHold's real error list has no ResourceNotFoundException) -- it simply matches nothing.

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(vaultName string) ([]*RestoreAccessVault, error)

ListRestoreAccessBackupVaults returns the restore access vaults created from the given source vault name. Real AWS addresses this op as GET /logically-air-gapped-backup-vaults/{BackupVaultName}/restore-access-backup-vaults, i.e. always scoped to one source vault -- there is no "list all" op.

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 sorted by name.

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, validationStatusMessage string,
) error

PutRestoreValidationResult records the validation outcome of a restore test on the restore job itself, so DescribeRestoreJob reflects it -- this was previously a disguised no-op: the result went into a side map (restoreValidations) that DescribeRestoreJob never read.

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, restoreAccessVaultArn string) error

RevokeRestoreAccessBackupVault removes a restore access vault, scoped to the given source vault name (real AWS: DELETE /logically-air-gapped-backup-vaults/{BackupVaultName}/restore-access-backup-vaults/{RestoreAccessBackupVaultArn} -- a restore access vault not sourced from vaultName is reported not-found, matching AWS's per-source-vault addressing).

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, sourceVaultName, destVaultArn, iamRoleArn string,
) (*CopyJob, error)

StartCopyJob creates a copy job that copies a recovery point from a source vault to a destination vault, and materializes the resulting recovery point in the destination vault (previously a disguised no-op: the job record was created but nothing was ever actually copied, so DescribeRecoveryPoint against the destination vault could never see it).

sourceVaultName is a NAME (StartCopyJobInput.SourceBackupVaultName on the real wire); destVaultArn is an ARN (StartCopyJobInput.DestinationBackupVaultArn) -- this asymmetry matches AWS exactly, it is not a typo.

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, error)

StartRestoreJob creates a new restore job. Real AWS provisions an actual new resource of ResourceType once the restore completes; this emulator synthesizes a plausible CreatedResourceArn instead so callers exercising "restore -> use the restored resource" flows have something ARN-shaped to chain off of.

func (*InMemoryBackend) StartScanJob

func (b *InMemoryBackend) StartScanJob(backupVaultArn string, input StartScanJobInput) *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) TaggedResources added in v1.2.0

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every Backup resource ARN that currently has at least one tag, across every taggable Backup resource kind (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,
	controls *[]FrameworkControl,
) (*Framework, error)

UpdateFramework updates a framework's description and, when controls is non-nil, replaces its FrameworkControls (a nil controls means "leave existing controls unchanged", matching AWS's optional UpdateFrameworkInput .FrameworkControls -- an explicit empty slice clears them).

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,
	deliveryChannel *ReportDeliveryChannel,
	setting *ReportSetting,
) (*ReportPlan, error)

UpdateReportPlan updates a report plan's description and, when non-nil, its ReportDeliveryChannel/ReportSetting (both optional on the real UpdateReportPlanInput -- an omitted field leaves the existing value unchanged, matching UpdateFramework's FrameworkControls semantics).

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 string,
	in RestoreTestingSelectionInput,
) (*RestoreTestingSelection, error)

UpdateRestoreTestingSelection updates a restore testing selection. RestoreTestingSelectionForUpdate has no required fields beyond identity, so every field here is set from in verbatim (a full-replace PUT, matching how PutBackupVaultAccessPolicy/PutBackupVaultLockConfiguration etc. treat their bodies elsewhere in this service) -- ProtectedResourceType itself is immutable on Update per the real API, so it is intentionally not touched here.

func (*InMemoryBackend) UpdateTieringConfiguration

func (b *InMemoryBackend) UpdateTieringConfiguration(
	name, vaultName string,
	sel []ResourceSelection,
) (*TieringConfiguration, error)

UpdateTieringConfiguration replaces the BackupVaultName/ResourceSelection body of an existing tiering configuration. TieringConfigurationName cannot be changed (it is the resource's identity), matching AWS.

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 KeyValue added in v1.2.0

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

KeyValue is a single tag key/value pair used by ProtectedResourceConditions.

type LegalHold

type LegalHold struct {
	CreationDate           time.Time               `json:"creationDate"`
	RecoveryPointSelection *RecoveryPointSelection `json:"recoveryPointSelection,omitempty"`
	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 ProtectedResourceConditions added in v1.2.0

type ProtectedResourceConditions struct {
	StringEquals    []KeyValue `json:"stringEquals,omitempty"`
	StringNotEquals []KeyValue `json:"stringNotEquals,omitempty"`
}

ProtectedResourceConditions filters a restore testing selection's wildcard ProtectedResourceArns (["*"]) down to resources matching (or not matching) specific tag key/value pairs.

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 RecoveryPointSelection added in v1.2.0

type RecoveryPointSelection struct {
	DateRange           *DateRange `json:"dateRange,omitempty"`
	ResourceIdentifiers []string   `json:"resourceIdentifiers,omitempty"`
	VaultNames          []string   `json:"vaultNames,omitempty"`
}

RecoveryPointSelection specifies which recovery points a legal hold applies to: by containing vault, by resource ARN, and/or by creation-date window. A CreateLegalHold call with no selection (or an empty one) covers every recovery point -- there is no additional constraint to apply.

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"`
	S3KeyPrefix  string   `json:"s3KeyPrefix,omitempty"`
	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"`
	Accounts           []string `json:"accounts,omitempty"`
	OrganizationUnits  []string `json:"organizationUnits,omitempty"`
	Regions            []string `json:"regions,omitempty"`
	NumberOfFrameworks int32    `json:"numberOfFrameworks,omitempty"`
}

ReportSetting specifies the template, frameworks, and account/OU/Region scope driving a report plan.

type ResourceSelection added in v1.2.0

type ResourceSelection struct {
	ResourceType              string   `json:"resourceType"`
	Resources                 []string `json:"resources"`
	TieringDownSettingsInDays int64    `json:"tieringDownSettingsInDays"`
}

ResourceSelection specifies which resources within a vault a tiering configuration applies to, and the age threshold (in days) after which matching objects transition to the low-cost warm storage tier.

type RestoreAccessVault

type RestoreAccessVault struct {
	CreationDate                 time.Time `json:"creationDate"`
	RestoreAccessBackupVaultName string    `json:"restoreAccessBackupVaultName"`
	RestoreAccessBackupVaultArn  string    `json:"restoreAccessBackupVaultArn"`
	SourceBackupVaultArn         string    `json:"sourceBackupVaultArn"`
	// SourceBackupVaultName is not on the AWS wire shape; it is resolved from
	// SourceBackupVaultArn at creation time so ListRestoreAccessBackupVaults /
	// RevokeRestoreAccessBackupVault -- which AWS addresses by source vault
	// NAME, not ARN (see their real nested paths under
	// /logically-air-gapped-backup-vaults/{BackupVaultName}/...) -- can filter
	// without re-parsing the ARN on every call.
	SourceBackupVaultName string `json:"sourceBackupVaultName"`
	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"`
	BackupVaultArn   string            `json:"backupVaultArn,omitempty"`
	AccountID        string            `json:"accountId,omitempty"`
	// CreatedResourceArn is the ARN of the resource StartRestoreJob created
	// once the restore completes -- real AWS would provision an actual new
	// resource of ResourceType; this emulator synthesizes a plausible ARN
	// instead (see restore_jobs.go's StartRestoreJob).
	CreatedResourceArn      string `json:"createdResourceArn,omitempty"`
	Status                  string `json:"status"`
	StatusMessage           string `json:"statusMessage,omitempty"`
	PercentDone             string `json:"percentDone,omitempty"`
	ValidationStatus        string `json:"validationStatus,omitempty"`
	ValidationStatusMessage string `json:"validationStatusMessage,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"`
	ProtectedResourceConditions *ProtectedResourceConditions `json:"protectedResourceConditions,omitempty"`
	RestoreMetadataOverrides    map[string]string            `json:"restoreMetadataOverrides,omitempty"`
	RestoreTestingPlanName      string                       `json:"restoreTestingPlanName"`
	RestoreTestingSelectionName string                       `json:"restoreTestingSelectionName"`
	RestoreTestingPlanArn       string                       `json:"restoreTestingPlanArn"`
	ProtectedResourceType       string                       `json:"protectedResourceType,omitempty"`
	// IAMRoleArn is required by real AWS (StartRestoreJob's IamRoleArn for
	// scheduled restore tests uses this role) but was entirely absent from
	// this backend's model until this pass.
	IAMRoleArn            string   `json:"iamRoleArn,omitempty"`
	ProtectedResourceArns []string `json:"protectedResourceArns,omitempty"`
	ValidationWindowHours int64    `json:"validationWindowHours,omitempty"`
}

RestoreTestingSelection represents a selection within a restore testing plan.

type RestoreTestingSelectionInput added in v1.2.0

type RestoreTestingSelectionInput struct {
	ProtectedResourceConditions *ProtectedResourceConditions
	RestoreMetadataOverrides    map[string]string
	ProtectedResourceType       string
	IAMRoleArn                  string
	ProtectedResourceArns       []string
	ValidationWindowHours       int64
}

RestoreTestingSelectionInput holds the fields accepted by CreateRestoreTestingSelection/UpdateRestoreTestingSelection beyond the plan/selection name -- mirrors AWS's RestoreTestingSelectionForCreate / RestoreTestingSelectionForUpdate closely enough that both ops can share one Go-side type.

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"`
	ContinuousScanEndTime    *time.Time `json:"continuousScanEndTime,omitempty"`
	ScanJobID                string     `json:"scanJobId"`
	BackupVaultArn           string     `json:"backupVaultArn"`
	Status                   string     `json:"status"`
	IamRoleArn               string     `json:"iamRoleArn"`
	MalwareScanner           string     `json:"malwareScanner"`
	RecoveryPointArn         string     `json:"recoveryPointArn"`
	ScanMode                 string     `json:"scanMode"`
	ScannerRoleArn           string     `json:"scannerRoleArn"`
	IdempotencyToken         string     `json:"idempotencyToken,omitempty"`
	ScanBaseRecoveryPointArn string     `json:"scanBaseRecoveryPointArn,omitempty"`
}

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 StartScanJobInput added in v1.3.1

type StartScanJobInput struct {
	ContinuousScanEndTime    *time.Time
	BackupVaultName          string
	IamRoleArn               string
	MalwareScanner           string
	RecoveryPointArn         string
	ScanMode                 string
	ScannerRoleArn           string
	IdempotencyToken         string
	ScanBaseRecoveryPointArn string
}

StartScanJobInput mirrors StartScanJobInput in the pinned SDK (api_op_StartScanJob.go:29-75): BackupVaultName, IamRoleArn, MalwareScanner, RecoveryPointArn, ScanMode and ScannerRoleArn are all required; the rest are optional.

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 TaggedEntry added in v1.2.0

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tag map, for cross-service tag enumeration by the Resource Groups Tagging API (see cli.go's wireTaggingBackup).

type TieringConfiguration

type TieringConfiguration struct {
	CreationTime             time.Time           `json:"creationTime"`
	LastUpdatedTime          *time.Time          `json:"lastUpdatedTime,omitempty"`
	TieringConfigurationName string              `json:"tieringConfigurationName"`
	TieringConfigurationArn  string              `json:"tieringConfigurationArn"`
	BackupVaultName          string              `json:"backupVaultName"`
	CreatorRequestID         string              `json:"creatorRequestId,omitempty"`
	ResourceSelection        []ResourceSelection `json:"resourceSelection"`
}

TieringConfiguration holds a tiering configuration.

Keyed by TieringConfigurationName (matching AWS -- CreateTieringConfigurationInput's TieringConfigurationInputForCreate nests BackupVaultName + ResourceSelection under a top-level TieringConfigurationName, and Get/List/Delete/Update all address configurations by that name, never by vault name).

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:"vaultName"`
	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, and carries a real json tag (not "-") since this table is persisted -- see store_setup.go.

type VaultLockConfig

type VaultLockConfig struct {
	LockDate          *time.Time `json:"lockDate,omitempty"`
	VaultName         string     `json:"vaultName"`
	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, and carries a real json tag (not "-") since this table is persisted -- see store_setup.go.

type VaultNotificationConfig

type VaultNotificationConfig struct {
	VaultName         string   `json:"vaultName"`
	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, and carries a real json tag (not "-") since this table is persisted -- see store_setup.go.

Jump to

Keyboard shortcuts

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