继Marci's answer之后,我继续尝试使用他提到的步骤(调整区域)从 GitHub 进行部署,但我得到了
The deployment failed because no instances were found for your deployment group. Check your deployment group settings to make sure the tags for your Amazon EC2 instances or Auto Scaling groups correctly identify the instances you want to deploy to, and then try again.
Lightsail is intended for smaller projects and doesn't support load balancing or auto-scaling groups at this time.
我能想到做 atm 的唯一一件事是确保每个实例都使用标签 myasg
,该标签与部署组中使用的标签相同
但这还不够。
最佳答案
根据评论:
Lightsale (LS) 实例被视为本地实例。这意味着,为了将 CodeDeploy (CD) 与它们一起使用,它们需要使用 CD 注册作为本地实例。
为了做到这一点,可以遵循三个步骤:
- 确保 CD 代理已安装并在 LS 实例上运行。 answer有安装过程的详细信息。
- 在 AWS CLI 中,使用 CD 注册 LS 实例(请注意,
Amazon_Linux_2
是实例的名称)
aws deploy register-on-premises-instance --instance-name Amazon_Linux_2 --iam-user-arn arn:aws:iam::525221857828:user/Linux2CodeDeployUser --region eu-west-2
- 向注册的实例添加标签:
aws deploy add-tags-to-on-premises-instances --instance-names Amazon_Linux_2 --tags Key=myasg --region eu-west-2, (2.3) aws deploy list-on-premises-instances --region eu-west-2
这意味着现在在第一个 OP 的屏幕截图上,有“本地实例”菜单选项,其中包含以下内容
如果注册前之前的尝试失败,请重试部署。
如果您检查您的实例公共(public) IP
并在浏览器中导航到它,您应该会看到预期的结果
关于amazon-web-services - 部署到 Lightsail 实例失败,因为找不到适合您的部署组的实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64176881/