schemas
Creates, updates, deletes or gets a schema resource or lists schemas in a region
Overview
| Name | schemas |
| Type | Resource |
| Description | This resource represents a schema of Glue Schema Registry. |
| Id | awscc.glue.schemas |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | Amazon Resource Name for the Schema. |
registry | object | Identifier for the registry which the schema is part of. |
name | string | Name of the schema. |
description | string | A description of the schema. If description is not provided, there will not be any default value for this. |
data_format | string | Data format name to use for the schema. Accepted values: 'AVRO', 'JSON', 'PROTOBUF' |
compatibility | string | Compatibility setting for the schema. |
schema_definition | string | Definition for the initial schema version in plain-text. |
checkpoint_version | object | Specify checkpoint version for update. This is only required to update the Compatibility. |
tags | array | List of tags to tag the schema |
initial_schema_version_id | string | Represents the version ID associated with the initial schema version. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | Amazon Resource Name for the Schema. |
region | string | AWS region. |
For more information, see AWS::Glue::Schema.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | schemas | INSERT | Name, DataFormat, Compatibility, region |
delete_resource | schemas | DELETE | Identifier, region |
update_resource | schemas | UPDATE | Identifier, PatchDocument, region |
list_resources | schemas_list_only | SELECT | region |
get_resource | schemas | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual schema.
SELECT
region,
arn,
registry,
name,
description,
data_format,
compatibility,
schema_definition,
checkpoint_version,
tags,
initial_schema_version_id
FROM awscc.glue.schemas
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all schemas in a region.
SELECT
region,
arn
FROM awscc.glue.schemas_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new schema resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.glue.schemas (
Name,
DataFormat,
Compatibility,
region
)
SELECT
'{{ name }}',
'{{ data_format }}',
'{{ compatibility }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.glue.schemas (
Registry,
Name,
Description,
DataFormat,
Compatibility,
SchemaDefinition,
CheckpointVersion,
Tags,
region
)
SELECT
'{{ registry }}',
'{{ name }}',
'{{ description }}',
'{{ data_format }}',
'{{ compatibility }}',
'{{ schema_definition }}',
'{{ checkpoint_version }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: schema
props:
- name: registry
value:
name: '{{ name }}'
arn: '{{ arn }}'
- name: name
value: '{{ name }}'
- name: description
value: '{{ description }}'
- name: data_format
value: '{{ data_format }}'
- name: compatibility
value: '{{ compatibility }}'
- name: schema_definition
value: '{{ schema_definition }}'
- name: checkpoint_version
value:
is_latest: '{{ is_latest }}'
version_number: '{{ version_number }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a schema resource, using stack-deploy.
/*+ update */
UPDATE awscc.glue.schemas
SET PatchDocument = string('{{ {
"Description": description,
"Compatibility": compatibility,
"CheckpointVersion": checkpoint_version,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.glue.schemas
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the schemas resource, the following permissions are required:
- Create
- Read
- Delete
- Update
- List
glue:CreateSchema,
glue:TagResource
glue:GetSchemaVersion,
glue:GetSchema,
glue:GetTags
glue:DeleteSchema,
glue:GetSchema
glue:UpdateSchema,
glue:GetSchemaVersion,
glue:GetSchema,
glue:GetTags,
glue:TagResource,
glue:UntagResource
glue:ListSchemas