【发布时间】:2021-05-10 09:04:18
【问题描述】:
尝试让 Cognito UserPool 用户as described here 可以访问 AWS CodeCommit:
- 使用
AWSCodeCommitPowerUser创建了一个IAM 角色, - 与用户池建立信任关系,
- 已安装
git-remote-codecommit和 configured the profile。 - 接下来,尝试以下任一方法:
- 设置
source_profile = default,其中default凭证配置文件包含一个IAM 用户(错误的方式,但只是为了检查)。
执行git clone codecommit://CodeAccessProfile@repo抛出:
An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:iam::123456789:user/name.surname is not authorized to perform: sts:AssumeRole on resource...
- 在 Web 应用程序中以 Cognito 用户池用户身份登录,
从响应中获取 Cognito IdToken,
并使用它调用assume-role-with-web-identity。获取:
An error occurred (InvalidIdentityToken) when calling the AssumeRoleWithWebIdentity operation: Provided Token is not a Login With Amazon token
我可能需要在配置文件中设置web_identity_token_file=token-file.txt,但是从哪里获取与 Cognito 用户关联的令牌?
我想知道如何让 git-remote-codecommit 为 Cognito UserPool 用户工作,从而避免使用 STS 令牌带来的痛苦,只需正确配置配置文件?
更新:
汇报
在基于 AWS 的 POC 上花了几周时间后,我们决定在运行在 k8 中的轻量级且完全可控的服务上实施所有管道,例如 Gitea ????????
【问题讨论】:
标签: git amazon-web-services jwt amazon-cognito gitea