Skip to content

Commit b6e2600

Browse files
author
awstools
committed
feat(client-rds): This release adds the "ModifyActivityStream" API with support for audit policy state locking and unlocking.
1 parent 574cf7e commit b6e2600

File tree

8 files changed

+522
-42
lines changed

8 files changed

+522
-42
lines changed

clients/client-rds/src/RDS.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,11 @@ import {
441441
ListTagsForResourceCommandInput,
442442
ListTagsForResourceCommandOutput,
443443
} from "./commands/ListTagsForResourceCommand";
444+
import {
445+
ModifyActivityStreamCommand,
446+
ModifyActivityStreamCommandInput,
447+
ModifyActivityStreamCommandOutput,
448+
} from "./commands/ModifyActivityStreamCommand";
444449
import {
445450
ModifyCertificatesCommand,
446451
ModifyCertificatesCommandInput,
@@ -3982,6 +3987,42 @@ export class RDS extends RDSClient {
39823987
}
39833988
}
39843989

3990+
/**
3991+
* <p>Changes the audit policy state of a database activity stream to either locked (default) or unlocked. A locked policy is read-only,
3992+
* whereas an unlocked policy is read/write. If your activity stream is started and locked, you can unlock it, customize your audit policy,
3993+
* and then lock your activity stream. Restarting the activity stream isn't required. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.Modifying.html"> Modifying a database activity stream</a> in the
3994+
* <i>Amazon RDS User Guide</i>. </p>
3995+
* <p>This operation is supported for RDS for Oracle only.</p>
3996+
*/
3997+
public modifyActivityStream(
3998+
args: ModifyActivityStreamCommandInput,
3999+
options?: __HttpHandlerOptions
4000+
): Promise<ModifyActivityStreamCommandOutput>;
4001+
public modifyActivityStream(
4002+
args: ModifyActivityStreamCommandInput,
4003+
cb: (err: any, data?: ModifyActivityStreamCommandOutput) => void
4004+
): void;
4005+
public modifyActivityStream(
4006+
args: ModifyActivityStreamCommandInput,
4007+
options: __HttpHandlerOptions,
4008+
cb: (err: any, data?: ModifyActivityStreamCommandOutput) => void
4009+
): void;
4010+
public modifyActivityStream(
4011+
args: ModifyActivityStreamCommandInput,
4012+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ModifyActivityStreamCommandOutput) => void),
4013+
cb?: (err: any, data?: ModifyActivityStreamCommandOutput) => void
4014+
): Promise<ModifyActivityStreamCommandOutput> | void {
4015+
const command = new ModifyActivityStreamCommand(args);
4016+
if (typeof optionsOrCb === "function") {
4017+
this.send(command, optionsOrCb);
4018+
} else if (typeof cb === "function") {
4019+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
4020+
this.send(command, optionsOrCb || {}, cb);
4021+
} else {
4022+
return this.send(command, optionsOrCb);
4023+
}
4024+
}
4025+
39854026
/**
39864027
* <p>Override the system-default Secure Sockets Layer/Transport Layer Security (SSL/TLS)
39874028
* certificate for Amazon RDS for new DB instances, or remove the override.</p>

clients/client-rds/src/RDSClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ import {
342342
ListTagsForResourceCommandInput,
343343
ListTagsForResourceCommandOutput,
344344
} from "./commands/ListTagsForResourceCommand";
345+
import {
346+
ModifyActivityStreamCommandInput,
347+
ModifyActivityStreamCommandOutput,
348+
} from "./commands/ModifyActivityStreamCommand";
345349
import { ModifyCertificatesCommandInput, ModifyCertificatesCommandOutput } from "./commands/ModifyCertificatesCommand";
346350
import {
347351
ModifyCurrentDBClusterCapacityCommandInput,
@@ -576,6 +580,7 @@ export type ServiceInputTypes =
576580
| FailoverDBClusterCommandInput
577581
| FailoverGlobalClusterCommandInput
578582
| ListTagsForResourceCommandInput
583+
| ModifyActivityStreamCommandInput
579584
| ModifyCertificatesCommandInput
580585
| ModifyCurrentDBClusterCapacityCommandInput
581586
| ModifyCustomDBEngineVersionCommandInput
@@ -713,6 +718,7 @@ export type ServiceOutputTypes =
713718
| FailoverDBClusterCommandOutput
714719
| FailoverGlobalClusterCommandOutput
715720
| ListTagsForResourceCommandOutput
721+
| ModifyActivityStreamCommandOutput
716722
| ModifyCertificatesCommandOutput
717723
| ModifyCurrentDBClusterCapacityCommandOutput
718724
| ModifyCustomDBEngineVersionCommandOutput
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { ModifyActivityStreamRequest, ModifyActivityStreamResponse } from "../models/models_1";
16+
import {
17+
deserializeAws_queryModifyActivityStreamCommand,
18+
serializeAws_queryModifyActivityStreamCommand,
19+
} from "../protocols/Aws_query";
20+
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient";
21+
22+
export interface ModifyActivityStreamCommandInput extends ModifyActivityStreamRequest {}
23+
export interface ModifyActivityStreamCommandOutput extends ModifyActivityStreamResponse, __MetadataBearer {}
24+
25+
/**
26+
* <p>Changes the audit policy state of a database activity stream to either locked (default) or unlocked. A locked policy is read-only,
27+
* whereas an unlocked policy is read/write. If your activity stream is started and locked, you can unlock it, customize your audit policy,
28+
* and then lock your activity stream. Restarting the activity stream isn't required. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.Modifying.html"> Modifying a database activity stream</a> in the
29+
* <i>Amazon RDS User Guide</i>. </p>
30+
* <p>This operation is supported for RDS for Oracle only.</p>
31+
* @example
32+
* Use a bare-bones client and the command you need to make an API call.
33+
* ```javascript
34+
* import { RDSClient, ModifyActivityStreamCommand } from "@aws-sdk/client-rds"; // ES Modules import
35+
* // const { RDSClient, ModifyActivityStreamCommand } = require("@aws-sdk/client-rds"); // CommonJS import
36+
* const client = new RDSClient(config);
37+
* const command = new ModifyActivityStreamCommand(input);
38+
* const response = await client.send(command);
39+
* ```
40+
*
41+
* @see {@link ModifyActivityStreamCommandInput} for command's `input` shape.
42+
* @see {@link ModifyActivityStreamCommandOutput} for command's `response` shape.
43+
* @see {@link RDSClientResolvedConfig | config} for RDSClient's `config` shape.
44+
*
45+
*/
46+
export class ModifyActivityStreamCommand extends $Command<
47+
ModifyActivityStreamCommandInput,
48+
ModifyActivityStreamCommandOutput,
49+
RDSClientResolvedConfig
50+
> {
51+
// Start section: command_properties
52+
// End section: command_properties
53+
54+
constructor(readonly input: ModifyActivityStreamCommandInput) {
55+
// Start section: command_constructor
56+
super();
57+
// End section: command_constructor
58+
}
59+
60+
/**
61+
* @internal
62+
*/
63+
resolveMiddleware(
64+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
65+
configuration: RDSClientResolvedConfig,
66+
options?: __HttpHandlerOptions
67+
): Handler<ModifyActivityStreamCommandInput, ModifyActivityStreamCommandOutput> {
68+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
69+
70+
const stack = clientStack.concat(this.middlewareStack);
71+
72+
const { logger } = configuration;
73+
const clientName = "RDSClient";
74+
const commandName = "ModifyActivityStreamCommand";
75+
const handlerExecutionContext: HandlerExecutionContext = {
76+
logger,
77+
clientName,
78+
commandName,
79+
inputFilterSensitiveLog: ModifyActivityStreamRequest.filterSensitiveLog,
80+
outputFilterSensitiveLog: ModifyActivityStreamResponse.filterSensitiveLog,
81+
};
82+
const { requestHandler } = configuration;
83+
return stack.resolve(
84+
(request: FinalizeHandlerArguments<any>) =>
85+
requestHandler.handle(request.request as __HttpRequest, options || {}),
86+
handlerExecutionContext
87+
);
88+
}
89+
90+
private serialize(input: ModifyActivityStreamCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
91+
return serializeAws_queryModifyActivityStreamCommand(input, context);
92+
}
93+
94+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ModifyActivityStreamCommandOutput> {
95+
return deserializeAws_queryModifyActivityStreamCommand(output, context);
96+
}
97+
98+
// Start section: command_body_extra
99+
// End section: command_body_extra
100+
}

