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