AWS.BackupExternal reference
Appliance
Section titled “Appliance”Source:
packages/aws/src/BackupExternal/Appliance.ts
An AWS Backup appliance — backup software that runs on your own hardware, or on EC2, and protects the workloads AWS Backup cannot reach directly: VMware virtual machines, SQL Server and Oracle databases, file servers and NAS shares.
Declaring an appliance registers it with AWS Backup and returns what its
image needs to activate: image to deploy and activationToken to enter on
first boot. Until a node activates, the appliance is PENDING.
Appliance: Registering an Appliance
Section titled “Appliance: Registering an Appliance”A VMware appliance
import * as AWS from "@alchemy.run/aws";
const role = yield* AWS.IAM.Role("ApplianceRole", { assumeRolePolicyDocument: { Version: "2012-10-17", Statement: [ { Effect: "Allow", Principal: { Service: "backup-external.amazonaws.com" }, Action: ["sts:AssumeRole", "sts:TagSession"], }, ], }, managedPolicyArns: [ "arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackupAppliance", ],});
const appliance = yield* AWS.BackupExternal.Appliance("Datacenter", { environmentType: "VMWARE", applianceIamRoleArn: role.roleArn, nodeFaultTolerance: 1, networkConfiguration: { subnetGateway: "10.0.0.1", subnetMask: "255.255.255.0", dnsServers: ["10.0.0.2"], ntpServers: ["time.aws.com"], },});Read what the appliance image needs to activate
return { image: appliance.image, activationToken: appliance.activationToken, expiresAt: appliance.activationTokenExpiresAt,};Appliance: Agent Upgrades
Section titled “Appliance: Agent Upgrades”const appliance = yield* AWS.BackupExternal.Appliance("Datacenter", { environmentType: "VMWARE", applianceIamRoleArn: role.roleArn, nodeFaultTolerance: 1, networkConfiguration, agentAutoUpgrade: { startHourUtc: 22, endHourUtc: 4 },});Appliance: Pausing an Appliance
Section titled “Appliance: Pausing an Appliance”const appliance = yield* AWS.BackupExternal.Appliance("Datacenter", { environmentType: "VMWARE", applianceIamRoleArn: role.roleArn, nodeFaultTolerance: 1, networkConfiguration, operationMode: "PAUSED",});Appliance: Looking up an existing appliance
Section titled “Appliance: Looking up an existing appliance”Appliance.lookup references an appliance Alchemy doesn’t manage (created
in the console or by another stack), found by applianceArn or
applianceName. It is read during plan/deploy and never created, updated or
deleted.
const appliance = AWS.BackupExternal.Appliance.lookup({ applianceName: "datacenter" });AssociateDisk
Section titled “AssociateDisk”Source:
packages/aws/src/BackupExternal/AssociateDisk.ts
Runtime binding for the AssociateDisk operation (IAM action
backup-external:AssociateDisk).
Gives a disk attached to a node of the bound Appliance to the
appliance, as data or metadata storage. Provide the implementation with
Effect.provide(AWS.BackupExternal.AssociateDiskHttp).
AssociateDisk: Nodes
Section titled “AssociateDisk: Nodes”const associateDisk = yield* AWS.BackupExternal.AssociateDisk(appliance);
yield* associateDisk({ NodeArn: nodeArn, DiskIdentifier: disk.DiskIdentifier, DiskType: "DATA",});DeleteResourceTarget
Section titled “DeleteResourceTarget”Source:
packages/aws/src/BackupExternal/DeleteResourceTarget.ts
Runtime binding for the DeleteResourceTarget operation (IAM action
backup-external:DeleteResourceTarget).
Deletes a resource target, for example one its source no longer reports.
Resource targets are discovered at run time, so the grant covers every
resource target in the account. Provide the implementation with
Effect.provide(AWS.BackupExternal.DeleteResourceTargetHttp).
DeleteResourceTarget: Resource Targets
Section titled “DeleteResourceTarget: Resource Targets”const deleteResourceTarget = yield* AWS.BackupExternal.DeleteResourceTarget();
yield* deleteResourceTarget({ Arn: targetArn });GetActivationCredentials
Section titled “GetActivationCredentials”Source:
packages/aws/src/BackupExternal/GetActivationCredentials.ts
Runtime binding for the GetActivationCredentials operation (IAM action
backup-external:GetActivationCredentials).
Returns a fresh activation token for the bound Appliance, with the
image to deploy it from. Activation tokens expire, so automation that
boots an appliance image reads one just before it is needed. Provide the implementation with
Effect.provide(AWS.BackupExternal.GetActivationCredentialsHttp).
GetActivationCredentials: Activating an Appliance
Section titled “GetActivationCredentials: Activating an Appliance”const getActivationCredentials = yield* AWS.BackupExternal.GetActivationCredentials(appliance);
const { ActivationToken, ActivationTokenExpiresAt } = yield* getActivationCredentials();GetAgentDownload
Section titled “GetAgentDownload”Source:
packages/aws/src/BackupExternal/GetAgentDownload.ts
Runtime binding for the GetAgentDownload operation (IAM action
backup-external:GetAgentDownload).
Returns the download URL and version of the agent installer that connects
a server to the bound Appliance, for one platform. Provide the implementation with
Effect.provide(AWS.BackupExternal.GetAgentDownloadHttp).
GetAgentDownload: Agents
Section titled “GetAgentDownload: Agents”const getAgentDownload = yield* AWS.BackupExternal.GetAgentDownload(appliance);
const { AgentDownloadUrl, AgentVersion } = yield* getAgentDownload({ Platform: "LINUX_RPM",});GetAppliance
Section titled “GetAppliance”Source:
packages/aws/src/BackupExternal/GetAppliance.ts
Runtime binding for the GetAppliance operation (IAM action
backup-external:GetAppliance).
Returns the configuration and status of the bound Appliance:
management status, operation mode, health and software version. Provide the implementation with
Effect.provide(AWS.BackupExternal.GetApplianceHttp).
GetAppliance: Appliances
Section titled “GetAppliance: Appliances”const getAppliance = yield* AWS.BackupExternal.GetAppliance(appliance);
const { HealthStatus, ApplianceOperationMode } = yield* getAppliance();GetApplianceSizingRecommendation
Section titled “GetApplianceSizingRecommendation”Source:
packages/aws/src/BackupExternal/GetApplianceSizingRecommendation.ts
Runtime binding for the GetApplianceSizingRecommendation operation (IAM action
backup-external:GetApplianceSizingRecommendation).
Calculates how many appliance nodes, and how much data and metadata
storage per node, a set of workloads needs over a projection period. It
reads no appliance: it is a calculation over the workloads you describe. Provide the implementation with
Effect.provide(AWS.BackupExternal.GetApplianceSizingRecommendationHttp).
GetApplianceSizingRecommendation: Sizing an Appliance
Section titled “GetApplianceSizingRecommendation: Sizing an Appliance”const getSizing = yield* AWS.BackupExternal.GetApplianceSizingRecommendation();
const { Projections } = yield* getSizing({ NodeType: "VMWARE", ProjectionYears: 3, Workloads: [ { InitialSizeTiB: 10, ChangeRatePercent: 2, AnnualGrowthRatePercent: 10, BackupConfiguration: { VmwareVm: { BackupRules: [{ Frequency: 1, FrequencyUnit: "DAYS", DeleteAfterDays: 30 }], }, }, }, ],});GetNode
Section titled “GetNode”Source:
packages/aws/src/BackupExternal/GetNode.ts
Runtime binding for the GetNode operation (IAM action
backup-external:GetNode).
Returns one node of the bound Appliance: its IP address, status,
health and software version. Provide the implementation with
Effect.provide(AWS.BackupExternal.GetNodeHttp).
GetNode: Nodes
Section titled “GetNode: Nodes”const getNode = yield* AWS.BackupExternal.GetNode(appliance);
const node = yield* getNode({ NodeArn: nodeArn });yield* Effect.log(`${node.IpAddress}: ${node.HealthStatus}`);GetResourceProvider
Section titled “GetResourceProvider”Source:
packages/aws/src/BackupExternal/GetResourceProvider.ts
Runtime binding for the GetResourceProvider operation (IAM action
backup-external:GetResourceProvider).
Returns the configuration, metadata and status of the bound
ResourceProvider, including when it last synced and whether its
agent is up to date. Provide the implementation with
Effect.provide(AWS.BackupExternal.GetResourceProviderHttp).
GetResourceProvider: Resource Providers
Section titled “GetResourceProvider: Resource Providers”const getResourceProvider = yield* AWS.BackupExternal.GetResourceProvider(vcenter);
const { Status, LastSyncCompletedAt } = yield* getResourceProvider();GetResourceTarget
Section titled “GetResourceTarget”Source:
packages/aws/src/BackupExternal/GetResourceTarget.ts
Runtime binding for the GetResourceTarget operation (IAM action
backup-external:GetResourceTarget).
Returns the configuration, metadata and status of one resource target.
Resource targets are discovered at run time, so the grant covers every
resource target in the account. Provide the implementation with
Effect.provide(AWS.BackupExternal.GetResourceTargetHttp).
GetResourceTarget: Resource Targets
Section titled “GetResourceTarget: Resource Targets”const getResourceTarget = yield* AWS.BackupExternal.GetResourceTarget();
const target = yield* getResourceTarget({ Arn: targetArn });yield* Effect.log(`${target.ExternalName}: ${target.Status}`);ListAppliances
Section titled “ListAppliances”Source:
packages/aws/src/BackupExternal/ListAppliances.ts
Runtime binding for the ListAppliances operation (IAM action
backup-external:ListAppliances).
Lists the backup appliances registered in the account and Region, with
their management status, operation mode and health. Provide the implementation with
Effect.provide(AWS.BackupExternal.ListAppliancesHttp).
ListAppliances: Appliances
Section titled “ListAppliances: Appliances”const listAppliances = yield* AWS.BackupExternal.ListAppliances();
const { Appliances } = yield* listAppliances();const unhealthy = Appliances.filter((a) => a.HealthStatus === "CRITICAL");ListDisks
Section titled “ListDisks”Source:
packages/aws/src/BackupExternal/ListDisks.ts
Runtime binding for the ListDisks operation (IAM action
backup-external:ListDisks).
Lists the disks attached to one node of the bound Appliance, and
whether each is already associated as data or metadata storage. Provide the implementation with
Effect.provide(AWS.BackupExternal.ListDisksHttp).
ListDisks: Nodes
Section titled “ListDisks: Nodes”const listDisks = yield* AWS.BackupExternal.ListDisks(appliance);
const { Disks } = yield* listDisks({ NodeArn: nodeArn });const free = Disks.filter((disk) => disk.Status === "AVAILABLE");ListNodes
Section titled “ListNodes”Source:
packages/aws/src/BackupExternal/ListNodes.ts
Runtime binding for the ListNodes operation (IAM action
backup-external:ListNodes).
Lists the nodes of the bound Appliance with their management and
health status. Provide the implementation with
Effect.provide(AWS.BackupExternal.ListNodesHttp).
ListNodes: Nodes
Section titled “ListNodes: Nodes”const listNodes = yield* AWS.BackupExternal.ListNodes(appliance);
const { Nodes } = yield* listNodes();const pending = Nodes.filter((n) => n.NodeManagementStatus === "PENDING_VERIFICATION");ListResourceProviders
Section titled “ListResourceProviders”Source:
packages/aws/src/BackupExternal/ListResourceProviders.ts
Runtime binding for the ListResourceProviders operation (IAM action
backup-external:ListResourceProviders).
Lists the resource providers in the account and Region, optionally only
those of one appliance or one provider type. Provide the implementation with
Effect.provide(AWS.BackupExternal.ListResourceProvidersHttp).
ListResourceProviders: Resource Providers
Section titled “ListResourceProviders: Resource Providers”const listResourceProviders = yield* AWS.BackupExternal.ListResourceProviders();
const { Items } = yield* listResourceProviders({ ResourceProviderType: "VMWARE_VCENTER",});ListResourceTargets
Section titled “ListResourceTargets”Source:
packages/aws/src/BackupExternal/ListResourceTargets.ts
Runtime binding for the ListResourceTargets operation (IAM action
backup-external:ListResourceTargets).
Lists the resource targets (the virtual machines, databases and
filesystems that resource providers discovered), optionally only those of
one resource provider or one target type. Provide the implementation with
Effect.provide(AWS.BackupExternal.ListResourceTargetsHttp).
ListResourceTargets: Resource Targets
Section titled “ListResourceTargets: Resource Targets”const listResourceTargets = yield* AWS.BackupExternal.ListResourceTargets();
const { Items } = yield* listResourceTargets({ ResourceTargetType: "VMWARE_VM" });const missing = Items.filter((target) => target.Status === "NOT_FOUND");ResourceProvider
Section titled “ResourceProvider”Source:
packages/aws/src/BackupExternal/ResourceProvider.ts
An AWS Backup resource provider — one source a backup appliance protects: a VMware vCenter Server or ESXi host, a SQL Server or Oracle database server, a file server, or a NAS share.
The appliance connects to the source and discovers what it holds (virtual machines, databases, filesystems) as resource targets, each of which a backup plan can then select. A resource provider needs an appliance that has been activated.
ResourceProvider: Registering a Source
Section titled “ResourceProvider: Registering a Source”A VMware vCenter Server
import * as AWS from "@alchemy.run/aws";
const vcenter = yield* AWS.BackupExternal.ResourceProvider("Vcenter", { applianceArn: appliance.applianceArn, source: { vmwareVcenter: { endpoint: "vcenter.corp.example.com" } }, secretConfigurationArn: credentials.secretArn, targetDefaults: { vmwareVm: { backupConsistency: "APP_CONSISTENT_FALLBACK_TO_CRASH_CONSISTENT" }, },});A NAS share
const share = yield* AWS.BackupExternal.ResourceProvider("Share", { applianceArn: appliance.applianceArn, source: { nasShare: { sharePath: "10.0.0.5:/exports/home", protocol: "NFS_4_1" } }, targetDefaults: { nasFilesystem: { allowUnencryptedDataTransfer: false } },});A SQL Server with log backups
const sql = yield* AWS.BackupExternal.ResourceProvider("Sql", { applianceArn: appliance.applianceArn, source: { mssqlServer: { endpoint: "sql01.corp.example.com" } }, secretConfigurationArn: credentials.secretArn, targetDefaults: { mssqlDatabase: { fullBackupAfterDays: 7, isCopyOnlyFull: false, logBackupFrequencyInMinutes: 15, }, },});ResourceProvider: Discovered Targets
Section titled “ResourceProvider: Discovered Targets”const vcenter = yield* AWS.BackupExternal.ResourceProvider("Vcenter", { applianceArn: appliance.applianceArn, source: { vmwareVcenter: { endpoint: "vcenter.corp.example.com" } }, targetDefaults: { vmwareVm: {} }, targetTagsOnCreate: { backup: "daily" }, targetTagKeysToSync: ["owner"], autoDeleteNotFoundTargetsAfterDays: 30,});ResourceProvider: Looking up an existing resource provider
Section titled “ResourceProvider: Looking up an existing resource provider”ResourceProvider.lookup references a resource provider Alchemy doesn’t
manage (created in the console or by another stack), found by
resourceProviderArn. It is read during plan/deploy and never created,
updated or deleted.
const vcenter = AWS.BackupExternal.ResourceProvider.lookup({ resourceProviderArn });StartResourceProviderAgentUpgrade
Section titled “StartResourceProviderAgentUpgrade”Source:
packages/aws/src/BackupExternal/StartResourceProviderAgentUpgrade.ts
Runtime binding for the StartResourceProviderAgentUpgrade operation (IAM action
backup-external:StartResourceProviderAgentUpgrade).
Starts an upgrade of the agent of the bound ResourceProvider. Provide the implementation with
Effect.provide(AWS.BackupExternal.StartResourceProviderAgentUpgradeHttp).
StartResourceProviderAgentUpgrade: Agents
Section titled “StartResourceProviderAgentUpgrade: Agents”const startAgentUpgrade = yield* AWS.BackupExternal.StartResourceProviderAgentUpgrade(sqlServer);
const { UpgradeStartedAt } = yield* startAgentUpgrade();StartResourceProviderSync
Section titled “StartResourceProviderSync”Source:
packages/aws/src/BackupExternal/StartResourceProviderSync.ts
Runtime binding for the StartResourceProviderSync operation (IAM action
backup-external:StartResourceProviderSync).
Starts a sync of the bound ResourceProvider: the appliance asks the
source what it holds and updates the provider’s resource targets. Provide the implementation with
Effect.provide(AWS.BackupExternal.StartResourceProviderSyncHttp).
StartResourceProviderSync: Resource Providers
Section titled “StartResourceProviderSync: Resource Providers”const startSync = yield* AWS.BackupExternal.StartResourceProviderSync(vcenter);
const { SyncStartedAt } = yield* startSync();UpdateResourceTarget
Section titled “UpdateResourceTarget”Source:
packages/aws/src/BackupExternal/UpdateResourceTarget.ts
Runtime binding for the UpdateResourceTarget operation (IAM action
backup-external:UpdateResourceTarget).
Renames a resource target or overrides the backup configuration it
inherits from its resource provider. Resource targets are discovered at
run time, so the grant covers every resource target in the account. Provide the implementation with
Effect.provide(AWS.BackupExternal.UpdateResourceTargetHttp).
UpdateResourceTarget: Resource Targets
Section titled “UpdateResourceTarget: Resource Targets”const updateResourceTarget = yield* AWS.BackupExternal.UpdateResourceTarget();
yield* updateResourceTarget({ Arn: targetArn, TargetConfigurationSource: "TARGET", TargetConfiguration: { VmwareVm: { BackupConsistency: "CRASH_CONSISTENT" } },});VerifyNodes
Section titled “VerifyNodes”Source:
packages/aws/src/BackupExternal/VerifyNodes.ts
Runtime binding for the VerifyNodes operation (IAM action
backup-external:VerifyNodes).
Verifies nodes of the bound Appliance that are
PENDING_VERIFICATION, so they can join the appliance. Provide the implementation with
Effect.provide(AWS.BackupExternal.VerifyNodesHttp).
VerifyNodes: Nodes
Section titled “VerifyNodes: Nodes”const listNodes = yield* AWS.BackupExternal.ListNodes(appliance);const verifyNodes = yield* AWS.BackupExternal.VerifyNodes(appliance);
const { Nodes } = yield* listNodes();yield* verifyNodes({ NodeArns: Nodes.filter((n) => n.NodeManagementStatus === "PENDING_VERIFICATION").map( (n) => n.NodeArn, ),});