boto3 的 UpdateAutoScalingGroup 权限错误
我在运行此脚本时遇到错误:
def set_asg_launch_template_version_latest(asg_name, lt_id):
try:
response = client.update_auto_scaling_group(
AutoScalingGroupName=asg_name,
LaunchTemplate={
'LaunchTemplateId': lt_id,
'Version': '$Latest'
}
)
print("Set launch template: {} version for asg: {} to $Latest".format(lt_id, asg_name))
return response
except ClientError as e:
print('Error setting launch template version to $Latest')
raise e
set_asg_launch_template_version_latest(ASGName,launch_template_id )
============> ClientError - 调用 UpdateAutoScalingGroup 操作时发生错误 (AccessDenied):您无权使用启动模板:lt-xxxxxxxxx
提示: 所有这些权限均已授权(检查最后一项):
- resource-groups:ListGroupResources
- tag:GetResources
- s3:PutObject
- s3:PutObjectAcl
- s3:List*
- ec2:Describe*
- ec2:CreateSnapshot
- ec2:CreateImage
- kms:CreateGrant
- ec2:StartInstances
- ec2:RunInstances
- ec2:TerminateInstances
- autoscaling:StartInstanceRefresh
- ec2:CreateSecurityGroup
- ec2:AuthorizeSecurityGroupEgress
- ec2:DeleteSecurityGroup
- ec2:RevokeSecurityGroupEgress
- ec2:ModifyLaunchTemplate
- ec2:CreateLaunchTemplateVersion
- autoscaling:Describe*
- ec2:DescribeLaunchTemplateVersions
- ec2:DescribeLaunchTemplates
- autoscaling:UpdateAutoScalingGroup
i am getting error while running this script :
def set_asg_launch_template_version_latest(asg_name, lt_id):
try:
response = client.update_auto_scaling_group(
AutoScalingGroupName=asg_name,
LaunchTemplate={
'LaunchTemplateId': lt_id,
'Version': '$Latest'
}
)
print("Set launch template: {} version for asg: {} to $Latest".format(lt_id, asg_name))
return response
except ClientError as e:
print('Error setting launch template version to $Latest')
raise e
set_asg_launch_template_version_latest(ASGName,launch_template_id )
============>
ClientError - An error occurred (AccessDenied) when calling the UpdateAutoScalingGroup operation: You are not authorized to use launch template: lt-xxxxxxxxx
hint :
all these permissions are authorized (check last one):
- resource-groups:ListGroupResources
- tag:GetResources
- s3:PutObject
- s3:PutObjectAcl
- s3:List*
- ec2:Describe*
- ec2:CreateSnapshot
- ec2:CreateImage
- kms:CreateGrant
- ec2:StartInstances
- ec2:RunInstances
- ec2:TerminateInstances
- autoscaling:StartInstanceRefresh
- ec2:CreateSecurityGroup
- ec2:AuthorizeSecurityGroupEgress
- ec2:DeleteSecurityGroup
- ec2:RevokeSecurityGroupEgress
- ec2:ModifyLaunchTemplate
- ec2:CreateLaunchTemplateVersion
- autoscaling:Describe*
- ec2:DescribeLaunchTemplateVersions
- ec2:DescribeLaunchTemplates
- autoscaling:UpdateAutoScalingGroup
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论