部署到 Lightsail 实例失败,因为找不到您的部署组的实例 [英] The deployment to Lightsail instances failed because no instances were found for your deployment group

查看:35
本文介绍了部署到 Lightsail 实例失败,因为找不到您的部署组的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据

根据

但这还不够.

解决方案

基于评论:

Lightsale (LS) 实例被视为本地实例.这意味着要与它们一起使用 CodeDeploy (CD),它们需要在 CD 中注册作为本地实例.

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

  1. 确保在 LS 实例上安装并运行 CD 代理.

    1. 在 AWS CLI 中,使用 CD 注册 LS 实例(注意 Amazon_Linux_2 是实例的名称)

    aws 部署 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 的屏幕截图上,有本地实例"菜单选项如下

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

    如果你检查你的实例公共 IP

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

    Following from Marci's answer, I went on and tried to deploy from GitHub using the steps he mentions (adapting the region) but I'm getting

    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.

    According to Gabriel in 2017

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

    The only thing I could think of doing atm was to make sure each instance is using the tag myasg which is the same tag used in the Deployment Group

    but that isn't enough.

    解决方案

    Based on the comments:

    Lightsale (LS) instances are considered as on-premise instances. This means that in order to use CodeDeploy (CD) with them, they need to be registered with CD as on-premises instances.

    In order to do this, one can follow three steps:

    1. Make sure that CD agent is installed and running on the LS instance. The answer has details on the installation procedure.

    1. In AWS CLI, register LS instance with CD (Note that Amazon_Linux_2 is the name of the instance)

    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. Add tags to the instance registered:

    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
    

    This means that now on the first OP's screenshot, there is "On-premises instances" menu option with the following

    Retry deployment if previous attempt failed before registration.

    and if you check your instances Public IP

    and navigate to it in the browser, you should see the result as expected

    这篇关于部署到 Lightsail 实例失败,因为找不到您的部署组的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