【问题标题】:Copilot Fails to Deploy Cannot Access SSMCopilot 部署失败无法访问 SSM
【发布时间】:2021-06-25 03:36:01
【问题描述】:

当我尝试将带有 Copilot 的 负载平衡 Web 服务 部署到新环境中时,我遇到了以下错误。我在test 中运行了所有东西,创建了一个新的prod 环境并尝试将服务部署到其中,但任务详细信息显示了停止的原因:

ResourceInitializationError:无法提取机密或注册表身份验证: 执行资源检索失败:无法从 ssm:服务调用已重试 1 次:AccessDeniedException: 用户:arn:aws:sts::xxx:assumed-role...

【问题讨论】:

    标签: amazon-web-services aws-fargate


    【解决方案1】:

    SSM 参数是专门为test env 添加的,我认为默认情况下它会应用于所有环境,但显然不是。必须再次为prod 环境添加标签copilot-environment。

    aws ssm put-parameter \
        --name /copilot/applications/core/environments/test/port \
        --value '8000' \
        --type SecureString \
        --tags Key=copilot-environment,Value=test Key=copilot-application,Value=core
    
    aws ssm put-parameter \
        --name /copilot/applications/core/environments/prod/port \
        --value '8000' \
        --type SecureString \
        --tags Key=copilot-environment,Value=prod Key=copilot-application,Value=core
    

    并更新了我的 manifest.yml:

    secrets:                      # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
      PORT: /copilot/applications/core/environments/test/port
    
    # You can override any of the values defined above by environment.
    environments:
      prod:
        secrets:
          PORT: /copilot/applications/core/environments/prod/port
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多