【问题标题】:Unable to deploy code on ec2 instance using codedeploy无法使用 codedeploy 在 ec2 实例上部署代码
【发布时间】:2021-10-19 01:12:35
【问题描述】:

我有单个 ec2 实例在 ubuntu 服务器上运行,我正在尝试使用 codedeploy 实现 CI/CD 流,源是 bit-bucket。我还在 ec2 实例上安装了 codedeploy-agent,它已安装并成功运行,但无论何时我在 ec2 部署上部署代码失败,错误如下所示:

The overall deployment failed because too many individual instances failed deployment, too few 
healthy instances are available for deployment, or some instances in your deployment group are 
experiencing problems.

在我使用 less /var/log/aws/codedeploy-agent/codedeploy-agent.log 访问的 CodeDeploy 代理日志文件中显示以下错误:

ERROR [codedeploy-agent(31598)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: 
Missing credentials - please check if this instance was started with an IAM instance profile

我无法理解如何才能克服有人告诉我的这个错误。

【问题讨论】:

    标签: amazon-web-services amazon-ec2 aws-code-deploy


    【解决方案1】:

    CodeDeploy 代理需要您的实例的 IAM 角色/配置文件提供的 IAM 权限。 AWS 文档中给出了所需的确切权限:

    【讨论】:

    • 我已经为我的 ec2 实例创建了 IAM 角色,但现在错误显示 The CodeDeploy agent did not find an AppSpec file within the unpacked revision directory at revision-relative path "appspec.yml".
    • 如何创建这个 appspec.yml 文件以及我应该在其中包含什么。
    • @Digvijay 这是新问题,因此我建议用相关细节提出新问题。
    • @Digvijay 谢谢,我会检查的。但如果当前答案有助于解决 IAM 权限问题,我们将不胜感激。
    猜你喜欢
    • 2020-02-17
    • 2016-09-13
    • 1970-01-01
    • 1970-01-01
    • 2019-08-27
    • 2017-12-23
    • 2015-02-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多