部署到 Lightsail 实例失败,因为没有找到您的部署组的实例

The deployment to Lightsail instances failed because no instances were found for your deployment group

之后,我继续尝试使用他提到的步骤(适应区域)从 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.

根据Gabriel in 2017

Lightsail is intended for smaller projects and doesn't support load balancing or auto-scaling groups at this time.

我唯一能想到的 atm 就是确保每个实例都使用标签 myasg,这与部署组中使用的标签相同

但这还不够。

根据评论:

Lightsale (LS) 实例被视为 on-premise 实例。这意味着为了与它们一起使用 CodeDeploy (CD),它们需要 注册到 CD 作为 on-premises 个实例。

要做到这一点,可以遵循三个步骤:

  1. 确保在 LS 实例上安装了 CD 代理和 运行。 有详细的安装步骤。

  1. 在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
  1. 为注册的实例添加标签:
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 的屏幕截图上,有“On-premises 个实例”菜单选项,其中包含以下内容

如果之前的尝试在注册前失败,请重试部署。

如果你检查你的实例 Public IP

并在浏览器中导航到它,您应该会看到预期的结果