![](/img/trans.png)
[英]Receiving error "User: arn:aws:iam::11345636234528:user/my_Api is not authorized to perform: secretmanager:GetSecretValue on resouce: my_Resource"?
[英]AWS boto3 User: arn:aws:iam::xxxx:root is not authorized to perform: lambda:AddLayerVersionPermission on resource
import json
import boto3
client = boto3.client('lambda')
response = client.add_layer_version_permission(
LayerName='arn:aws:lambda:us-east-1:xxxx:layer:AWSLambda-Python38-SciPy1x',
VersionNumber=29,
StatementId='xaccount',
Action='lambda:GetLayerVersion',
Principal='*',
)
print(response)
setp1) 设置 aws 凭据
step2) 创建新的 IAM 管理员用户并为该用户分配策略AdministratorAccess、AWSLambda_FullAccess、AWSLambdaExecute
step3)运行python脚本后我收到错误
botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the AddLayerVersionPermission operation: User: arn:aws:iam::xxxx:root is not authorized to perform: lambda:AddLayerVersionPermission on resource: arn:aws:lambda:us-east-1:xxxx:layer:AWSLambda-Python38-SciPy1x:29
您尝试修改的图层:
arn:aws:lambda:us-east-1:xxxx:layer:AWSLambda-Python38-SciPy1
是AWS 托管的公共层。 它不属于你,因此你不能修改它的权限,解释为什么你被拒绝这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.