0

我正在尝试使用 GitHub 作为源阶段来配置 CodePipeline,为此,我使用 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-token]。

我还尝试向管道添加权限

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

但它没有用。

有任何想法吗?

4

1 回答 1

1

我对 Secrets Manager 和 Parameter Store 感到困惑,我将我的令牌保存到了 Parameter 中,它工作得很好。

于 2018-12-09T19:10:21.980 回答