在“ identityPoolId”处检测到的验证错误未能满足约束条件

时间:2019-04-14 08:43:09

标签: amazon-web-services aws-api-gateway amazon-cognito aws-cli

我正在使用aws-api-gateway-cli-test测试API网关。通过cognito用户池对API进行了身份验证,出现错误:

1 validation error detected: Value 'eu-central-1_xxxxxxxx' at 'identityPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+

我不确定用于identityPoolId的值。我在哪里可以获得这些信息。

尝试使用arn:aws:cognito-idp:eu-central-1:xxxxxxxxxxx:userpool/eu-central-1_xxxxxxxxxx之类的ARN失败。格式为eu-central-1_xxxxxxxxxx的池ID也失败。

用法示例:

npx aws-api-gateway-cli-test \
--username='user' \
--password='password' \
--user-pool-id='eu-central-1_xxxxxxx' \
--app-client-id='xxxxxxxxxxxxxxxx' \
--cognito-region='eu-central-1' \
--identity-pool-id='eu-central-1_xxxxxxxx' \
--invoke-url='https://xxxxxx.execute-api.eu-central-1.amazonaws.com/prod/' \
--api-gateway-region='eu-central-1' \
--path-template='/xxxx/xxxxx' \
--method='POST' \
--body='{"foo":"bar","lorem":"ipsum"}'

导致

1 validation error detected: Value 'eu-central-1_xxxxxxx' at 'identityPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+

根据: https://github.com/AnomalyInnovations/aws-api-gateway-cli-test

1 个答案:

答案 0 :(得分:1)

您可以找到身份池ID,方法是转到身份池,选择您的身份池,然后单击编辑身份池。 enter image description here

您的身份池将采用以下格式:

  

us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx