AMAZON Lex在配置中缺少凭据

时间:2019-03-06 15:36:02

标签: javascript html amazon-web-services

我使用来自“ https://aws.amazon.com/tw/blogs/machine-learning/greetings-visitor-engage-your-web-users-with-amazon-lex/”的html代码,并将其修改为我的Amazon lex机器人。但是,总是发出“错误:配置中缺少凭据(请参阅控制台以获取详细信息)”。请告诉我应该在哪里纠正?谢谢。

    

gawk -v pattern="myRegex" '
    FNR == 1 {if ($0 ~ pattern) printf "%s\0", FILENAME; nextfile}
' *.csv | xargs -0 echo mv -t destination


https://docs.google.com/document/d/1MV05gMQMnZnIiO5NUeIv1rMLp5PYSuvMDAlBqFfc0jM/edit?usp=sharing

1 个答案:

答案 0 :(得分:0)

您必须配置Cognito才能取回AWS临时凭证。可以按照以下步骤进行操作:

// Initialize the Amazon Cognito credentials provider
    AWS.config.region = 'us-east-1'; // Region
    AWS.config.credentials = new AWS.CognitoIdentityCredentials({
    // Provide your Pool Id here
        IdentityPoolId: 'us-east-1:XXXXX',
    });

添加此内容后,就可以在浏览器端JavaScript客户端上使用lex应用程序。