attached_files
Creates, updates, deletes, gets or lists an attached_files resource.
Overview
| Name | attached_files |
| Type | Resource |
| Id | aws.connect.attached_files |
Fields
The following fields are returned by SELECT queries:
- get_attached_file
| Name | Datatype | Description |
|---|---|---|
associated_resource_arn | string | The resource to which the attached file is (being) uploaded to. The supported resources are Cases, Email, and Task. |
created_by | object | Information on the identity that created the file. |
creation_time | string | The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2024-05-03T02:41:28.172Z. |
download_url_metadata | object | URL and expiry to be used when downloading the attached file. |
file_arn | string | The unique identifier of the attached file resource (ARN). |
file_id | string | The unique identifier of the attached file resource. |
file_name | string | A case-sensitive name of the attached file being uploaded. (pattern: <code>^\P{C}*$</code>) |
file_size_in_bytes | integer (int64) | The size of the attached file in bytes. |
file_status | string | The current status of the attached file. (APPROVED, REJECTED, PROCESSING, FAILED) |
file_use_case_type | string | The use case for the file. (CONTACT_ANALYSIS, EMAIL_MESSAGE, EMAIL_MESSAGE_PLAIN_TEXT, EMAIL_MESSAGE_REDACTED, EMAIL_MESSAGE_PLAIN_TEXT_REDACTED, ATTACHMENT, VOICE_RECORDING) |
tags | object | The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_attached_file | select | instance_id, file_id, associatedResourceArn, region | urlExpiryInSeconds | Provides a pre-signed URL for download of an approved attached file. This API also returns metadata about the attached file. It will only return a downloadURL if the status of the attached file is APPROVED. |
create_attached_file | insert | instance_id, associatedResourceArn, region, FileUseCaseType, FileSourceUri | Creates an attached file for a completed voice contact by copying a recording from a source S3 URI into Connect Customer managed storage. Use this API to attach voice recordings to contacts for downstream processing such as conversational analytics. The AssociatedResourceArn must be the ARN of a completed voice contact, FileUseCaseType must be set to VOICE_RECORDING, and FileSourceUri must be a valid S3 URI. For example, you can call CreateContact, then CreateAttachedFile, then StartContactConversationalAnalyticsJob to create a contact, attach a recording, and run post-call analytics. | |
delete_attached_file | delete | instance_id, file_id, associatedResourceArn, region | Deletes an attached file along with the underlying S3 Object. The attached file is permanently deleted if S3 bucket versioning is not enabled. | |
start_attached_file_upload | exec | instance_id, associatedResourceArn, region, FileName, FileSizeInBytes, FileUseCaseType | Provides a pre-signed Amazon S3 URL in response for uploading your content. You may only use this API to upload attachments to a Connect Customer Case, Connect Customer Email, or Connect Customer Task. |
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.
| Name | Datatype | Description |
|---|---|---|
associatedResourceArn | string | The resource to which the attached file is (being) uploaded to. The supported resources are Cases, Email, and Task. This value must be a valid ARN. |
file_id | string | The unique identifier of the attached file resource. |
instance_id | string | The unique identifier of the Connect Customer instance. |
region | string | AWS region (default: us-east-1) |
urlExpiryInSeconds | integer | Optional override for the expiry of the pre-signed S3 URL in seconds. The default value is 300. |
SELECT examples
- get_attached_file
Provides a pre-signed URL for download of an approved attached file. This API also returns metadata about the attached file. It will only return a downloadURL if the status of the attached file is APPROVED.
SELECT
associated_resource_arn,
created_by,
creation_time,
download_url_metadata,
file_arn,
file_id,
file_name,
file_size_in_bytes,
file_status,
file_use_case_type,
tags
FROM aws.connect.attached_files
WHERE instance_id = '{{ instance_id }}' -- required
AND file_id = '{{ file_id }}' -- required
AND associatedResourceArn = '{{ associatedResourceArn }}' -- required
AND region = '{{ region }}' -- required
AND urlExpiryInSeconds = '{{ urlExpiryInSeconds }}'
;
INSERT examples
- create_attached_file
- Manifest
Creates an attached file for a completed voice contact by copying a recording from a source S3 URI into Connect Customer managed storage. Use this API to attach voice recordings to contacts for downstream processing such as conversational analytics. The AssociatedResourceArn must be the ARN of a completed voice contact, FileUseCaseType must be set to VOICE_RECORDING, and FileSourceUri must be a valid S3 URI. For example, you can call CreateContact, then CreateAttachedFile, then StartContactConversationalAnalyticsJob to create a contact, attach a recording, and run post-call analytics.
INSERT INTO aws.connect.attached_files (
ClientToken,
FileUseCaseType,
FileSourceUri,
Tags,
instance_id,
associatedResourceArn,
region
)
SELECT
'{{ ClientToken }}',
'{{ FileUseCaseType }}' /* required */,
'{{ FileSourceUri }}' /* required */,
'{{ Tags }}',
'{{ instance_id }}',
'{{ associatedResourceArn }}',
'{{ region }}'
RETURNING
creation_time,
file_arn,
file_id,
file_status
;
# Description fields are for documentation purposes
- name: attached_files
props:
- name: instance_id
value: "{{ instance_id }}"
description: Required parameter for the attached_files resource.
- name: associatedResourceArn
value: "{{ associatedResourceArn }}"
description: Required parameter for the attached_files resource.
- name: region
value: "{{ region }}"
description: Required parameter for the attached_files resource.
- name: ClientToken
value: "{{ ClientToken }}"
- name: FileUseCaseType
value: "{{ FileUseCaseType }}"
valid_values: ['CONTACT_ANALYSIS', 'EMAIL_MESSAGE', 'EMAIL_MESSAGE_PLAIN_TEXT', 'EMAIL_MESSAGE_REDACTED', 'EMAIL_MESSAGE_PLAIN_TEXT_REDACTED', 'ATTACHMENT', 'VOICE_RECORDING']
- name: FileSourceUri
value: "{{ FileSourceUri }}"
- name: Tags
value: "{{ Tags }}"
DELETE examples
- delete_attached_file
Deletes an attached file along with the underlying S3 Object. The attached file is permanently deleted if S3 bucket versioning is not enabled.
DELETE FROM aws.connect.attached_files
WHERE instance_id = '{{ instance_id }}' --required
AND file_id = '{{ file_id }}' --required
AND associatedResourceArn = '{{ associatedResourceArn }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- start_attached_file_upload
Provides a pre-signed Amazon S3 URL in response for uploading your content. You may only use this API to upload attachments to a Connect Customer Case, Connect Customer Email, or Connect Customer Task.
EXEC aws.connect.attached_files.start_attached_file_upload
@instance_id='{{ instance_id }}' --required,
@associatedResourceArn='{{ associatedResourceArn }}' --required,
@region='{{ region }}' --required
@@json=
'{
"ClientToken": "{{ ClientToken }}",
"FileName": "{{ FileName }}",
"FileSizeInBytes": {{ FileSizeInBytes }},
"UrlExpiryInSeconds": {{ UrlExpiryInSeconds }},
"FileUseCaseType": "{{ FileUseCaseType }}",
"CreatedBy": "{{ CreatedBy }}",
"Tags": "{{ Tags }}"
}'
;