我正在尝试使用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')
)
但它不起作用 .
有任何想法吗?
1 回答
我对Secrets Manager和Parameter Store感到困惑,我将我的令牌保存到参数中,它运行得很好 .