Skip to content

Commit 501931e

Browse files
author
awstools
committed
feat(client-backup): AWS Backup introduces support for legal hold and application stack backups. AWS Backup Audit Manager introduces support for cross-Region, cross-account reports.
1 parent d3daca7 commit 501931e

20 files changed

+4180
-675
lines changed

clients/client-backup/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ using your favorite package manager:
3131

3232
The AWS SDK is modulized by clients and commands.
3333
To send a request, you only need to import the `BackupClient` and
34-
the commands you need, for example `CreateBackupPlanCommand`:
34+
the commands you need, for example `CancelLegalHoldCommand`:
3535

3636
```js
3737
// ES5 example
38-
const { BackupClient, CreateBackupPlanCommand } = require("@aws-sdk/client-backup");
38+
const { BackupClient, CancelLegalHoldCommand } = require("@aws-sdk/client-backup");
3939
```
4040

4141
```ts
4242
// ES6+ example
43-
import { BackupClient, CreateBackupPlanCommand } from "@aws-sdk/client-backup";
43+
import { BackupClient, CancelLegalHoldCommand } from "@aws-sdk/client-backup";
4444
```
4545

4646
### Usage
@@ -59,7 +59,7 @@ const client = new BackupClient({ region: "REGION" });
5959
const params = {
6060
/** input parameters */
6161
};
62-
const command = new CreateBackupPlanCommand(params);
62+
const command = new CancelLegalHoldCommand(params);
6363
```
6464

6565
#### Async/await
@@ -138,15 +138,15 @@ const client = new AWS.Backup({ region: "REGION" });
138138

139139
// async/await.
140140
try {
141-
const data = await client.createBackupPlan(params);
141+
const data = await client.cancelLegalHold(params);
142142
// process data.
143143
} catch (error) {
144144
// error handling.
145145
}
146146

147147
// Promises.
148148
client
149-
.createBackupPlan(params)
149+
.cancelLegalHold(params)
150150
.then((data) => {
151151
// process data.
152152
})
@@ -155,7 +155,7 @@ client
155155
});
156156

157157
// callbacks.
158-
client.createBackupPlan(params, (err, data) => {
158+
client.cancelLegalHold(params, (err, data) => {
159159
// process err and data.
160160
});
161161
```

clients/client-backup/src/Backup.ts

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
33

