components
Creates, updates, deletes, gets or lists a components resource.
Overview
| Name | components |
| Type | Resource |
| Id | aws.amplifyuibuilder.components |
Fields
The following fields are returned by SELECT queries:
- get_component
- list_components
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the component. |
name | string | The name of the component. |
app_id | string | The unique ID of the Amplify app associated with the component. |
binding_properties | object | The information to connect a component's properties to data at runtime. You can't specify tags as a valid property for bindingProperties. |
children | array | A list of the component's ComponentChild instances. |
collection_properties | object | The data binding configuration for the component's properties. Use this for a collection component. You can't specify tags as a valid property for collectionProperties. |
component_type | string | The type of the component. This can be an Amplify custom UI component or another custom component. |
created_at | string (date-time) | The time that the component was created. |
environment_name | string | The name of the backend environment that is a part of the Amplify app. |
events | object | Describes the events that can be raised on the component. Use for the workflow feature in Amplify Studio that allows you to bind events and actions to components. |
modified_at | string (date-time) | The time that the component was modified. |
overrides | object | Describes the component's properties that can be overriden in a customized instance of the component. You can't specify tags as a valid property for overrides. |
properties_ | object | Describes the component's properties. You can't specify tags as a valid property for properties. |
schema_version | string | The schema version of the component when it was imported. |
source_id | string | The unique ID of the component in its original source system, such as Figma. |
tags | object | One or more key-value pairs to use when tagging the component. |
variants | array | A list of the component's variants. A variant is a unique style configuration of a main component. |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the component. |
name | string | The name of the component. |
app_id | string | The unique ID of the Amplify app associated with the component. |
component_type | string | The component type. |
environment_name | string | The name of the backend environment that is a part of the Amplify app. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_component | select | app_id, environment_name, id, region | Returns an existing component for an Amplify app. | |
list_components | select | app_id, environment_name, region | nextToken, maxResults | Retrieves a list of components for a specified Amplify app and backend environment. |
create_component | insert | app_id, environment_name, region, componentToCreate | clientToken | Creates a new component for an Amplify app. |
update_component | update | app_id, environment_name, id, region, updatedComponent | clientToken | Updates an existing component. |
delete_component | delete | app_id, environment_name, id, region | Deletes a component from an Amplify app. | |
export_components | exec | app_id, environment_name, region | nextToken | Exports component configurations to code that is ready to integrate into an Amplify app. |
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 unique ID of the Amplify app to export components to. |
environment_name | string | The name of the backend environment that is a part of the Amplify app. |
id | string | The unique ID of the component to delete. |
region | string | AWS region (default: us-east-1) |
clientToken | string | The unique client token. |
maxResults | integer | The maximum number of components to retrieve. |
nextToken | string | The token to request the next page of results. |
SELECT examples
- get_component
- list_components
Returns an existing component for an Amplify app.
SELECT
id,
name,
app_id,
binding_properties,
children,
collection_properties,
component_type,
created_at,
environment_name,
events,
modified_at,
overrides,
properties_,
schema_version,
source_id,
tags,
variants
FROM aws.amplifyuibuilder.components
WHERE app_id = '{{ app_id }}' -- required
AND environment_name = '{{ environment_name }}' -- required
AND id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;
Retrieves a list of components for a specified Amplify app and backend environment.
SELECT
id,
name,
app_id,
component_type,
environment_name
FROM aws.amplifyuibuilder.components
WHERE app_id = '{{ app_id }}' -- required
AND environment_name = '{{ environment_name }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_component
- Manifest
Creates a new component for an Amplify app.
INSERT INTO aws.amplifyuibuilder.components (
componentToCreate,
app_id,
environment_name,
region,
clientToken
)
SELECT
'{{ componentToCreate }}' /* required */,
'{{ app_id }}',
'{{ environment_name }}',
'{{ region }}',
'{{ clientToken }}'
RETURNING
entity
;
# Description fields are for documentation purposes
- name: components
props:
- name: app_id
value: "{{ app_id }}"
description: Required parameter for the components resource.
- name: environment_name
value: "{{ environment_name }}"
description: Required parameter for the components resource.
- name: region
value: "{{ region }}"
description: Required parameter for the components resource.
- name: componentToCreate
description: |
Represents all of the information that is required to create a component.
value:
name: "{{ name }}"
sourceId: "{{ sourceId }}"
componentType: "{{ componentType }}"
properties_: "{{ properties_ }}"
children:
- componentType: "{{ componentType }}"
name: "{{ name }}"
properties_: "{{ properties_ }}"
children: "{{ children }}"
events: "{{ events }}"
sourceId: "{{ sourceId }}"
variants:
- variantValues: "{{ variantValues }}"
overrides: "{{ overrides }}"
overrides: "{{ overrides }}"
bindingProperties: "{{ bindingProperties }}"
collectionProperties: "{{ collectionProperties }}"
tags: "{{ tags }}"
events: "{{ events }}"
schemaVersion: "{{ schemaVersion }}"
- name: clientToken
value: "{{ clientToken }}"
description: The unique client token.
description: The unique client token.
UPDATE examples
- update_component
Updates an existing component.
UPDATE aws.amplifyuibuilder.components
SET
updatedComponent = '{{ updatedComponent }}'
WHERE
app_id = '{{ app_id }}' --required
AND environment_name = '{{ environment_name }}' --required
AND id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND updatedComponent = '{{ updatedComponent }}' --required
AND clientToken = '{{ clientToken}}'
RETURNING
entity;
DELETE examples
- delete_component
Deletes a component from an Amplify app.
DELETE FROM aws.amplifyuibuilder.components
WHERE app_id = '{{ app_id }}' --required
AND environment_name = '{{ environment_name }}' --required
AND id = '{{ id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- export_components
Exports component configurations to code that is ready to integrate into an Amplify app.
EXEC aws.amplifyuibuilder.components.export_components
@app_id='{{ app_id }}' --required,
@environment_name='{{ environment_name }}' --required,
@region='{{ region }}' --required,
@nextToken='{{ nextToken }}'
;