In Amazon Personalize, I'm having issues creating a Dataset of Actions and Action Interactions using Cloud Formation.
The template I'm using looks something like this:
{
"Resources": {
"sapersonalizedatasetgroup": {
"Type": "AWS::Personalize::DatasetGroup",
"Properties": {
"Name": "sa_personalize"
},
"Metadata": {
"aws:cdk:path": "SaPersonalizeStack/sa_personalize_datasetgroup"
}
},
"sapersonalizeactionsschema": {
"Type": "AWS::Personalize::Schema",
"Properties": {
"Name": "sa_personalize_actions",
"Schema": "{\"type\": \"record\", \"name\": \"Actions\", \"namespace\": \"com.amazonaws.personalize.schema\", \"fields\": [{\"name\": \"ACTION_ID\", \"type\": \"string\"}, {\"name\": \"VALUE\", \"type\": [\"null\", \"long\"]}, {\"name\": \"MEMBERSHIP_LEVEL\", \"type\": [\"null\", \"string\"], \"categorical\": true}, {\"name\": \"CREATION_TIMESTAMP\", \"type\": \"long\"}, {\"name\": \"REPEAT_FREQUENCY\", \"type\": [\"long\", \"null\"]}], \"version\": \"1.0\"}"
},
"Metadata": {
"aws:cdk:path": "SaPersonalizeStack/sa_personalize_actions_schema"
}
},
"sapersonalizeinteractionsschema": {
"Type": "AWS::Personalize::Schema",
"Properties": {
"Name": "sa_personalize_interactions",
"Schema": "{\"type\": \"record\", \"name\": \"Interactions\", \"namespace\": \"com.amazonaws.personalize.schema\", \"fields\": [{\"name\": \"USER_ID\", \"type\": \"string\"}, {\"name\": \"ITEM_ID\", \"type\": \"string\"}, {\"name\": \"EVENT_TYPE\", \"type\": \"string\"}, {\"name\": \"EVENT_VALUE\", \"type\": [\"float\", \"null\"]}, {\"name\": \"LOCATION\", \"type\": \"string\", \"categorical\": true}, {\"name\": \"DEVICE\", \"type\": [\"string\", \"null\"], \"categorical\": true}, {\"name\": \"TIMESTAMP\", \"type\": \"long\"}, {\"name\": \"IMPRESSION\", \"type\": \"string\"}], \"version\": \"1.0\"}"
},
"Metadata": {
"aws:cdk:path": "SaPersonalizeStack/sa_personalize_interactions_schema"
}
},
"sapersonalizeactioninteractionsschema": {
"Type": "AWS::Personalize::Schema",
"Properties": {
"Name": "sa_personalize_actioninteractions",
"Schema": "{\"type\": \"record\", \"name\": \"ActionInteractions\", \"namespace\": \"com.amazonaws.personalize.schema\", \"fields\": [{\"name\": \"USER_ID\", \"type\": \"string\"}, {\"name\": \"ACTION_ID\", \"type\": \"string\"}, {\"name\": \"EVENT_TYPE\", \"type\": \"string\"}, {\"name\": \"TIMESTAMP\", \"type\": \"long\"}], \"version\": \"1.0\"}"
},
"Metadata": {
"aws:cdk:path": "SaPersonalizeStack/sa_personalize_actioninteractions_schema"
}
},
"sapersonalizeactionsdataset": {
"Type": "AWS::Personalize::Dataset",
"Properties": {
"DatasetGroupArn": {
"Fn::GetAtt": [
"sapersonalizedatasetgroup",
"DatasetGroupArn"
]
},
"DatasetType": "Actions",
"Name": "sa_personalize_actions",
"SchemaArn": {
"Fn::GetAtt": ["sapersonalizeactionsschema", "SchemaArn"]
}
},
"Metadata": {
"aws:cdk:path": "SaPersonalizeStack/sa_personalize_actions_dataset"
}
},
"sapersonalizeinteractionsdataset": {
"Type": "AWS::Personalize::Dataset",
"Properties": {
"DatasetGroupArn": {
"Fn::GetAtt": [
"sapersonalizedatasetgroup",
"DatasetGroupArn"
]
},
"DatasetType": "Interactions",
"Name": "sa_personalize_interactions",
"SchemaArn": {
"Fn::GetAtt": [
"sapersonalizeinteractionsschema",
"SchemaArn"
]
}
},
"Metadata": {
"aws:cdk:path": "SaPersonalizeStack/sa_personalize_interactions_dataset"
}
},
"sapersonalizeactioninteractionsdataset": {
"Type": "AWS::Personalize::Dataset",
"Properties": {
"DatasetGroupArn": {
"Fn::GetAtt": [
"sapersonalizedatasetgroup",
"DatasetGroupArn"
]
},
"DatasetType": "Action_Interactions",
"Name": "sa_personalize_actioninteractions",
"SchemaArn": {
"Fn::GetAtt": [
"sapersonalizeactioninteractionsschema",
"SchemaArn"
]
}
},
"Metadata": {
"aws:cdk:path": "SaPersonalizeStack/sa_personalize_actioninteractions_dataset"
}
}
}
}
Despite the documentation saying that the DatasetType can have the following values:
Cloud Formation throws the following errors:
Properties validation failed for resource sapersonalizeactioninteractionsdataset with message: [#/DatasetType: Action_Interactions is not a valid enum value]
and
Properties validation failed for resource sapersonalizeactionsdataset with message: [#/DatasetType: Actions is not a valid enum value]
In the errors, it says that Actions and Action_Interactions are not valid enum values.
Is it not yet supported or am I missing something?
According to the registry schema, these are the allowed enum values:
"DatasetType": {
"description": "The type of dataset",
"type": "string",
"enum": [
"Interactions",
"Items",
"Users"
],
"maxLength": 256
},
I'll check to see what's up with the other values being displayed in the docs. This is definitely confusing.