Skip to main content

q_apps

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

Overview

Nameq_apps
TypeResource
Idaws.qapps.q_apps

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
app_arnstringThe Amazon Resource Name (ARN) of the Q App.
app_definitionobjectThe full definition of the Q App, specifying the cards and flow.
app_idstringThe unique identifier of the Q App. (pattern: <code>[\da-f]{8}-[\da-f]{4}-[45][\da-f]{3}-[89ABab][\da-f]{3}-[\da-f]{12}</code>)
app_versionintegerThe version of the Q App.
created_atstring (date-time)The date and time the Q App was created.
created_bystringThe user who created the Q App.
descriptionstringThe description of the Q App.
initial_promptstringThe initial prompt displayed when the Q App is started.
required_capabilitiesarrayThe capabilities required to run the Q App, such as file upload or third-party integrations.
statusstringThe status of the Q App. (PUBLISHED, DRAFT, DELETED)
title_stringThe title of the Q App. (pattern: <code>[^{}\"<>]+</code>)
updated_atstring (date-time)The date and time the Q App was last updated.
updated_bystringThe user who last updated the Q App.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_q_appselectinstance-id, appId, regionappVersionRetrieves the full details of an Q App, including its definition specifying the cards and flow.
list_q_appsselectinstance-id, regionlimit, nextTokenLists the Amazon Q Apps owned by or associated with the user either because they created it or because they used it from the library in the past. The user identity is extracted from the credentials used to invoke this operation..
create_q_appinsertinstance-id, region, title, appDefinitionCreates a new Amazon Q App based on the provided definition. The Q App definition specifies the cards and flow of the Q App. This operation also calculates the dependencies between the cards by inspecting the references in the prompts.
update_q_appupdateinstance-id, region, appIdUpdates an existing Amazon Q App, allowing modifications to its title, description, and definition.
delete_q_appdeleteinstance-id, regionDeletes an Amazon Q App owned by the user. If the Q App was previously published to the library, it is also removed from the library.
associate_q_app_with_userexecinstance-id, region, appIdThis operation creates a link between the user's identity calling the operation and a specific Q App. This is useful to mark the Q App as a favorite for the user if the user doesn't own the Amazon Q App so they can still run it and see it in their inventory of Q Apps.
disassociate_q_app_from_userexecinstance-id, region, appIdDisassociates a Q App from a user removing the user's access to run the Q App.
start_q_app_sessionexecinstance-id, region, appId, appVersionStarts a new session for an Amazon Q App, allowing inputs to be provided and the app to be run. Each Q App session will be condensed into a single conversation in the web experience.
stop_q_app_sessionexecinstance-id, region, sessionIdStops an active session for an Amazon Q App.This deletes all data related to the session and makes it invalid for future uses. The results of the session will be persisted as part of the conversation.

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
appIdstringThe unique identifier of the Q App to retrieve.
instance-idstringThe unique identifier of the Amazon Q Business application environment instance.
regionstringAWS region (default: us-east-1)
appVersionintegerThe version of the Q App.
limitintegerThe maximum number of Q Apps to return in the response.
nextTokenstringThe token to request the next page of results.

SELECT examples

Retrieves the full details of an Q App, including its definition specifying the cards and flow.

SELECT
app_arn,
app_definition,
app_id,
app_version,
created_at,
created_by,
description,
initial_prompt,
required_capabilities,
status,
title_,
updated_at,
updated_by
FROM aws.qapps.q_apps
WHERE `instance-id` = '{{ instance-id }}' -- required
AND appId = '{{ appId }}' -- required
AND region = '{{ region }}' -- required
AND appVersion = '{{ appVersion }}'
;

INSERT examples

Creates a new Amazon Q App based on the provided definition. The Q App definition specifies the cards and flow of the Q App. This operation also calculates the dependencies between the cards by inspecting the references in the prompts.

INSERT INTO aws.qapps.q_apps (
title,
description,
appDefinition,
tags,
`instance-id`,
region
)
SELECT
'{{ title }}' /* required */,
'{{ description }}',
'{{ appDefinition }}' /* required */,
'{{ tags }}',
'{{ instance-id }}',
'{{ region }}'
RETURNING
app_arn,
app_id,
app_version,
created_at,
created_by,
description,
initial_prompt,
required_capabilities,
status,
title_,
updated_at,
updated_by
;

UPDATE examples

Updates an existing Amazon Q App, allowing modifications to its title, description, and definition.

UPDATE aws.qapps.q_apps
SET
appId = '{{ appId }}',
title = '{{ title }}',
description = '{{ description }}',
appDefinition = '{{ appDefinition }}'
WHERE
`instance-id` = '{{ instance-id }}' --required
AND region = '{{ region }}' --required
AND appId = '{{ appId }}' --required
RETURNING
app_arn,
app_id,
app_version,
created_at,
created_by,
description,
initial_prompt,
required_capabilities,
status,
title_,
updated_at,
updated_by;

DELETE examples

Deletes an Amazon Q App owned by the user. If the Q App was previously published to the library, it is also removed from the library.

DELETE FROM aws.qapps.q_apps
WHERE `instance-id` = '{{ instance-id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

This operation creates a link between the user's identity calling the operation and a specific Q App. This is useful to mark the Q App as a favorite for the user if the user doesn't own the Amazon Q App so they can still run it and see it in their inventory of Q Apps.

EXEC aws.qapps.q_apps.associate_q_app_with_user
@instance-id='{{ instance-id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"appId": "{{ appId }}"
}'
;