背景
最近用一个terraform asg模块部署asg时一直报错Error: Termination Reason: Client.InternalError: Client error on launch
搜索资料发现和KMS下面的asg
对应的policy
有关系.
解决方法
在AWS界面找到KMS
, 然后找到customer managed key
导航栏, 最后找到对应AMI加密用的key修改其key policy
即可, 需要在key policy
中添加AWSServiceRoleForAutoScaling
的policy.
如下, 注意需要把<AWS Account Number>
替换成自己的aws账号:文章来源:https://www.toymoban.com/news/detail-653227.html
{
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<AWS Account Number>:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling"
]
},
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": "*"
},
{
"Sid": "Allow attachment of persistent resources",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<AWS Account Number>:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling"
]
},
"Action": [
"kms:CreateGrant",
"kms:ListGrants",
"kms:RevokeGrant"
],
"Resource": "*",
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": "true"
}
}
}
参考
Termination Reason: Client.InternalError: Client error on launch文章来源地址https://www.toymoban.com/news/detail-653227.html
到了这里,关于AWS asg(Auto Scaling Group)部署时报错Error: Termination Reason: Client.InternalError的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!