Skip to main content

segment_snapshots

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

Overview

Namesegment_snapshots
TypeResource
Idaws.customer_profiles.segment_snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
data_formatstringThe format in which the segment will be exported. (CSV, JSONL, ORC)
destination_uristringThe destination to which the segment will be exported. This field must be provided if the request is not submitted from the Connect Customer Admin Website.
encryption_keystringThe Amazon Resource Name (ARN) of the KMS key used to encrypt the exported segment.
role_arnstringThe Amazon Resource Name (ARN) of the IAM role that allows Customer Profiles service principal to assume the role for conducting KMS and S3 operations. (pattern: <code>arn:aws:iam:.:[0-9]+:.</code>)
snapshot_idstringThe unique identifier of the segment snapshot. (pattern: <code>[a-f0-9]{32}</code>)
statusstringThe status of the asynchronous job for exporting the segment snapshot. (COMPLETED, IN_PROGRESS, FAILED)
status_messagestringThe status message of the asynchronous job for exporting the segment snapshot.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_segment_snapshotselectdomain_name, segment_definition_name, snapshot_id, regionRetrieve the latest status of a segment snapshot.
create_segment_snapshotinsertdomain_name, segment_definition_name, region, DataFormatTriggers a job to export a segment to a specified destination.

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
domain_namestringThe unique name of the domain.
regionstringAWS region (default: us-east-1)
segment_definition_namestringThe name of the segment definition used in this snapshot request.
snapshot_idstringThe unique identifier of the segment snapshot.

SELECT examples

Retrieve the latest status of a segment snapshot.

SELECT
data_format,
destination_uri,
encryption_key,
role_arn,
snapshot_id,
status,
status_message
FROM aws.customer_profiles.segment_snapshots
WHERE domain_name = '{{ domain_name }}' -- required
AND segment_definition_name = '{{ segment_definition_name }}' -- required
AND snapshot_id = '{{ snapshot_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Triggers a job to export a segment to a specified destination.

INSERT INTO aws.customer_profiles.segment_snapshots (
DataFormat,
EncryptionKey,
RoleArn,
DestinationUri,
domain_name,
segment_definition_name,
region
)
SELECT
'{{ DataFormat }}' /* required */,
'{{ EncryptionKey }}',
'{{ RoleArn }}',
'{{ DestinationUri }}',
'{{ domain_name }}',
'{{ segment_definition_name }}',
'{{ region }}'
RETURNING
snapshot_id
;