AWS::Personalize::Schema - AWS CloudFormation

AWS::Personalize::Schema

Creates an Amazon Personalize schema from the specified schema string. The schema you create must be in Avro JSON format.

Amazon Personalize recognizes three schema variants. Each schema is associated with a dataset type and has a set of required field and keywords. If you are creating a schema for a dataset in a Domain dataset group, you provide the domain of the Domain dataset group. You specify a schema when you call CreateDataset.

For more information on schemas, see Datasets and schemas.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Personalize::Schema", "Properties" : { "Domain" : String, "Name" : String, "Schema" : String } }

YAML

Type: AWS::Personalize::Schema Properties: Domain: String Name: String Schema: String

Properties

Domain

The domain of a schema that you created for a dataset in a Domain dataset group.

Required: No

Type: String

Allowed values: ECOMMERCE | VIDEO_ON_DEMAND

Update requires: Replacement

Name

The name of the schema.

Required: Yes

Type: String

Pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*

Minimum: 1

Maximum: 63

Update requires: Replacement

Schema

The schema.

Required: Yes

Type: String

Maximum: 10000

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the name of the resource.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

SchemaArn

The Amazon Resource Name (ARN) of the schema.

Examples

Creating a schema

The following example creates an Amazon Personalize schema for an Interactions dataset.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "MySchema": { "Type": "AWS::Personalize::Schema", "Properties": { "Name": "my-schema-name", "Schema": "{\"type\": \"record\",\"name\": \"Interactions\", \"namespace\": \"com.amazonaws.personalize.schema\", \"fields\": [ { \"name\": \"USER_ID\", \"type\": \"string\" }, { \"name\": \"ITEM_ID\", \"type\": \"string\" }, { \"name\": \"TIMESTAMP\", \"type\": \"long\"}], \"version\": \"1.0\"}" } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: MySchema: Type: AWS::Personalize::Schema Properties: Name: "my-schema-name" Schema: >- {"type": "record","name": "Interactions", "namespace": "com.amazonaws.personalize.schema", "fields": [ { "name": "USER_ID", "type": "string" }, { "name": "ITEM_ID", "type": "string" }, { "name": "TIMESTAMP", "type": "long"}], "version": "1.0"}