使用BitBucket作为CodePipeline源时的权限错误
我想将Bitbucket用作源,
我在下面有这样的权限错误。
我想我应该允许AWSCloudFormation角色,但是我该怎么做?
User: arn:aws:sts::678100228133:assumed-role/cdk-hnb659fds-cfn-exec-role-678100228133-us-west-2/AWSCloudFormation is not authorized to perform: codestar-connections:Pas
sConnection on resource: ari:cloud:bitbucket::app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar (Service: AWSCodePipeline; Status Code: 400; Error Code: AccessDen
iedException; Request ID: 0d152b96-e756-4821-9ad1-7551cb9e8bf7; Proxy: null)
我的CDK代码是这样的,Ari:cloud:bitbucket :: app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar已经是手动设置的。
const bitbucketSourceOutput = new cdk.aws_codepipeline.Artifact();
const bitbucketSourceAction = new cdk.aws_codepipeline_actions.CodeStarConnectionsSourceAction({
actionName: `ss-${targetEnv}-ecs-bitbucket-build`,
owner: 'aws',
repo: 'myname/testrepo',
output: bitbucketSourceOutput,
connectionArn: 'ari:cloud:bitbucket::app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar',
});
I want to use bitbucket as source,
I have the permission error like this below.
I guess I should give the permission to AWSCloudFormation role, however how can I do it?
User: arn:aws:sts::678100228133:assumed-role/cdk-hnb659fds-cfn-exec-role-678100228133-us-west-2/AWSCloudFormation is not authorized to perform: codestar-connections:Pas
sConnection on resource: ari:cloud:bitbucket::app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar (Service: AWSCodePipeline; Status Code: 400; Error Code: AccessDen
iedException; Request ID: 0d152b96-e756-4821-9ad1-7551cb9e8bf7; Proxy: null)
My cdk code is like this, ari:cloud:bitbucket::app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar is already set manually.
const bitbucketSourceOutput = new cdk.aws_codepipeline.Artifact();
const bitbucketSourceAction = new cdk.aws_codepipeline_actions.CodeStarConnectionsSourceAction({
actionName: `ss-${targetEnv}-ecs-bitbucket-build`,
owner: 'aws',
repo: 'myname/testrepo',
output: bitbucketSourceOutput,
connectionArn: 'ari:cloud:bitbucket::app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar',
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ari:cloud:bitbucket :: app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar
不是有效的codestar连接。 CodeStar Connection ARN看起来像这样:ARN:AWS:CODESTAR连接:EU-West-1:123456789012:Connection/Connection/991F-27E07658DD59-344E-44D2-ADEA4D2-ADEA40DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
AWS控制台并在管道中使用其ARN。
ari:cloud:bitbucket::app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar
is not a valid CodeStar connection ARN. A codestar connection ARN looks like this:arn:aws:codestar-connections:eu-west-1:123456789012:connection/991f-27e07658dd59-344e-44d2-adea40dd
You need to create a CodeStar connection in the AWS console and use its ARN in your pipeline.