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

て烟熏妆下的殇ゞ 提交于 2020-12-12 06:16:33

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/64176881/the-deployment-to-lightsail-instances-failed-because-no-instances-were-found-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!