无法检索用于配置代码管道的 ssmParameter



我正试图使用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令牌]。无法从此帐户的参数存储中获取参数[github令牌]。

我还试图向管道添加权限

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

但没有奏效。

有什么想法吗?

我对Secrets Manager和Parameter Store感到困惑,我将令牌保存到Parameter中,它运行得很好。

最新更新