AWS在部署期间无法从ELB注销EC2

时间:2017-03-17 12:18:22

标签: amazon-web-services amazon-ec2 amazon-elb

我使用codeDeploy将新代码部署到我的EC2实例。

这是我的appspec文件:

version: 0.0
os: linux
files:
  - source: v1
    destination:  /somewhere/v1
hooks:
  BeforeInstall:
    - location: script/deregister_from_elb.sh
      timeout: 400

但我收到以下错误:

LifecycleEvent - BeforeInstall
Script - v1/script/deregister_from_elb.sh
[stderr]Running AWS CLI with region: eu-west-1
[stderr]Started deregister_from_elb.sh at 2017-03-17 11:44:30
[stderr]Checking if instance i-youshouldnotknow is part of an AutoScaling group
[stderr]/iguessishouldhidethis/common_functions.sh: line 190: aws: command not found
[stderr]Instance is not part of an ASG, trying with ELB...
[stderr]Automatically finding all the ELBs that this instance is registered to...
[stderr]/iguessishouldhidethis/common_functions.sh: line 552: aws: command not found
[stderr][FATAL] Couldn't find any. Must have at least one load balancer to deregister from.

任何想法为什么会发生这种情况?我怀疑消息" aws:command not found"可能是问题,但我安装了awscli

~$ aws --version
aws-cli/1.11.63 Python/2.7.6 Linux/3.13.0-95-generic botocore/1.5.26

非常感谢你的帮助

0 个答案:

没有答案