gpt4 book ai didi

Amazon EC2 代码部署没有主机成功

转载 作者:行者123 更新时间:2023-12-01 13:48:48 25 4
gpt4 key购买 nike

我是 Amazon Code Deploy 的新手。部署时出现错误

Deployment Failed
No hosts succeeded

我检查了我的 Linux 机器上的服务代码 deploy-agent,它正在运行我该如何解决这个问题?

最佳答案

大多数情况下,此问题的发生是由于实例和 CodeDeploy 服务上的 IAM 权限不足。您需要检查/var/log/aws/codedeploy-agent/codedeploy-agent.log 文件以获取详细信息。同样在 /etc/codedeploy-agent/conf/codedeployagent.yml 文件中,您可以设置 :verbose: true 以在日志文件中获取更多信息。

这些是您需要更新的 IAM 策略:

// Policy Role for Code Deploy
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:PutLifecycleHook",
"autoscaling:DeleteLifecycleHook",
"autoscaling:RecordLifecycleActionHeartbeat",
"autoscaling:CompleteLifecycleAction",
"autoscaling:DescribeAutoscalingGroups",
"autoscaling:PutInstanceInStandby",
"autoscaling:PutInstanceInService",
"ec2:Describe*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}

// Policy Trust for Code Deploy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"codedeploy.us-west-2.amazonaws.com",
"codedeploy.us-east-1.amazonaws.com"
]
},
"Action": "sts:AssumeRole"
}
]
}

// Instance Role for EC2 Instance
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:Get*",
"s3:List*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}

关于Amazon EC2 代码部署没有主机成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33629930/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com