- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
AssociateDataShareConsumerCommand
From a datashare consumer account, associates a datashare with the account (AssociateEntireAccount) or the specified namespace (ConsumerArn). If you make this association, the consumer can consume the datashare.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { RedshiftClient, AssociateDataShareConsumerCommand } from "@aws-sdk/client-redshift"; // ES Modules import
// const { RedshiftClient, AssociateDataShareConsumerCommand } = require("@aws-sdk/client-redshift"); // CommonJS import
const client = new RedshiftClient(config);
const input = { // AssociateDataShareConsumerMessage
DataShareArn: "STRING_VALUE", // required
AssociateEntireAccount: true || false,
ConsumerArn: "STRING_VALUE",
ConsumerRegion: "STRING_VALUE",
AllowWrites: true || false,
};
const command = new AssociateDataShareConsumerCommand(input);
const response = await client.send(command);
// { // DataShare
// DataShareArn: "STRING_VALUE",
// ProducerArn: "STRING_VALUE",
// AllowPubliclyAccessibleConsumers: true || false,
// DataShareAssociations: [ // DataShareAssociationList
// { // DataShareAssociation
// ConsumerIdentifier: "STRING_VALUE",
// Status: "ACTIVE" || "PENDING_AUTHORIZATION" || "AUTHORIZED" || "DEAUTHORIZED" || "REJECTED" || "AVAILABLE",
// ConsumerRegion: "STRING_VALUE",
// CreatedDate: new Date("TIMESTAMP"),
// StatusChangeDate: new Date("TIMESTAMP"),
// ProducerAllowedWrites: true || false,
// ConsumerAcceptedWrites: true || false,
// },
// ],
// ManagedBy: "STRING_VALUE",
// DataShareType: "INTERNAL",
// };
AssociateDataShareConsumerCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DataShareArn Required | string | undefined | The Amazon Resource Name (ARN) of the datashare that the consumer is to use. |
AllowWrites | boolean | undefined | If set to true, allows write operations for a datashare. |
AssociateEntireAccount | boolean | undefined | A value that specifies whether the datashare is associated with the entire account. |
ConsumerArn | string | undefined | The Amazon Resource Name (ARN) of the consumer namespace associated with the datashare. |
ConsumerRegion | string | undefined | From a datashare consumer account, associates a datashare with all existing and future namespaces in the specified Amazon Web Services Region. |
AssociateDataShareConsumerCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
AllowPubliclyAccessibleConsumers | boolean | undefined | A value that specifies whether the datashare can be shared to a publicly accessible cluster. |
DataShareArn | string | undefined | The Amazon Resource Name (ARN) of the datashare that the consumer is to use. |
DataShareAssociations | DataShareAssociation[] | undefined | A value that specifies when the datashare has an association between producer and data consumers. |
DataShareType | DataShareType | undefined | The type of the datashare created by RegisterNamespace. |
ManagedBy | string | undefined | The identifier of a datashare to show its managing entity. |
ProducerArn | string | undefined | The Amazon Resource Name (ARN) of the producer namespace. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidDataShareFault | client | There is an error with the datashare. |
InvalidNamespaceFault | client | The namespace isn't valid because the namespace doesn't exist. Provide a valid namespace. |
RedshiftServiceException | Base exception class for all service exceptions from Redshift service. |