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
답변함 일 년 전
  • 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,

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