backup

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 28 Imported by: 0

README

Backup

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

Coverage

Metric Value
PARITY entries audited 58 (56 ok, 2 partial)
Feature families 17 (16 ok, 1 partial)
Known gaps 8
Deferred items 0
Resource leaks clean
Known gaps
  • 2026-08-29 (constraint-not-honoured sweep): ListBackupJobSummaries/ListCopyJobSummaries/ListRestoreJobSummaries/ListScanJobSummaries all ignore AccountId, AggregationPeriod, and MessageCategory (ListBackupJobSummaries/ListCopyJobSummaries only) -- real filters/grouping keys on all four ops (backup@v1.59.4 api_op_List*JobSummaries.go). AccountId/MessageCategory filtering was left unimplemented consistent with the existing precedent immediately below (ListBackupJobs' own messageCategory gap) rather than adding filtering logic this backend can't yet exercise meaningfully (MessageCategory is hardcoded to 'SUCCESS' on every job, see ListBackupJobs' gap note). AggregationPeriod (ONE_DAY/SEVEN_DAYS/FOURTEEN_DAYS historical day-bucketed counts) is the larger gap: this backend produces one point-in-time snapshot per call, not a time series, so honoring it would mean building a new historical-bucketing model across all four job types -- reported as too large for this pass rather than rushed or fabricated. What WAS fixed this pass: ListRestoreJobSummaries/ListScanJobSummaries previously didn't even group by State (always one fabricated {Count} entry for the whole job set, dropping State/AccountId/Region entirely) -- now match the State-grouping ListBackupJobSummaries/ListCopyJobSummaries already had. ListRestoreJobs/ListScanJobs pagination (MaxResults/NextToken, distinct from the Summaries ops above) was also found never read at all and fixed in the same pass -- see ops.ListRestoreJobs/ListScanJobs.
  • RE-VERIFIED 2026-09-11 (gopherstack-i8p8): DescribeBackupVault still omits MpaSessionArn and LatestMpaApprovalTeamUpdate. Both are real DescribeBackupVaultOutput members (backup@v1.64.0 api_op_DescribeBackupVault.go:123,78,126; LatestMpaApprovalTeamUpdate's own fields at types/types.go:1408-1424: ExpiryDate/InitiationDate/MpaSessionArn/Status/StatusMessage). This backend's AssociateBackupVaultMpaApprovalTeam only ever stores an MpaApprovalTeamArn string (b.mpaApprovals map[string]string) -- there is no modeled MPA-session-approval workflow (session creation, approval status, expiry) anywhere in this service to source MpaSessionArn/LatestMpaApprovalTeamUpdate from. Populating them would mean fabricating session/approval state that isn't backed by any real API call in this emulator (CreateRestoreAccessBackupVault is MPA-adjacent but doesn't create an approval-team session) -- left genuinely open rather than invented. Real fix needs a broader MPA-session model, out of scope for a single-pass field-diff.
  • STALE, RE-VERIFIED 2026-08-23 (batch9 audit), STYLE-FIXED 2026-09-11 (gopherstack-i8p8): this note claimed ListBackupPlanVersions/ExportBackupPlanTemplate 'silently swallow backend not-found errors and return an empty-but-200 response instead of propagating ResourceNotFoundException'. Reading handler_backup_plans.go's dispatchPlanTemplateCatalogOps today shows both opListBackupPlanVersions and opExportBackupPlanTemplate cases already check if err != nil -- there is no empty-200 path, confirmed both pre- and post- this pass via a real typed-client probe (unknown BackupPlanId -> ErrorCode ResourceNotFoundException on both ops). What WAS fixed this pass: both cases hardcoded errResp("ResourceNotFoundException", ...) regardless of the actual backend error, unlike every sibling op (e.g. GetBackupPlan), which goes through h.handleError keyed on the shared ErrNotFound sentinel (backup@v1.64.0 deserializers.go:12621/8182 both model ResourceNotFoundException, confirming the code is real). Backend methods ListBackupPlanVersions/ExportBackupPlanTemplate (backup_plans.go) previously wrapped a private errBackupPlanNotFoundB1 sentinel that no mapping ever read; switched both to wrap ErrNotFound and both handler cases now call h.handleError(c, err) like GetBackupPlan, so a genuine non-not-found backend error is no longer mislabeled ResourceNotFoundException. errBackupPlanNotFoundB1 removed as orphaned. Wire behavior for the not-found case is unchanged (still 400 ResourceNotFoundException); this was a correctness/consistency fix, not a wire fix. TestListBackupPlanVersions_NotFound (handler_backup_plans_test.go) and TestExportBackupPlanTemplate_UnknownPlanNotFound (handler_templates_test.go) still assert the REST-level behavior; Test_ListBackupPlanVersions_ExportBackupPlanTemplate_UnknownPlan_TypedClient (wire_error_code_backup_plan_notfound_test.go, new this pass) asserts it through the real aws-sdk-go-v2 typed client.
  • GetPITRMalwareScanResults has no malware scanning engine backing it (this emulator does not integrate with GuardDuty malware protection). ScanResultStatus is always 'UNKNOWN' and ScanId/ScanMode/LastScanJobTime are always absent -- an honest, documented limitation (see ops.GetPITRMalwareScanResults), not a hidden gap. Also: recovery points are not checked for continuous-backup/PITR eligibility (this backend has no EnableContinuousBackup-style flag on RecoveryPoint) -- a recovery point that would not actually support PITR in real AWS is still accepted here as long as it exists.
  • DescribeScanJob/ListScanJobs's required CreatedBy member (types.ScanJobCreator: BackupPlanArn/BackupPlanId/BackupPlanVersion/RuleId) is never populated -- gopherstack-r80d batch 11. This backend has no association between a scan job (or the recovery point it targets) and an originating backup plan/rule: RecoveryPoint doesn't track which plan/rule created it, and StartScanJobInput itself carries no plan/rule reference for a real client to supply one. Fabricating plan/rule IDs would violate the no-fabrication rule, so this required member stays honestly absent rather than invented -- everything else DescribeScanJob/ListScanJobs are required to return (AccountId/BackupVaultArn/BackupVaultName/CreationDate/IamRoleArn/MalwareScanner/RecoveryPointArn/ResourceArn/ResourceName/ResourceType/ScanMode/ScannerRoleArn/State) is now populated (see ops.DescribeScanJob, families.ScanJob).
  • gopherstack-i25e (2026-08-29): ListBackupPlans ignores IncludeDeleted (real ListBackupPlansInput query filter, serializers.go: includeDeleted -- key itself is not the by-prefix bug, this op was never affected by that). DeleteBackupPlan hard-removes the record from the store (no DeletionDate retained anywhere) so there is no honest way to serve IncludeDeleted=true without a soft-delete model change -- left open rather than fabricating deleted-plan records. Filed as a follow-up, not fixed this pass (out of the by-prefix bug's scope).
  • gopherstack-i25e (2026-08-29): ListRestoreJobs and ListScanJobs still ignore MaxResults/NextToken (both real query params on both ops) -- neither op paginates, both return every matching record in one response. This predates this pass (ListBackupJobs/ListCopyJobs/ListRecoveryPointsByBackupVault/ListBackupVaults already paginate via the existing paginateByID helper) and is a distinct defect from the query-filter-key bug this pass fixed; left open as a follow-up.
  • gopherstack-i25e (2026-08-29): CopyJob.SourceRecoveryPointArn (added this pass to fix the ListCopyJobs BySourceRecoveryPointArn filter -- REQUEST direction) is not yet surfaced in copyJobToJSON's RESPONSE body, even though it's a real member of types.CopyJob. Left as a response-direction follow-up; this pass's scope was verified REQUEST-direction only per the parity_principles wire-shape rule (a bare 'wire: ok' having previously been found to mean response-only).

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"`
	SourceRecoveryPointArn      string     `json:"sourceRecoveryPointArn,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, creatorRequestID string,
	kv 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,
	recoveryPointSelection *RestoreTestingRecoveryPointSelection,
) (*RestoreTestingPlan, error)

CreateRestoreTestingPlan creates a restore testing plan. RecoveryPointSelection is required on the real RestoreTestingPlanForCreate (validators.go:2400-2419 rejects a nil value) and on RestoreTestingPlanForGet, so it must always come out non-nil -- if the caller passed nil (only reachable via a raw request bypassing the SDK's own client-side validation), a genuinely-empty selection is stored instead of leaving the required member absent.

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. PutBackupVaultLockConfiguration's own doc comment: "On and after the lock date, the Vault Lock becomes immutable and cannot be changed or deleted" -- PutBackupVaultLockConfiguration already enforces this for updates; this was its unenforced sibling for deletes.

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. Real AWS (api_op_DeleteRestoreTestingPlan.go) says deletion can only succeed if all associated restore testing selections are deleted first.

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,
	maxResults int,
	nextToken string,
) ([]*Selection, string, error)

ListBackupSelections returns backup selections for a plan, paginated by MaxResults/NextToken (real query params, ListBackupSelections serializers.go:5539-5545 -- lowercase "maxResults"/"nextToken" on the wire; BackupPlanId is a required URI label, not a query param).

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(maxResults int, nextToken string) ([]*Framework, string)

ListFrameworks returns all frameworks. ListFrameworks returns frameworks, paginated by MaxResults/NextToken (real query params, ListFrameworks serializers.go:5895-5901 -- capitalized "MaxResults"/"NextToken" on the wire, unlike ListProtectedResources' lowercase pair).

func (*InMemoryBackend) ListIndexedRecoveryPoints

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

ListIndexedRecoveryPoints returns recovery points with an active index.

func (*InMemoryBackend) ListLegalHolds

func (b *InMemoryBackend) ListLegalHolds(maxResults int, nextToken string) ([]*LegalHold, string)

ListLegalHolds returns legal holds, paginated by MaxResults/NextToken (real query params, ListLegalHolds serializers.go:6055-6061 -- lowercase "maxResults"/"nextToken" on the wire).

func (*InMemoryBackend) ListProtectedResources

func (b *InMemoryBackend) ListProtectedResources(maxResults int, nextToken string) ([]*ProtectedResource, string)

ListProtectedResources returns protected resources, paginated by MaxResults/NextToken (real query params, backup@v1.59.4 serializers.go).

func (*InMemoryBackend) ListProtectedResourcesByBackupVault

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

ListProtectedResourcesByBackupVault returns protected resources for a vault, paginated by MaxResults/NextToken (same wire shape as ListProtectedResources).

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(maxResults int, nextToken string) ([]*ReportPlan, string)

ListReportPlans returns report plans, paginated by MaxResults/NextToken (real query params, ListReportPlans serializers.go:6633-6639 -- capitalized "MaxResults"/"NextToken" on the wire).

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) ListRestoreJobSummaries

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

ListRestoreJobSummaries returns restore job counts grouped by State, real RestoreJobSummary's own required grouping key (backup@v1.59.4 api_op_ListRestoreJobSummaries.go, RestoreJobSummary: AccountId, Count, Region, ResourceType, State, StartTime, EndTime). AggregationPeriod (per-day/per-week time-bucketed counts) and ResourceType-level grouping are not modeled: this backend produces one point-in-time snapshot per call, not a historical time series, and every other summary op in this package (ListBackupJobSummaries/ListCopyJobSummaries) groups by State only, not by the full (Region,AccountId,State,ResourceType) key real AWS documents -- kept consistent with that existing precedent rather than introducing a different fidelity level for this one sibling 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) ListRestoreJobsFiltered

func (b *InMemoryBackend) ListRestoreJobsFiltered(f ListRestoreJobsFilter) ([]*RestoreJob, string)

ListRestoreJobsFiltered returns restore jobs matching the filter, paginated per f.MaxResults/f.NextToken. Returns (jobs, nextToken).

func (*InMemoryBackend) ListRestoreTestingPlans

func (b *InMemoryBackend) ListRestoreTestingPlans(maxResults int, nextToken string) ([]*RestoreTestingPlan, string)

ListRestoreTestingPlans returns restore testing plans, paginated by MaxResults/NextToken (real query params, ListRestoreTestingPlans serializers.go:7065-7071 -- capitalized "MaxResults"/"NextToken" on the wire).

func (*InMemoryBackend) ListRestoreTestingSelections

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

ListRestoreTestingSelections returns all selections for a restore testing plan. ListRestoreTestingSelections returns selections for a restore testing plan, paginated by MaxResults/NextToken (real query params, ListRestoreTestingSelections serializers.go:7135-7141 -- capitalized "MaxResults"/"NextToken" on the wire; RestoreTestingPlanName is a required URI label, not a query param).

func (*InMemoryBackend) ListScanJobSummaries

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

ListScanJobSummaries returns scan job counts grouped by State, real ScanJobSummary's own required grouping key (backup@v1.59.4 api_op_ListScanJobSummaries.go, ScanJobSummary: AccountId, Count, Region, ResourceType, ScanResultStatus, State, StartTime, EndTime). AggregationPeriod (per-day/per-week time-bucketed counts), ResourceType-level grouping, and MalwareScanner/ScanResultStatus (this backend's ScanJob never tracks a scan result outcome, see the ScanJob type doc) are not modeled -- kept consistent with the same State-only grouping precedent ListBackupJobSummaries/ListCopyJobSummaries already use for their own sibling ops.

func (*InMemoryBackend) ListScanJobs

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

ListScanJobs returns all scan jobs.

func (*InMemoryBackend) ListScanJobsFiltered

func (b *InMemoryBackend) ListScanJobsFiltered(f ListScanJobsFilter) ([]*ScanJob, string)

ListScanJobsFiltered returns scan jobs matching the filter.

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. Used only by tests to seed state directly -- production traffic populates this via CompleteBackupJob's inline update.

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) SetS3Backend

func (b *InMemoryBackend) SetS3Backend(s3 S3Backend)

SetS3Backend wires S3 so StartBackupJob validates an S3-typed ResourceArn names a bucket that actually exists, instead of accepting any non-empty ResourceArn regardless of whether it resolves to a real resource (gopherstack-0o0q).

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. ResourceArn/ResourceType are derived from the recovery point input.RecoveryPointArn identifies, when this backend is tracking one -- left absent (not fabricated) when it isn't.

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, restore access backup vaults.

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,
	recoveryPointSelection *RestoreTestingRecoveryPointSelection,
) (*RestoreTestingPlan, error)

UpdateRestoreTestingPlan updates a restore testing plan. RecoveryPointSelection is optional on the real RestoreTestingPlanForUpdate (types.go:2431-2456, no "required" marker), so an omitted (nil) value leaves the plan's existing selection unchanged rather than clearing it.

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
	SourceRecoveryPointArn    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 ListRestoreJobsFilter

type ListRestoreJobsFilter struct {
	CreatedAfter   *time.Time
	CreatedBefore  *time.Time
	CompleteAfter  *time.Time
	CompleteBefore *time.Time
	AccountID      string
	ResourceType   string
	Status         string
	NextToken      string
	MaxResults     int
}

ListRestoreJobsFilter contains optional filter parameters for listing restore jobs, mirroring ListRestoreJobsInput (api_op_ListRestoreJobs.go, backup@v1.59.4). ByParentJobId and ByRestoreTestingPlanArn are not included: this backend's RestoreJob has no field to hold either value (StartRestoreJob never receives or fabricates one).

func RestoreJobsFilterFromQuery

func RestoreJobsFilterFromQuery(q url.Values) ListRestoreJobsFilter

RestoreJobsFilterFromQuery builds a ListRestoreJobsFilter from ListRestoreJobs query parameters (api_op_ListRestoreJobs.go, serializers.go, backup@v1.59.4): accountId, resourceType, status, createdAfter, createdBefore, completeAfter, completeBefore, maxResults, nextToken.

type ListScanJobsFilter

type ListScanJobsFilter struct {
	CompleteAfter    *time.Time
	CompleteBefore   *time.Time
	AccountID        string
	BackupVaultName  string
	MalwareScanner   string
	RecoveryPointArn string
	ResourceArn      string
	ResourceType     string
	State            string
	NextToken        string
	MaxResults       int
}

ListScanJobsFilter contains optional filter parameters for listing scan jobs, mirroring ListScanJobsInput (api_op_ListScanJobs.go, backup@v1.59.4). ByScanResultStatus is not included: this backend's ScanJob has no field to hold a scan result status (StartScanJob never receives or fabricates one).

func ScanJobsFilterFromQuery

func ScanJobsFilterFromQuery(q url.Values) ListScanJobsFilter

ScanJobsFilterFromQuery builds a ListScanJobsFilter from ListScanJobs query parameters. ListScanJobs is the one op in this service that does NOT strip the "By" prefix on the wire (serializers.go ListScanJobs query bindings, backup@v1.59.4): ByAccountId, ByBackupVaultName, ByMalwareScanner, ByRecoveryPointArn, ByResourceArn, ByResourceType, ByState, ByCompleteAfter, ByCompleteBefore all keep the full PascalCase Go field name.

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"`
	Tags                         *tags.Tags `json:"tags,omitempty"`
	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"`
	// CreatorRequestID is not on the AWS wire shape (no Describe/List op for a
	// restore access vault ever returns it); it exists purely to make repeated
	// CreateRestoreAccessBackupVault calls with the same token idempotent,
	// mirroring CreateBackupVault's CreatorRequestID convention.
	CreatorRequestID string `json:"creatorRequestId,omitempty"`
	VaultState       string `json:"vaultState"`
}

RestoreAccessVault represents an AWS Backup restore access backup vault.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource / CreateRestoreAccessBackupVault. It may be nil for a vault restored from a snapshot taken before this field existed (an additive change, not a version bump) -- callers must nil-check rather than assume it is always set.

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"`
	// UpdateTime is required on UpdateRestoreTestingPlanOutput
	// (api_op_UpdateRestoreTestingPlan.go) but nil until the plan's first
	// update -- real AWS only sets it once an update has occurred.
	UpdateTime             *time.Time                            `json:"updateTime,omitempty"`
	RecoveryPointSelection *RestoreTestingRecoveryPointSelection `json:"recoveryPointSelection"`
	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.

RecoveryPointSelection is required on RestoreTestingPlanForGet (types.go:2307-2371) -- gopherstack had no field for it at all until this pass, so GetRestoreTestingPlan dropped a required response member entirely for every plan (gopherstack-r80d batch 11). It is not required on RestoreTestingPlanForList (types.go:2376-2419, no such member exists there at all), so ListRestoreTestingPlans correctly omits it.

type RestoreTestingRecoveryPointSelection added in v1.5.0

type RestoreTestingRecoveryPointSelection struct {
	Algorithm           string   `json:"algorithm,omitempty"`
	ExcludeVaults       []string `json:"excludeVaults,omitempty"`
	IncludeVaults       []string `json:"includeVaults,omitempty"`
	RecoveryPointTypes  []string `json:"recoveryPointTypes,omitempty"`
	SelectionWindowDays int32    `json:"selectionWindowDays,omitempty"`
}

RestoreTestingRecoveryPointSelection selects which recovery points a restore testing plan draws from (aws-sdk-go-v2/service/backup/types.RestoreTestingRecoveryPointSelection). None of its own members are Smithy-required -- only the pointer itself is required on RestoreTestingPlanForGet/-ForCreate -- so a real client can send an empty object.

type RestoreTestingSelection

type RestoreTestingSelection struct {
	CreationTime time.Time `json:"creationTime"`
	// UpdateTime is required on UpdateRestoreTestingSelectionOutput
	// (api_op_UpdateRestoreTestingSelection.go) but nil until the
	// selection's first update.
	UpdateTime                  *time.Time                   `json:"updateTime,omitempty"`
	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 S3Backend

type S3Backend interface {
	HeadBucket(ctx context.Context, input *sdk_s3.HeadBucketInput) (*sdk_s3.HeadBucketOutput, error)
}

S3Backend is the subset of S3 operations Backup needs to check whether a StartBackupJob ResourceArn naming an S3 bucket resolves to a bucket that actually exists, wired via SetS3Backend. When unset, ResourceArn is validated for non-emptiness only, matching this repo's unwired-hook-stays-permissive convention.

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"`
	BackupVaultName          string     `json:"backupVaultName"`
	Status                   string     `json:"status"`
	IamRoleArn               string     `json:"iamRoleArn"`
	MalwareScanner           string     `json:"malwareScanner"`
	RecoveryPointArn         string     `json:"recoveryPointArn"`
	ResourceArn              string     `json:"resourceArn,omitempty"`
	ResourceName             string     `json:"resourceName,omitempty"`
	ResourceType             string     `json:"resourceType,omitempty"`
	ScanMode                 string     `json:"scanMode"`
	ScannerRoleArn           string     `json:"scannerRoleArn"`
	AccountID                string     `json:"accountId"`
	IdempotencyToken         string     `json:"idempotencyToken,omitempty"`
	ScanBaseRecoveryPointArn string     `json:"scanBaseRecoveryPointArn,omitempty"`
}

ScanJob represents an AWS Backup restore testing scan job. ScanJob represents an AWS Backup malware scan job.

AccountID/BackupVaultName/ResourceArn/ResourceType/ResourceName are required on the real DescribeScanJobOutput and types.ScanJob (types.go:2779-2871, backup@v1.59.4) but had no field at all here until gopherstack-r80d batch 11 -- DescribeScanJob/ListScanJobs's handlers returned only ScanJobId/Status, silently dropping 12+ required members. CreatedBy (types.ScanJobCreator: BackupPlanArn/Id/Version + RuleId) is also required but is NOT modeled: this backend has no association between a scan job (or the recovery point it targets) and an originating backup plan/rule, and StartScanJobInput itself carries no such reference either -- fabricating one would violate the no-fabrication rule, so it stays a disclosed gap (see PARITY.md).

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