44
import { BackupClient } from "./BackupClient";
5+
import {
6+
CancelLegalHoldCommand,
7+
CancelLegalHoldCommandInput,
8+
CancelLegalHoldCommandOutput,
9+
} from "./commands/CancelLegalHoldCommand";
510
import {
611
CreateBackupPlanCommand,
712
CreateBackupPlanCommandInput,
@@ -22,6 +27,11 @@ import {
2227
CreateFrameworkCommandInput,
2328
CreateFrameworkCommandOutput,
2429
} from "./commands/CreateFrameworkCommand";
30+
import {
31+
CreateLegalHoldCommand,
32+
CreateLegalHoldCommandInput,
33+
CreateLegalHoldCommandOutput,
34+
} from "./commands/CreateLegalHoldCommand";
2535
import {
2636
CreateReportPlanCommand,
2737
CreateReportPlanCommandInput,
@@ -132,6 +142,11 @@ import {
132142
DisassociateRecoveryPointCommandInput,
133143
DisassociateRecoveryPointCommandOutput,
134144
} from "./commands/DisassociateRecoveryPointCommand";
145+
import {
146+
DisassociateRecoveryPointFromParentCommand,
147+
DisassociateRecoveryPointFromParentCommandInput,
148+
DisassociateRecoveryPointFromParentCommandOutput,
149+
} from "./commands/DisassociateRecoveryPointFromParentCommand";
135150
import {
136151
ExportBackupPlanTemplateCommand,
137152
ExportBackupPlanTemplateCommandInput,
@@ -167,6 +182,11 @@ import {
167182
GetBackupVaultNotificationsCommandInput,
168183
GetBackupVaultNotificationsCommandOutput,
169184
} from "./commands/GetBackupVaultNotificationsCommand";
185+
import {
186+
GetLegalHoldCommand,
187+
GetLegalHoldCommandInput,
188+
GetLegalHoldCommandOutput,
189+
} from "./commands/GetLegalHoldCommand";
170190
import {
171191
GetRecoveryPointRestoreMetadataCommand,
172192
GetRecoveryPointRestoreMetadataCommandInput,
@@ -217,6 +237,11 @@ import {
217237
ListFrameworksCommandInput,
218238
ListFrameworksCommandOutput,
219239
} from "./commands/ListFrameworksCommand";
240+
import {
241+
ListLegalHoldsCommand,
242+
ListLegalHoldsCommandInput,
243+
ListLegalHoldsCommandOutput,
244+
} from "./commands/ListLegalHoldsCommand";
220245
import {
221246
ListProtectedResourcesCommand,
222247
ListProtectedResourcesCommandInput,
@@ -227,6 +252,11 @@ import {
227252
ListRecoveryPointsByBackupVaultCommandInput,
228253
ListRecoveryPointsByBackupVaultCommandOutput,
229254
} from "./commands/ListRecoveryPointsByBackupVaultCommand";
255+
import {
256+
ListRecoveryPointsByLegalHoldCommand,
257+
ListRecoveryPointsByLegalHoldCommandInput,
258+
ListRecoveryPointsByLegalHoldCommandOutput,
259+
} from "./commands/ListRecoveryPointsByLegalHoldCommand";
230260
import {
231261
ListRecoveryPointsByResourceCommand,
232262
ListRecoveryPointsByResourceCommandInput,
@@ -333,6 +363,39 @@ import {
333363
* auditing.</p>
334364
*/
335365
export class Backup extends BackupClient {
366+
/**
367+
* <p>This action removes the specified legal hold on a recovery point.
368+
* This action can only be performed by a user with sufficient permissions.</p>
369+
*/
370+
public cancelLegalHold(
371+
args: CancelLegalHoldCommandInput,
372+
options?: __HttpHandlerOptions
373+
): Promise<CancelLegalHoldCommandOutput>;
374+
public cancelLegalHold(
375+
args: CancelLegalHoldCommandInput,
376+
cb: (err: any, data?: CancelLegalHoldCommandOutput) => void
377+
): void;
378+
public cancelLegalHold(
379+
args: CancelLegalHoldCommandInput,
380+
options: __HttpHandlerOptions,
381+
cb: (err: any, data?: CancelLegalHoldCommandOutput) => void
382+
): void;
383+
public cancelLegalHold(
384+
args: CancelLegalHoldCommandInput,
385+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CancelLegalHoldCommandOutput) => void),
386+
cb?: (err: any, data?: CancelLegalHoldCommandOutput) => void
387+
): Promise<CancelLegalHoldCommandOutput> | void {
388+
const command = new CancelLegalHoldCommand(args);
389+
if (typeof optionsOrCb === "function") {
390+
this.send(command, optionsOrCb);
391+
} else if (typeof cb === "function") {
392+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
393+
this.send(command, optionsOrCb || {}, cb);
394+
} else {
395+
return this.send(command, optionsOrCb);
396+
}
397+
}
398+
336399
/**
337400
* <p>Creates a backup plan using a backup plan name and backup rules. A backup plan is a
338401
* document that contains information that Backup uses to schedule tasks that
@@ -475,6 +538,41 @@ export class Backup extends BackupClient {
475538
}
476539
}
477540

541+
/**
542+
* <p>This action creates a legal hold on a recovery point (backup). A legal hold
543+
* is a restraint on altering or deleting a backup until an authorized user cancels the
544+
* legal hold. Any actions to delete or disassociate a recovery point will fail with
545+
* an error if one or more active legal holds are on the recovery point.</p>
546+
*/
547+
public createLegalHold(
548+
args: CreateLegalHoldCommandInput,
549+
options?: __HttpHandlerOptions
550+
): Promise<CreateLegalHoldCommandOutput>;
551+
public createLegalHold(
552+
args: CreateLegalHoldCommandInput,
553+
cb: (err: any, data?: CreateLegalHoldCommandOutput) => void
554+
): void;
555+
public createLegalHold(
556+
args: CreateLegalHoldCommandInput,
557+
options: __HttpHandlerOptions,
558+
cb: (err: any, data?: CreateLegalHoldCommandOutput) => void
559+
): void;
560+
public createLegalHold(
561+
args: CreateLegalHoldCommandInput,
562+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateLegalHoldCommandOutput) => void),
563+
cb?: (err: any, data?: CreateLegalHoldCommandOutput) => void
564+
): Promise<CreateLegalHoldCommandOutput> | void {
565+
const command = new CreateLegalHoldCommand(args);
566+
if (typeof optionsOrCb === "function") {
567+
this.send(command, optionsOrCb);
568+
} else if (typeof cb === "function") {
569+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
570+
this.send(command, optionsOrCb || {}, cb);
571+
} else {
572+
return this.send(command, optionsOrCb);
573+
}
574+
}
575+
478576
/**
479577
* <p>Creates a report plan. A report plan is a document that contains information about the
480578
* contents of the report and where Backup will deliver it.</p>
@@ -747,6 +845,16 @@ export class Backup extends BackupClient {
747845
* <p>Deletes the recovery point specified by a recovery point ID.</p>
748846
* <p>If the recovery point ID belongs to a continuous backup, calling this endpoint deletes
749847
* the existing continuous backup and stops future continuous backup.</p>
848+
* <p>When an IAM role's permissions are insufficient to call this API, the service sends back
849+
* an HTTP 200 response with an empty HTTP body, but the recovery point is not deleted.
850+
* Instead, it enters an <code>EXPIRED</code> state.</p>
851+
* <p>
852+
* <code>EXPIRED</code> recovery points can be deleted with this API once the IAM role
853+
* has the <code>iam:CreateServiceLinkedRole</code> action. To learn more about adding this role, see
854+
* <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/deleting-backups.html#deleting-backups-troubleshooting">
855+
* Troubleshooting manual deletions</a>.</p>
856+
* <p>If the user or role is deleted or the permission within the role is removed,
857+
* the deletion will not be successful and will enter an <code>EXPIRED</code> state.</p>
750858
*/
751859
public deleteRecoveryPoint(
752860
args: DeleteRecoveryPointCommandInput,
@@ -1207,6 +1315,39 @@ export class Backup extends BackupClient {
12071315
}
12081316
}
12091317

1318+
/**
1319+
* <p>This action to a specific child (nested) recovery point removes the relationship
1320+
* between the specified recovery point and its parent (composite) recovery point.</p>
1321+
*/
1322+
public disassociateRecoveryPointFromParent(
1323+
args: DisassociateRecoveryPointFromParentCommandInput,
1324+
options?: __HttpHandlerOptions
1325+
): Promise<DisassociateRecoveryPointFromParentCommandOutput>;
1326+
public disassociateRecoveryPointFromParent(
1327+
args: DisassociateRecoveryPointFromParentCommandInput,
1328+
cb: (err: any, data?: DisassociateRecoveryPointFromParentCommandOutput) => void
1329+
): void;
1330+
public disassociateRecoveryPointFromParent(
1331+
args: DisassociateRecoveryPointFromParentCommandInput,
1332+
options: __HttpHandlerOptions,
1333+
cb: (err: any, data?: DisassociateRecoveryPointFromParentCommandOutput) => void
1334+
): void;
1335+
public disassociateRecoveryPointFromParent(
1336+
args: DisassociateRecoveryPointFromParentCommandInput,
1337+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DisassociateRecoveryPointFromParentCommandOutput) => void),
1338+
cb?: (err: any, data?: DisassociateRecoveryPointFromParentCommandOutput) => void
1339+
): Promise<DisassociateRecoveryPointFromParentCommandOutput> | void {
1340+
const command = new DisassociateRecoveryPointFromParentCommand(args);
1341+
if (typeof optionsOrCb === "function") {
1342+
this.send(command, optionsOrCb);
1343+
} else if (typeof cb === "function") {
1344+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1345+
this.send(command, optionsOrCb || {}, cb);
1346+
} else {
1347+
return this.send(command, optionsOrCb);
1348+
}
1349+
}
1350+
12101351
/**
12111352
* <p>Returns the backup plan that is specified by the plan ID as a backup template.</p>
12121353
*/
@@ -1434,6 +1575,36 @@ export class Backup extends BackupClient {
14341575
}
14351576
}
14361577

1578+
/**
1579+
* <p>This action returns details for a specified legal hold. The details are the
1580+
* body of a legal hold in JSON format, in addition to metadata.</p>
1581+
*/
1582+
public getLegalHold(
1583+
args: GetLegalHoldCommandInput,
1584+
options?: __HttpHandlerOptions
1585+
): Promise<GetLegalHoldCommandOutput>;
1586+
public getLegalHold(args: GetLegalHoldCommandInput, cb: (err: any, data?: GetLegalHoldCommandOutput) => void): void;
1587+
public getLegalHold(
1588+
args: GetLegalHoldCommandInput,
1589+
options: __HttpHandlerOptions,
1590+
cb: (err: any, data?: GetLegalHoldCommandOutput) => void
1591+
): void;
1592+
public getLegalHold(
1593+
args: GetLegalHoldCommandInput,
1594+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetLegalHoldCommandOutput) => void),
1595+
cb?: (err: any, data?: GetLegalHoldCommandOutput) => void
1596+
): Promise<GetLegalHoldCommandOutput> | void {
1597+
const command = new GetLegalHoldCommand(args);
1598+
if (typeof optionsOrCb === "function") {
1599+
this.send(command, optionsOrCb);
1600+
} else if (typeof cb === "function") {
1601+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1602+
this.send(command, optionsOrCb || {}, cb);
1603+
} else {
1604+
return this.send(command, optionsOrCb);
1605+
}
1606+
}
1607+
14371608
/**
14381609
* <p>Returns a set of metadata key-value pairs that were used to create the backup.</p>
14391610
*/
@@ -1758,6 +1929,38 @@ export class Backup extends BackupClient {
17581929
}
17591930
}
17601931

