我正在尝试使用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')
)
但没用。
有什么想法吗?