Cloudformation Template - Amazon Lex Voice Setting Engine

0

Hello,

Is there a way to set the Polly voice setting to either "neural" or "standard" using the Cloudformation template to create a Lex bot?

Documentation for Cloudformation which is missing the Engine keyword: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lex-bot-voicesettings.html

From what I have seem, it looks like an omission on the Cloudformation side. In the Lex Console, we can set any voice to be either standard or neural. When we download the bot, we can see that there is a keyword for the engine: ""voiceSettings":{"engine":"neural","voiceId":"Ivy"}". Only Cloudformation is missing that engine setting. Unfortunately, it seems to always default to the standard voice. I tried adding in the Engine keyword in my CFN template just to see if it was working but not documented, unfortunately, it is not the case; it doesn't work.

Let me know if I am missing anything.

Thanks,

John
已提问 2 年前303 查看次数
1 回答
1
已接受的回答

Hi, Know you asked this 3mo ago and likely moved on, but answering in case others have the same question.

You're correct that the CFT support for Lex does not currently do anything with the 'Engine' property passed as part of the 'VoiceSettings'' property in a AWS::Lex::Bot resource. Behind the scenes, the AWS::Lex::Bot resource will result in an API call to create_bot_locale:

response = client.create_bot_locale(
    botId='string',
    botVersion='string',
    localeId='string',
    description='string',
    nluIntentConfidenceThreshold=123.0,
    voiceSettings={
        'voiceId': 'string',
        'engine': 'standard'|'neural'
    }
)

Because the 'engine' property is not honored, the value defaults to 'standard' in the API call.

I submitted a feature request but in the meantime, you can create a lambda custom resource or a CloudFormation resource type to overcome this. Your custom resource type would take in the same parameters currently passed in AWS::Lex::Bot and make a call to create_bot_locale API including the voiceSettings.engine property value which you would set to 'neural' in your template. Creating the Lambda custom resource is pretty trivial but you would need to support the update and delete cases as well. See docs for Lambda-backed Custom Resources, or the newer preferred mechanism, CloudFormation Registry Resource Types.

AWS
Scott_K
已回答 1 年前
  • Hello,

    Sorry for not closing the question. It was made available around a month or two ago in the CFN templates. I never had to use the APIs directly, so I never encountered this problem, but for the sake of the product growth, thanks for making this enhancement request.

    Thanks,

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则