1932+
/**
1933+
* <p>This action returns metadata about active and previous legal holds.</p>
1934+
*/
1935+
public listLegalHolds(
1936+
args: ListLegalHoldsCommandInput,
1937+
options?: __HttpHandlerOptions
1938+
): Promise<ListLegalHoldsCommandOutput>;
1939+
public listLegalHolds(
1940+
args: ListLegalHoldsCommandInput,
1941+
cb: (err: any, data?: ListLegalHoldsCommandOutput) => void
1942+
): void;
1943+
public listLegalHolds(
1944+
args: ListLegalHoldsCommandInput,
1945+
options: __HttpHandlerOptions,
1946+
cb: (err: any, data?: ListLegalHoldsCommandOutput) => void
1947+
): void;
1948+
public listLegalHolds(
1949+
args: ListLegalHoldsCommandInput,
1950+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListLegalHoldsCommandOutput) => void),
1951+
cb?: (err: any, data?: ListLegalHoldsCommandOutput) => void
1952+
): Promise<ListLegalHoldsCommandOutput> | void {
1953+
const command = new ListLegalHoldsCommand(args);
1954+
if (typeof optionsOrCb === "function") {
1955+
this.send(command, optionsOrCb);
1956+
} else if (typeof cb === "function") {
1957+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1958+
this.send(command, optionsOrCb || {}, cb);
1959+
} else {
1960+
return this.send(command, optionsOrCb);
1961+
}
1962+
}
1963+
17611964
/**
17621965
* <p>Returns an array of resources successfully backed up by Backup, including
17631966
* the time the resource was saved, an Amazon Resource Name (ARN) of the resource, and a
@@ -1824,6 +2027,39 @@ export class Backup extends BackupClient {
18242027
}
18252028
}
18262029

2030+
/**
2031+
* <p>This action returns recovery point ARNs (Amazon Resource Names) of the
2032+
* specified legal hold.</p>
2033+
*/
2034+
public listRecoveryPointsByLegalHold(
2035+
args: ListRecoveryPointsByLegalHoldCommandInput,
2036+
options?: __HttpHandlerOptions
2037+
): Promise<ListRecoveryPointsByLegalHoldCommandOutput>;
2038+
public listRecoveryPointsByLegalHold(
2039+
args: ListRecoveryPointsByLegalHoldCommandInput,
2040+
cb: (err: any, data?: ListRecoveryPointsByLegalHoldCommandOutput) => void
2041+
): void;
2042+
public listRecoveryPointsByLegalHold(
2043+
args: ListRecoveryPointsByLegalHoldCommandInput,
2044+
options: __HttpHandlerOptions,
2045+
cb: (err: any, data?: ListRecoveryPointsByLegalHoldCommandOutput) => void
2046+
): void;
2047+
public listRecoveryPointsByLegalHold(
2048+
args: ListRecoveryPointsByLegalHoldCommandInput,
2049+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListRecoveryPointsByLegalHoldCommandOutput) => void),
2050+
cb?: (err: any, data?: ListRecoveryPointsByLegalHoldCommandOutput) => void
2051+
): Promise<ListRecoveryPointsByLegalHoldCommandOutput> | void {
2052+
const command = new ListRecoveryPointsByLegalHoldCommand(args);
2053+
if (typeof optionsOrCb === "function") {
2054+
this.send(command, optionsOrCb);
2055+
} else if (typeof cb === "function") {
2056+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2057+
this.send(command, optionsOrCb || {}, cb);
2058+
} else {
2059+
return this.send(command, optionsOrCb);
2060+
}
2061+
}
2062+
18272063
/**
18282064
* <p>Returns detailed information about all the recovery points of the type specified by a
18292065
* resource Amazon Resource Name (ARN).</p>
@@ -2224,6 +2460,10 @@ export class Backup extends BackupClient {
22242460

22252461
/**
22262462
* <p>Attempts to cancel a job to create a one-time backup of a resource.</p>
2463+
* <p>This action is not supported for the following services:
2464+
* Amazon FSx for Windows File Server, Amazon FSx for Lustre, FSx for ONTAP
2465+
* , Amazon FSx for OpenZFS, Amazon DocumentDB (with MongoDB compatibility), Amazon RDS, Amazon Aurora,
2466+
* and Amazon Neptune.</p>
22272467
*/
22282468
public stopBackupJob(
22292469
args: StopBackupJobCommandInput,

0 commit comments

Comments
 (0)