微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在将策略分配给AWS函数以供用户组访问时出错

如何解决在将策略分配给AWS函数以供用户组访问时出错

我具有预注册功能,可以将用户添加用户组。我通过CLI添加策略以授权功能新用户池组,但是,出现以下错误

> Could not get policies for auth: userPoolGroups Policies cannot be
> added for auth TypeError: Cannot destructure property
> `serviceWalkthroughFilename` of 'undefined' or 'null'.
>     at Object.getPermissionPolicies (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/lib/provider-utils/awscloudformation/index.js:248:61)
>     at Object.keys.forEach.resourceName (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/lib/index.js:231:67)
>     at Array.forEach (<anonymous>)
>     at getPermissionPolicies (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/lib/index.js:226:37)
>     at Object.exports.askExecRolePermissionsQuestions (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/lib/provider-utils/awscloudformation/service-walkthroughs/execPermissionsWalkthrough.js:144:78)
>     at process._tickCallback (internal/process/next_tick.js:68:7)

https://github.com/aws-amplify/amplify-cli/issues/165 在这里,我发现放大功能尚未实现,他们建议添加策略以授权功能调用auth。 在这种情况下,我正在关注:

? Select which capability you want to update: Lambda function (serverless function)
? Select the Lambda function you want to update funcPreSignup
? Do you want to update the Lambda function permissions to access other resources in this project? Yes
? Select the category auth
? Auth has 2 resources in this project. Select the one you would like your Lambda to access projauth
? Select the operations you want to permit for projauth create,read,update,delete

You can access the following resource attributes as environment variables from your Lambda function
        AUTH_PROJ_USERPOOLID
? Do you want to invoke this function on a recurring schedule? No
? Do you want to configure Lambda layers for this function? No
Error: Cannot add funcPreSignup due to a cyclic dependency
    at checkForCyclicDependencies (/usr/local/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/update-amplify-Meta.js:188:15)
    at AmplifyToolkit.updateamplifyMetaAfterResourceUpdate [as _updateamplifyMetaAfterResourceUpdate] (/usr/local/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/update-amplify-Meta.js:114:9)
    at updateFunctionResource (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/lib/provider-utils/awscloudformation/index.js:144:29)
    at process._tickCallback (internal/process/next_tick.js:68:7)
There was an error adding the function resource

即使我看到它修改了CloudFormation堆栈,它仍然会继续错误显示授权异常

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。