clients/client-rds/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export * from "./DownloadDBLogFilePortionCommand";
8787
export * from "./FailoverDBClusterCommand";
8888
export * from "./FailoverGlobalClusterCommand";
8989
export * from "./ListTagsForResourceCommand";
90+
export * from "./ModifyActivityStreamCommand";
9091
export * from "./ModifyCertificatesCommand";
9192
export * from "./ModifyCurrentDBClusterCapacityCommand";
9293
export * from "./ModifyCustomDBEngineVersionCommand";

clients/client-rds/src/models/models_0.ts

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ export namespace AccountAttributesMessage {
163163

164164
export type ActivityStreamMode = "async" | "sync";
165165

166+
export enum ActivityStreamPolicyStatus {
167+
locked = "locked",
168+
locking_policy = "locking-policy",
169+
unlocked = "unlocked",
170+
unlocking_policy = "unlocking-policy",
171+
}
172+
166173
export type ActivityStreamStatus = "started" | "starting" | "stopped" | "stopping";
167174

168175
export interface AddRoleToDBClusterMessage {
@@ -7837,6 +7844,11 @@ export interface DBInstance {
78377844
* </p>
78387845
*/
78397846
NetworkType?: string;
7847+
7848+
/**
7849+
* <p>The status of the policy state of the activity stream.</p>
7850+
*/
7851+
ActivityStreamPolicyStatus?: ActivityStreamPolicyStatus | string;
78407852
}
78417853

78427854
export namespace DBInstance {
@@ -8764,7 +8776,7 @@ export interface CreateDBProxyRequest {
87648776
/**
87658777
* <p>The kinds of databases that the proxy can connect to.
87668778
* This value determines which database network protocol the proxy recognizes when it interprets
8767-
* network traffic to and from the database. For Aurora MySQL, RDS for MariaDB, and RDS for MySQL databases, specify <code>MYSQL</code>.
8779+
* network traffic to and from the database. For Aurora MySQL and RDS for MySQL databases, specify <code>MYSQL</code>.
87688780
* For Aurora PostgreSQL and RDS for PostgreSQL databases, specify <code>POSTGRESQL</code>.</p>
87698781
*/
87708782
EngineFamily: EngineFamily | string | undefined;
@@ -8902,8 +8914,8 @@ export interface DBProxy {
89028914

89038915
/**
89048916
* <p>The kinds of databases that the proxy can connect to. This value determines which database network protocol
8905-
* the proxy recognizes when it interprets network traffic to and from the database. <code>MYSQL</code> supports Aurora MySQL,
8906-
* RDS for MariaDB, and RDS for MySQL databases. <code>POSTGRESQL</code> supports Aurora PostgreSQL and RDS for PostgreSQL databases.</p>
8917+
* the proxy recognizes when it interprets network traffic to and from the database. <code>MYSQL</code> supports Aurora MySQL
8918+
* and RDS for MySQL databases. <code>POSTGRESQL</code> supports Aurora PostgreSQL and RDS for PostgreSQL databases.</p>
89078919
*/
89088920
EngineFamily?: string;
89098921

@@ -13704,38 +13716,3 @@ export namespace DescribeDBSnapshotAttributesMessage {
1370413716
...obj,
1370513717
});
1370613718
}
13707-
13708-
/**
13709-
* <p>Contains the name and values of a manual DB snapshot attribute</p>
13710-
* <p>Manual DB snapshot attributes are used to authorize other Amazon Web Services accounts
13711-
* to restore a manual DB snapshot. For more information, see the <code>ModifyDBSnapshotAttribute</code>
13712-
* API.</p>
13713-
*/
13714-
export interface DBSnapshotAttribute {
13715-
/**
13716-
* <p>The name of the manual DB snapshot attribute.</p>
13717-
* <p>The attribute named <code>restore</code> refers to the list of Amazon Web Services accounts that
13718-
* have permission to copy or restore the manual DB cluster snapshot. For more information,
13719-
* see the <code>ModifyDBSnapshotAttribute</code>
13720-
* API action.</p>
13721-
*/
13722-
AttributeName?: string;
13723-
13724-
/**
13725-
* <p>The value or values for the manual DB snapshot attribute.</p>
13726-
* <p>If the <code>AttributeName</code> field is set to <code>restore</code>, then this element
13727-
* returns a list of IDs of the Amazon Web Services accounts that are authorized to copy or restore the manual
13728-
* DB snapshot. If a value of <code>all</code> is in the list, then the manual DB snapshot
13729-
* is public and available for any Amazon Web Services account to copy or restore.</p>
13730-
*/
13731-
AttributeValues?: string[];
13732-
}
13733-
13734-
export namespace DBSnapshotAttribute {
13735-
/**
13736-
* @internal
13737-
*/
13738-
export const filterSensitiveLog = (obj: DBSnapshotAttribute): any => ({
13739-
...obj,
13740-
});
13741-
}

0 commit comments

Comments
 (0)