我在bitbucket中有一个存储库,用于部署到我正在使用的codedeploy(我找不到更好的解决方案)的elasticbeanstall。我已经在IAM中创建了elsticbeanServceRole,我附加的策略是
- AmazonEC2FullAccess
- 管理员访问
- AmazonAPI网关管理员
- codedeployServiceRolePolicy(自定义策略)
这是codedeployServiceRolePolicy 的内容
{
"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": "*"
}
]
}
然后我复制了角色ARN并粘贴到代码部署应用程序设置中
我已经成功地配置了bitbucket代码部署设置,为此我创建了一个名为bitbucketRole的角色,并使用自定义策略。政策内容为
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:*",
"codedeploy:*",
"ec2:*",
"elasticloadbalancing:*",
"iam:AddRoleToInstanceProfile",
"iam:CreateInstanceProfile",
"iam:CreateRole",
"iam:DeleteInstanceProfile",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:GetInstanceProfile",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:ListInstanceProfilesForRole",
"iam:ListRolePolicies",
"iam:ListRoles",
"iam:PassRole",
"iam:PutRolePolicy",
"iam:RemoveRoleFromInstanceProfile",
"s3:*"
],
"Resource": "*"
}
]
}
问题
现在,当我点击比特桶中的"部署到AWS"时,从比特桶到代码部署的部署正在触发,但我在代码部署控制台上遇到错误
总体部署失败的原因是:有太多单个实例部署失败,可用于部署的健康实例太少,或者部署组中的某些实例遇到问题。(错误代码:HEALTH_CONSTRAINTS)。
请帮我
CodeDeploy代理是否在您的实例上运行?另外,你能从一个失败的实例中粘贴错误信息吗?
HEALTH_CONSTRAINTS通常表示CodeDeploy由于部署配置中设置的运行状况约束而无法继续部署。太多实例已失败,CodeDeploy无法再删除任何实例。