Skip to main content

data_shares

Creates, updates, deletes, gets or lists a data_shares resource.

Overview

Namedata_shares
TypeResource
Idaws.redshift.data_shares

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
allow_publicly_accessible_consumersbooleanA value that specifies whether the datashare can be shared to a publicly accessible cluster.
data_share_arnstringThe Amazon Resource Name (ARN) of the datashare that the consumer is to use.
data_share_associationsstringA value that specifies when the datashare has an association between producer and data consumers.
data_share_typestringThe type of the datashare created by RegisterNamespace.
managed_bystringThe identifier of a datashare to show its managing entity.
producer_arnstringThe Amazon Resource Name (ARN) of the producer namespace.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_data_sharesselectregionDataShareArn, MaxRecords, MarkerShows the status of any inbound or outbound datashares available in the specified account.
authorize_data_shareupdateDataShareArn, ConsumerIdentifier, regionAllowWritesFrom a data producer account, authorizes the sharing of a datashare with one or more consumer accounts or managing entities. To authorize a datashare for a data consumer, the producer account must have the correct access permissions.
associate_data_share_consumerupdateDataShareArn, regionAssociateEntireAccount, ConsumerArn, ConsumerRegion, AllowWritesFrom 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.
deauthorize_data_shareexecDataShareArn, ConsumerIdentifier, regionFrom a datashare producer account, removes authorization from the specified datashare.
disassociate_data_share_consumerexecDataShareArn, regionDisassociateEntireAccount, ConsumerArn, ConsumerRegionFrom a datashare consumer account, remove association for the specified datashare.
reject_data_shareexecDataShareArn, regionFrom a datashare consumer account, rejects the specified datashare.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ConsumerIdentifierstringThe identifier of the data consumer that is to have authorization removed from the datashare. This identifier is an Amazon Web Services account ID or a keyword, such as ADX.
DataShareArnstringThe Amazon Resource Name (ARN) of the datashare to reject.
regionstringAWS region (default: us-east-1)
AllowWritesbooleanIf set to true, allows write operations for a datashare.
AssociateEntireAccountbooleanA value that specifies whether the datashare is associated with the entire account.
ConsumerArnstringThe Amazon Resource Name (ARN) of the consumer namespace that association for the datashare is removed from.
ConsumerRegionstringFrom a datashare consumer account, removes association of a datashare from all the existing and future namespaces in the specified Amazon Web Services Region.
DataShareArnstringThe Amazon resource name (ARN) of the datashare to describe details of.
DisassociateEntireAccountbooleanA value that specifies whether association for the datashare is removed from the entire account.
MarkerstringAn optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeDataShares request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.
MaxRecordsintegerThe maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.

SELECT examples

Shows the status of any inbound or outbound datashares available in the specified account.

SELECT
allow_publicly_accessible_consumers,
data_share_arn,
data_share_associations,
data_share_type,
managed_by,
producer_arn
FROM aws.redshift.data_shares
WHERE region = '{{ region }}' -- required
AND DataShareArn = '{{ DataShareArn }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
;

UPDATE examples

From a data producer account, authorizes the sharing of a datashare with one or more consumer accounts or managing entities. To authorize a datashare for a data consumer, the producer account must have the correct access permissions.

UPDATE aws.redshift.data_shares
SET
-- No updatable properties
WHERE
DataShareArn = '{{ DataShareArn }}' --required
AND ConsumerIdentifier = '{{ ConsumerIdentifier }}' --required
AND region = '{{ region }}' --required
AND AllowWrites = {{ AllowWrites}}
RETURNING
allow_publicly_accessible_consumers,
data_share_arn,
data_share_associations,
data_share_type,
managed_by,
producer_arn;

Lifecycle Methods

From a datashare producer account, removes authorization from the specified datashare.

EXEC aws.redshift.data_shares.deauthorize_data_share
@DataShareArn='{{ DataShareArn }}' --required,
@ConsumerIdentifier='{{ ConsumerIdentifier }}' --required,
@region='{{ region }}' --required
;