我正在使用aws-api-gateway-cli-test来测试API网关。 API通过cognito用户池进行身份验证,我收到错误消息:
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