From 97f05c2e54cef0326f25103332ce5d9031d901b7 Mon Sep 17 00:00:00 2001 From: Christoffer Rehn <1280602+hoffa@users.noreply.github.com> Date: Fri, 3 Feb 2023 15:46:48 -0800 Subject: [PATCH] fix(schema): support Alexa::* docs --- bin/add_docs_cfn_schema.py | 5 ++-- samtranslator/schema/schema.json | 30 +++++++++++++++++++++--- schema_source/cloudformation.schema.json | 30 +++++++++++++++++++++--- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/bin/add_docs_cfn_schema.py b/bin/add_docs_cfn_schema.py index 751f4c9258..958768717c 100644 --- a/bin/add_docs_cfn_schema.py +++ b/bin/add_docs_cfn_schema.py @@ -4,6 +4,7 @@ import argparse import json +import re import sys from pathlib import Path @@ -34,8 +35,8 @@ def main() -> None: # Assumes schema is from GoFormation and has consistent structure # TODO: Use a more generic walk for def_name, def_schema in schema["definitions"].items(): - if not def_name.startswith("AWS::"): - log(f"Skipping {def_name}: does not start with AWS::") + if not re.match(r"^\w+::\w+::\w+(.\w+)?$", def_name): + log(f"Skipping {def_name}: not expected format") continue # If e.g. AWS::S3::Bucket, we only look under Properties # TODO: Support resource attributes et al. diff --git a/samtranslator/schema/schema.json b/samtranslator/schema/schema.json index ffa17aeb09..65c144fe82 100644 --- a/samtranslator/schema/schema.json +++ b/samtranslator/schema/schema.json @@ -184482,12 +184482,18 @@ "additionalProperties": false, "properties": { "AuthenticationConfiguration": { - "$ref": "#/definitions/Alexa::ASK::Skill.AuthenticationConfiguration" + "$ref": "#/definitions/Alexa::ASK::Skill.AuthenticationConfiguration", + "markdownDescription": "Login with Amazon \\(LWA\\) configuration used to authenticate with the Alexa service\\. Only Login with Amazon clients created through the [Amazon Developer Console](https://developer.amazon.com/lwa/sp/overview.html) are supported\\. The client ID, client secret, and refresh token are required\\. \n*Required*: Yes \n*Type*: [AuthenticationConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-authenticationconfiguration.html) \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "AuthenticationConfiguration" }, "SkillPackage": { - "$ref": "#/definitions/Alexa::ASK::Skill.SkillPackage" + "$ref": "#/definitions/Alexa::ASK::Skill.SkillPackage", + "markdownDescription": "Configuration for the skill package that contains the components of the Alexa skill\\. Skill packages are retrieved from an Amazon S3 bucket and key and used to create and update the skill\\. For more information about the skill package format, see the [Skill Package API Reference](https://developer.amazon.com/docs/smapi/skill-package-api-reference.html#skill-package-format)\\. \n*Required*: Yes \n*Type*: [SkillPackage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-skillpackage.html) \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "SkillPackage" }, "VendorId": { + "markdownDescription": "The vendor ID associated with the Amazon developer account that will host the skill\\. Details for retrieving the vendor ID are in [How to get your vendor ID](https://github.com/alexa/alexa-smarthome/wiki/How-to-get-your-vendor-ID)\\. The provided LWA credentials must be linked to the developer account associated with this vendor ID\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)", + "title": "VendorId", "type": "string" } }, @@ -184523,12 +184529,18 @@ "additionalProperties": false, "properties": { "ClientId": { + "markdownDescription": "Client ID from Login with Amazon \\(LWA\\)\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "ClientId", "type": "string" }, "ClientSecret": { + "markdownDescription": "Client secret from Login with Amazon \\(LWA\\)\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "ClientSecret", "type": "string" }, "RefreshToken": { + "markdownDescription": "Refresh token from Login with Amazon \\(LWA\\)\\. This token is secret\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "RefreshToken", "type": "string" } }, @@ -184543,6 +184555,8 @@ "additionalProperties": false, "properties": { "Manifest": { + "markdownDescription": "Overrides to apply to the skill manifest inside of the skill package\\. The skill manifest contains metadata about the skill\\. For more information, see [Skill Manifest Schemas](https://developer.amazon.com/docs/smapi/skill-manifest.html)\\. \n*Required*: No \n*Type*: Json \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "Manifest", "type": "object" } }, @@ -184552,18 +184566,28 @@ "additionalProperties": false, "properties": { "Overrides": { - "$ref": "#/definitions/Alexa::ASK::Skill.Overrides" + "$ref": "#/definitions/Alexa::ASK::Skill.Overrides", + "markdownDescription": "Overrides to the skill package to apply when creating or updating the skill\\. Values provided here do not modify the contents of the original skill package\\. Currently, only overriding values inside of the skill manifest component of the package is supported\\. \n*Required*: No \n*Type*: [Overrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-overrides.html) \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "Overrides" }, "S3Bucket": { + "markdownDescription": "The name of the Amazon S3 bucket where the \\.zip file that contains the skill package is stored\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3Bucket", "type": "string" }, "S3BucketRole": { + "markdownDescription": "ARN of the IAM role that grants the Alexa service \\(`alexa-appkit.amazon.com`\\) permission to access the bucket and retrieve the skill package\\. This property is optional\\. If you do not provide it, the bucket must be publicly accessible or configured with a policy that allows this access\\. Otherwise, AWS CloudFormation cannot create the skill\\. \n*Required*: No \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3BucketRole", "type": "string" }, "S3Key": { + "markdownDescription": "The location and name of the skill package \\.zip file\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3Key", "type": "string" }, "S3ObjectVersion": { + "markdownDescription": "If you have S3 versioning enabled, the version ID of the skill package\\.zip file\\. \n*Required*: No \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3ObjectVersion", "type": "string" } }, diff --git a/schema_source/cloudformation.schema.json b/schema_source/cloudformation.schema.json index 90b6e0d875..590c7b15b3 100644 --- a/schema_source/cloudformation.schema.json +++ b/schema_source/cloudformation.schema.json @@ -184482,12 +184482,18 @@ "additionalProperties": false, "properties": { "AuthenticationConfiguration": { - "$ref": "#/definitions/Alexa::ASK::Skill.AuthenticationConfiguration" + "$ref": "#/definitions/Alexa::ASK::Skill.AuthenticationConfiguration", + "markdownDescription": "Login with Amazon \\(LWA\\) configuration used to authenticate with the Alexa service\\. Only Login with Amazon clients created through the [Amazon Developer Console](https://developer.amazon.com/lwa/sp/overview.html) are supported\\. The client ID, client secret, and refresh token are required\\. \n*Required*: Yes \n*Type*: [AuthenticationConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-authenticationconfiguration.html) \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "AuthenticationConfiguration" }, "SkillPackage": { - "$ref": "#/definitions/Alexa::ASK::Skill.SkillPackage" + "$ref": "#/definitions/Alexa::ASK::Skill.SkillPackage", + "markdownDescription": "Configuration for the skill package that contains the components of the Alexa skill\\. Skill packages are retrieved from an Amazon S3 bucket and key and used to create and update the skill\\. For more information about the skill package format, see the [Skill Package API Reference](https://developer.amazon.com/docs/smapi/skill-package-api-reference.html#skill-package-format)\\. \n*Required*: Yes \n*Type*: [SkillPackage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-skillpackage.html) \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "SkillPackage" }, "VendorId": { + "markdownDescription": "The vendor ID associated with the Amazon developer account that will host the skill\\. Details for retrieving the vendor ID are in [How to get your vendor ID](https://github.com/alexa/alexa-smarthome/wiki/How-to-get-your-vendor-ID)\\. The provided LWA credentials must be linked to the developer account associated with this vendor ID\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)", + "title": "VendorId", "type": "string" } }, @@ -184523,12 +184529,18 @@ "additionalProperties": false, "properties": { "ClientId": { + "markdownDescription": "Client ID from Login with Amazon \\(LWA\\)\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "ClientId", "type": "string" }, "ClientSecret": { + "markdownDescription": "Client secret from Login with Amazon \\(LWA\\)\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "ClientSecret", "type": "string" }, "RefreshToken": { + "markdownDescription": "Refresh token from Login with Amazon \\(LWA\\)\\. This token is secret\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "RefreshToken", "type": "string" } }, @@ -184543,6 +184555,8 @@ "additionalProperties": false, "properties": { "Manifest": { + "markdownDescription": "Overrides to apply to the skill manifest inside of the skill package\\. The skill manifest contains metadata about the skill\\. For more information, see [Skill Manifest Schemas](https://developer.amazon.com/docs/smapi/skill-manifest.html)\\. \n*Required*: No \n*Type*: Json \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "Manifest", "type": "object" } }, @@ -184552,18 +184566,28 @@ "additionalProperties": false, "properties": { "Overrides": { - "$ref": "#/definitions/Alexa::ASK::Skill.Overrides" + "$ref": "#/definitions/Alexa::ASK::Skill.Overrides", + "markdownDescription": "Overrides to the skill package to apply when creating or updating the skill\\. Values provided here do not modify the contents of the original skill package\\. Currently, only overriding values inside of the skill manifest component of the package is supported\\. \n*Required*: No \n*Type*: [Overrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-overrides.html) \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "Overrides" }, "S3Bucket": { + "markdownDescription": "The name of the Amazon S3 bucket where the \\.zip file that contains the skill package is stored\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3Bucket", "type": "string" }, "S3BucketRole": { + "markdownDescription": "ARN of the IAM role that grants the Alexa service \\(`alexa-appkit.amazon.com`\\) permission to access the bucket and retrieve the skill package\\. This property is optional\\. If you do not provide it, the bucket must be publicly accessible or configured with a policy that allows this access\\. Otherwise, AWS CloudFormation cannot create the skill\\. \n*Required*: No \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3BucketRole", "type": "string" }, "S3Key": { + "markdownDescription": "The location and name of the skill package \\.zip file\\. \n*Required*: Yes \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3Key", "type": "string" }, "S3ObjectVersion": { + "markdownDescription": "If you have S3 versioning enabled, the version ID of the skill package\\.zip file\\. \n*Required*: No \n*Type*: String \n*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)", + "title": "S3ObjectVersion", "type": "string" } },