我正在使用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