tokens
Creates, updates, deletes, gets or lists a tokens resource.
Overview
| Name | tokens |
| Type | Resource |
| Id | aws.amplifybackend.tokens |
Fields
The following fields are returned by SELECT queries:
- get_token
| Name | Datatype | Description |
|---|---|---|
app_id | string | The app ID. |
challenge_code | string | The one-time challenge code for authenticating into the Amplify Admin UI. |
session_id | string | A unique ID provided when creating a new challenge token. |
ttl | string | The expiry time for the one-time generated token code. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_token | select | app_id, session_id, region | Gets the challenge token based on the given appId and sessionId. | |
create_token | insert | app_id, region | Generates a one-time challenge code to authenticate a user into your Amplify Admin UI. | |
delete_token | delete | app_id, session_id, region | Deletes the challenge token based on the given appId and sessionId. |
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 |
|---|---|---|
app_id | string | The app ID. |
region | string | AWS region (default: us-east-1) |
session_id | string | The session ID. |
SELECT examples
- get_token
Gets the challenge token based on the given appId and sessionId.
SELECT
app_id,
challenge_code,
session_id,
ttl
FROM aws.amplifybackend.tokens
WHERE app_id = '{{ app_id }}' -- required
AND session_id = '{{ session_id }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_token
- Manifest
Generates a one-time challenge code to authenticate a user into your Amplify Admin UI.
INSERT INTO aws.amplifybackend.tokens (
app_id,
region
)
SELECT
'{{ app_id }}',
'{{ region }}'
RETURNING
app_id,
challenge_code,
session_id,
ttl
;
# Description fields are for documentation purposes
- name: tokens
props:
- name: app_id
value: "{{ app_id }}"
description: Required parameter for the tokens resource.
- name: region
value: "{{ region }}"
description: Required parameter for the tokens resource.
DELETE examples
- delete_token
Deletes the challenge token based on the given appId and sessionId.
DELETE FROM aws.amplifybackend.tokens
WHERE app_id = '{{ app_id }}' --required
AND session_id = '{{ session_id }}' --required
AND region = '{{ region }}' --required
;