data_sources
Creates, updates, deletes or gets a data_source resource or lists data_sources in a region
Overview
| Name | data_sources |
| Type | Resource |
| Description | Definition of AWS::QBusiness::DataSource Resource Type |
| Id | awscc.qbusiness.data_sources |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
application_id | string | |
configuration | object | |
created_at | string | |
data_source_arn | string | |
data_source_id | string | |
description | string | |
display_name | string | |
document_enrichment_configuration | object | |
media_extraction_configuration | object | |
index_id | string | |
role_arn | string | |
status | string | |
sync_schedule | string | |
tags | array | |
type | string | |
updated_at | string | |
vpc_configuration | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
application_id | string | |
data_source_id | string | |
index_id | string | |
region | string | AWS region. |
For more information, see AWS::QBusiness::DataSource.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | data_sources | INSERT | ApplicationId, IndexId, Configuration, DisplayName, region |
delete_resource | data_sources | DELETE | Identifier, region |
update_resource | data_sources | UPDATE | Identifier, PatchDocument, region |
list_resources | data_sources_list_only | SELECT | region |
get_resource | data_sources | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual data_source.
SELECT
region,
application_id,
configuration,
created_at,
data_source_arn,
data_source_id,
description,
display_name,
document_enrichment_configuration,
media_extraction_configuration,
index_id,
role_arn,
status,
sync_schedule,
tags,
type,
updated_at,
vpc_configuration
FROM awscc.qbusiness.data_sources
WHERE
region = '{{ region }}' AND
Identifier = '{{ application_id }}|{{ data_source_id }}|{{ index_id }}';
Lists all data_sources in a region.
SELECT
region,
application_id,
data_source_id,
index_id
FROM awscc.qbusiness.data_sources_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new data_source resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.qbusiness.data_sources (
ApplicationId,
Configuration,
DisplayName,
IndexId,
region
)
SELECT
'{{ application_id }}',
'{{ configuration }}',
'{{ display_name }}',
'{{ index_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.qbusiness.data_sources (
ApplicationId,
Configuration,
Description,
DisplayName,
DocumentEnrichmentConfiguration,
MediaExtractionConfiguration,
IndexId,
RoleArn,
SyncSchedule,
Tags,
VpcConfiguration,
region
)
SELECT
'{{ application_id }}',
'{{ configuration }}',
'{{ description }}',
'{{ display_name }}',
'{{ document_enrichment_configuration }}',
'{{ media_extraction_configuration }}',
'{{ index_id }}',
'{{ role_arn }}',
'{{ sync_schedule }}',
'{{ tags }}',
'{{ vpc_configuration }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: data_source
props:
- name: application_id
value: '{{ application_id }}'
- name: configuration
value: null
- name: description
value: '{{ description }}'
- name: display_name
value: '{{ display_name }}'
- name: document_enrichment_configuration
value:
inline_configurations:
- condition:
key: '{{ key }}'
operator: '{{ operator }}'
value: null
target:
key: '{{ key }}'
value: null
attribute_value_operator: '{{ attribute_value_operator }}'
document_content_operator: '{{ document_content_operator }}'
pre_extraction_hook_configuration:
invocation_condition: null
lambda_arn: '{{ lambda_arn }}'
s3_bucket_name: '{{ s3_bucket_name }}'
role_arn: '{{ role_arn }}'
post_extraction_hook_configuration: null
- name: media_extraction_configuration
value:
image_extraction_configuration:
image_extraction_status: '{{ image_extraction_status }}'
audio_extraction_configuration:
audio_extraction_status: '{{ audio_extraction_status }}'
video_extraction_configuration:
video_extraction_status: '{{ video_extraction_status }}'
- name: index_id
value: '{{ index_id }}'
- name: role_arn
value: '{{ role_arn }}'
- name: sync_schedule
value: '{{ sync_schedule }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: vpc_configuration
value:
subnet_ids:
- '{{ subnet_ids[0] }}'
security_group_ids:
- '{{ security_group_ids[0] }}'
UPDATE example
Use the following StackQL query and manifest file to update a data_source resource, using stack-deploy.
/*+ update */
UPDATE awscc.qbusiness.data_sources
SET PatchDocument = string('{{ {
"Configuration": configuration,
"Description": description,
"DisplayName": display_name,
"DocumentEnrichmentConfiguration": document_enrichment_configuration,
"MediaExtractionConfiguration": media_extraction_configuration,
"RoleArn": role_arn,
"SyncSchedule": sync_schedule,
"Tags": tags,
"VpcConfiguration": vpc_configuration
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ application_id }}|{{ data_source_id }}|{{ index_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.qbusiness.data_sources
WHERE
Identifier = '{{ application_id }}|{{ data_source_id }}|{{ index_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the data_sources resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iam:PassRole,
qbusiness:CreateDataSource,
qbusiness:GetDataSource,
qbusiness:ListTagsForResource,
qbusiness:TagResource
qbusiness:GetDataSource,
qbusiness:ListTagsForResource
iam:PassRole,
qbusiness:GetDataSource,
qbusiness:ListTagsForResource,
qbusiness:TagResource,
qbusiness:UntagResource,
qbusiness:UpdateDataSource
qbusiness:DeleteDataSource,
qbusiness:GetDataSource
qbusiness:ListDataSources