代码之家  ›  专栏  ›  技术社区  ›  Pablo Cantero

无法检索用于配置代码管道的SSM参数

  •  0
  • Pablo Cantero  · 技术社区  · 7 年前

    我正在尝试使用github作为源stage配置代码管道,为此,我使用secrets manager配置了github oauth令牌:

    const oauth = new SecretParameter(this, 'GitHubOAuthToken', {
      ssmParameter: 'github-token'
    })
    
    new codepipeline.GitHubSourceAction(this, 'GitHubSource', {
      stage: sourceStage,
      owner: 'owner',
      repo: 'repo',
      branch: 'master',
      oauthToken: new Secret(oauth)
    })
    

    但当我试图部署堆栈时 cdk deploy 我得到:

    validationerror:无法从该帐户的参数存储中获取参数[github token]。 无法从该帐户的参数存储中获取参数[Github令牌]。

    我还尝试向管道添加权限

    pipeline.role.addToPolicy(
      new PolicyStatement()
        .addAllResources()
        .addAction('secretsmanager:GetSecretValue')
    )
    

    但没用。

    有什么想法吗?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Pablo Cantero    7 年前

    我被secrets manager和参数存储搞混了,我把我的令牌保存到参数中,它运行得很好。

    推荐文章