-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
redshift-describe-clusters.js
42 lines (34 loc) · 1.59 KB
/
redshift-describe-clusters.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
ABOUT THIS NODE.JS EXAMPLE: This example works with the AWS SDK for JavaScript version 3 (v3),
which is available at https://github.com/aws/aws-sdk-js-v3. This example is in the 'AWS SDK for JavaScript v3 Developer Guide' at
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/redshift-examples.html.
Purpose:
redshift-describe-clusters.js demonstrates how to return properties of provisioned Amazon Redshift clusters, including general
cluster properties, cluster database properties, maintenance and backup properties, and security and access properties.
Inputs (replace in code):
- CLUSTER_NAME: The name of the cluster
For more information about these and additional parameters, see https://docs.aws.amazon.com/redshift/latest/APIReference/API_DescribeClusters.html.
Running the code:
node redshift-describe-clusters.js
*/
// snippet-start:[redshift.javascript.redshift-describe-clustersV3]
// Import required AWS SDK clients and commands for Node.js
import { DescribeClustersCommand } from "@aws-sdk/client-redshift";
import { redshiftClient } from "./libs/redshiftClient.js";
const params = {
ClusterIdentifier: "CLUSTER_NAME",
};
const run = async () => {
try {
const data = await redshiftClient.send(new DescribeClustersCommand(params));
console.log("Success", data);
return data; // For unit tests.
} catch (err) {
console.log("Error", err);
}
};
run();
// snippet-end:[redshift.javascript.redshift-describe-clustersV3]
// module.exports = { run, params };