schema_mappings
Creates, updates, deletes, gets or lists a schema_mappings resource.
Overview
| Name | schema_mappings |
| Type | Resource |
| Id | aws.entityresolution.schema_mappings |
Fields
The following fields are returned by SELECT queries:
- get_schema_mapping
- list_schema_mappings
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The timestamp of when the SchemaMapping was created. |
description | string | A description of the schema. |
has_workflows | boolean | Specifies whether the schema mapping has been applied to a workflow. |
mapped_input_fields | array | A list of MappedInputFields. Each MappedInputField corresponds to a column the source data table, and contains column name plus additional information Entity Resolution uses for matching. |
schema_arn | string | The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping. (pattern: <code>arn:(aws|aws-us-gov|aws-cn):entityresolution:[a-z]{2}-[a-z]{1,10}-[0-9]:[0-9]{12}:(schemamapping/[a-zA-Z_0-9-]{1,255})</code>) |
schema_name | string | The name of the schema. (pattern: <code>[a-zA-Z_0-9-]*</code>) |
tags | object | The tags used to organize, track, or control access for this resource. |
updated_at | string (date-time) | The timestamp of when the SchemaMapping was last updated. |
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The timestamp of when the SchemaMapping was created. |
has_workflows | boolean | Specifies whether the schema mapping has been applied to a workflow. |
schema_arn | string | The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping. (pattern: <code>arn:(aws|aws-us-gov|aws-cn):entityresolution:[a-z]{2}-[a-z]{1,10}-[0-9]:[0-9]{12}:(schemamapping/[a-zA-Z_0-9-]{1,255})</code>) |
schema_name | string | The name of the schema. (pattern: <code>[a-zA-Z_0-9-]*</code>) |
updated_at | string (date-time) | The timestamp of when the SchemaMapping was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_schema_mapping | select | schema_name, region | Returns the SchemaMapping of a given name. | |
list_schema_mappings | select | region | nextToken, maxResults | Returns a list of all the SchemaMappings that have been created for an Amazon Web Services account. |
create_schema_mapping | insert | region, schemaName, mappedInputFields | Creates a schema mapping, which defines the schema of the input customer records table. The SchemaMapping also provides Entity Resolution with some metadata about the table, such as the attribute types of the columns and which columns to match on. | |
update_schema_mapping | update | schema_name, region, mappedInputFields | Updates a schema mapping. A schema is immutable if it is being used by a workflow. Therefore, you can't update a schema mapping if it's associated with a workflow. | |
delete_schema_mapping | delete | schema_name, region | Deletes the SchemaMapping with a given name. This operation returns a ResourceNotFoundException if a schema with the given name does not exist. This operation will fail if there is a MatchingWorkflow object that references the SchemaMapping in the workflow's InputSourceConfig. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
schema_name | string | The name of the schema to delete. |
maxResults | integer | The maximum number of objects returned per page. |
nextToken | string | The pagination token from the previous API call. |
SELECT examples
- get_schema_mapping
- list_schema_mappings
Returns the SchemaMapping of a given name.
SELECT
created_at,
description,
has_workflows,
mapped_input_fields,
schema_arn,
schema_name,
tags,
updated_at
FROM aws.entityresolution.schema_mappings
WHERE schema_name = '{{ schema_name }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of all the SchemaMappings that have been created for an Amazon Web Services account.
SELECT
created_at,
has_workflows,
schema_arn,
schema_name,
updated_at
FROM aws.entityresolution.schema_mappings
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_schema_mapping
- Manifest
Creates a schema mapping, which defines the schema of the input customer records table. The SchemaMapping also provides Entity Resolution with some metadata about the table, such as the attribute types of the columns and which columns to match on.
INSERT INTO aws.entityresolution.schema_mappings (
schemaName,
description,
mappedInputFields,
tags,
region
)
SELECT
'{{ schemaName }}' /* required */,
'{{ description }}',
'{{ mappedInputFields }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
description,
mapped_input_fields,
schema_arn,
schema_name
;
# Description fields are for documentation purposes
- name: schema_mappings
props:
- name: region
value: "{{ region }}"
description: Required parameter for the schema_mappings resource.
- name: schemaName
value: "{{ schemaName }}"
- name: description
value: "{{ description }}"
- name: mappedInputFields
value:
- fieldName: "{{ fieldName }}"
type_: "{{ type_ }}"
groupName: "{{ groupName }}"
matchKey: "{{ matchKey }}"
subType: "{{ subType }}"
hashed: {{ hashed }}
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_schema_mapping
Updates a schema mapping. A schema is immutable if it is being used by a workflow. Therefore, you can't update a schema mapping if it's associated with a workflow.
UPDATE aws.entityresolution.schema_mappings
SET
description = '{{ description }}',
mappedInputFields = '{{ mappedInputFields }}'
WHERE
schema_name = '{{ schema_name }}' --required
AND region = '{{ region }}' --required
AND mappedInputFields = '{{ mappedInputFields }}' --required
RETURNING
description,
mapped_input_fields,
schema_arn,
schema_name;
DELETE examples
- delete_schema_mapping
Deletes the SchemaMapping with a given name. This operation returns a ResourceNotFoundException if a schema with the given name does not exist. This operation will fail if there is a MatchingWorkflow object that references the SchemaMapping in the workflow's InputSourceConfig.
DELETE FROM aws.entityresolution.schema_mappings
WHERE schema_name = '{{ schema_name }}' --required
AND region = '{{ region }}' --required
;