types
Creates, updates, deletes, gets or lists a types resource.
Overview
| Name | types |
| Type | Resource |
| Id | aws.keyspaces.types |
Fields
The following fields are returned by SELECT queries:
- get_type
- list_types
| Name | Datatype | Description |
|---|---|---|
direct_parent_types | array | The types that use this type. |
direct_referring_tables | array | The tables that use this type. |
field_definitions | array | The names and types that define this type. |
keyspace_arn | string | The unique identifier of the keyspace that contains this type in the format of an Amazon Resource Name (ARN). (pattern: <code>arn:(aws[a-zA-Z0-9-]):cassandra:.+.</code>) |
keyspace_name | string | The name of the keyspace that contains this type. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_]{0,47}</code>) |
last_modified_timestamp | string (date-time) | The timestamp that shows when this type was last modified. |
max_nesting_depth | integer | The level of nesting implemented for this type. |
status | string | The status of this type. (ACTIVE, CREATING, DELETING, RESTORING) |
type_name | string | The name of the type. |
| Name | Datatype | Description |
|---|---|---|
type | string | The list of types contained in the specified keyspace. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_type | select | region | The GetType operation returns information about the type, for example the field definitions, the timestamp when the type was last modified, the level of nesting, the status, and details about if the type is used in other types and tables. To read keyspace metadata using GetType, the IAM principal needs Select action permissions for the system keyspace. To configure the required permissions, see Permissions to view a UDT in the Amazon Keyspaces Developer Guide. | |
list_types | select | region | The ListTypes operation returns a list of types for a specified keyspace. To read keyspace metadata using ListTypes, the IAM principal needs Select action permissions for the system keyspace. To configure the required permissions, see Permissions to view a UDT in the Amazon Keyspaces Developer Guide. | |
create_type | insert | region, keyspaceName, typeName, fieldDefinitions | The CreateType operation creates a new user-defined type in the specified keyspace. To configure the required permissions, see Permissions to create a UDT in the Amazon Keyspaces Developer Guide. For more information, see User-defined types (UDTs) in the Amazon Keyspaces Developer Guide. | |
delete_type | delete | region | The DeleteType operation deletes a user-defined type (UDT). You can only delete a type that is not used in a table or another UDT. To configure the required permissions, see Permissions to delete a UDT in the Amazon Keyspaces Developer Guide. |
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) |
SELECT examples
- get_type
- list_types
The GetType operation returns information about the type, for example the field definitions, the timestamp when the type was last modified, the level of nesting, the status, and details about if the type is used in other types and tables. To read keyspace metadata using GetType, the IAM principal needs Select action permissions for the system keyspace. To configure the required permissions, see Permissions to view a UDT in the Amazon Keyspaces Developer Guide.
SELECT
direct_parent_types,
direct_referring_tables,
field_definitions,
keyspace_arn,
keyspace_name,
last_modified_timestamp,
max_nesting_depth,
status,
type_name
FROM aws.keyspaces.types
WHERE region = '{{ region }}' -- required
;
The ListTypes operation returns a list of types for a specified keyspace. To read keyspace metadata using ListTypes, the IAM principal needs Select action permissions for the system keyspace. To configure the required permissions, see Permissions to view a UDT in the Amazon Keyspaces Developer Guide.
SELECT
type
FROM aws.keyspaces.types
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_type
- Manifest
The CreateType operation creates a new user-defined type in the specified keyspace. To configure the required permissions, see Permissions to create a UDT in the Amazon Keyspaces Developer Guide. For more information, see User-defined types (UDTs) in the Amazon Keyspaces Developer Guide.
INSERT INTO aws.keyspaces.types (
keyspaceName,
typeName,
fieldDefinitions,
region
)
SELECT
'{{ keyspaceName }}' /* required */,
'{{ typeName }}' /* required */,
'{{ fieldDefinitions }}' /* required */,
'{{ region }}'
RETURNING
keyspace_arn,
type_name
;
# Description fields are for documentation purposes
- name: types
props:
- name: region
value: "{{ region }}"
description: Required parameter for the types resource.
- name: keyspaceName
value: "{{ keyspaceName }}"
description: |
The name of the keyspace.
- name: typeName
value: "{{ typeName }}"
description: |
The name of the user-defined type. UDT names must contain 48 characters or less, must begin with an alphabetic character, and can only contain alpha-numeric characters and underscores. Amazon Keyspaces converts upper case characters automatically into lower case characters. Alternatively, you can declare a UDT name in double quotes. When declaring a UDT name inside double quotes, Amazon Keyspaces preserves upper casing and allows special characters. You can also use double quotes as part of the name when you create the UDT, but you must escape each double quote character with an additional double quote character.
- name: fieldDefinitions
description: |
The field definitions, consisting of names and types, that define this type.
value:
- name: "{{ name }}"
type_: "{{ type_ }}"
DELETE examples
- delete_type
The DeleteType operation deletes a user-defined type (UDT). You can only delete a type that is not used in a table or another UDT. To configure the required permissions, see Permissions to delete a UDT in the Amazon Keyspaces Developer Guide.
DELETE FROM aws.keyspaces.types
WHERE region = '{{ region }}' --required
;