Skip to main content

components

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

Overview

Namecomponents
TypeResource
Idaws.amplifyuibuilder.components

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique ID of the component.
namestringThe name of the component.
app_idstringThe unique ID of the Amplify app associated with the component.
binding_propertiesobjectThe information to connect a component's properties to data at runtime. You can't specify tags as a valid property for bindingProperties.
childrenarrayA list of the component's ComponentChild instances.
collection_propertiesobjectThe 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_typestringThe type of the component. This can be an Amplify custom UI component or another custom component.
created_atstring (date-time)The time that the component was created.
environment_namestringThe name of the backend environment that is a part of the Amplify app.
eventsobjectDescribes 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_atstring (date-time)The time that the component was modified.
overridesobjectDescribes 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_objectDescribes the component's properties. You can't specify tags as a valid property for properties.
schema_versionstringThe schema version of the component when it was imported.
source_idstringThe unique ID of the component in its original source system, such as Figma.
tagsobjectOne or more key-value pairs to use when tagging the component.
variantsarrayA list of the component's variants. A variant is a unique style configuration of a main component.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_componentselectapp_id, environment_name, id, regionReturns an existing component for an Amplify app.
list_componentsselectapp_id, environment_name, regionnextToken, maxResultsRetrieves a list of components for a specified Amplify app and backend environment.
create_componentinsertapp_id, environment_name, region, componentToCreateclientTokenCreates a new component for an Amplify app.
update_componentupdateapp_id, environment_name, id, region, updatedComponentclientTokenUpdates an existing component.
delete_componentdeleteapp_id, environment_name, id, regionDeletes a component from an Amplify app.
export_componentsexecapp_id, environment_name, regionnextTokenExports 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.

NameDatatypeDescription
app_idstringThe unique ID of the Amplify app to export components to.
environment_namestringThe name of the backend environment that is a part of the Amplify app.
idstringThe unique ID of the component to delete.
regionstringAWS region (default: us-east-1)
clientTokenstringThe unique client token.
maxResultsintegerThe maximum number of components to retrieve.
nextTokenstringThe token to request the next page of results.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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 }}'
;