我正在将 Flask 应用程序部署到 ElasticBeanstalk。此应用程序的依赖项之一是应从 CodeCommit git 存储库安装的包。
在本地,我已成功设置 SSH 以连接到 CodeCommit 存储库pip install
并推送代码。我已将包添加到requirements.txt
,并且在本地安装得很好pip
。
问题是,我应该如何配置 EBS 以通过 SSH 访问这个 repo?
我看到 EBS 使用的 IAM 角色是aws-elasticbeanstalk-ec2-role
. 我将策略附加AWSCodeCommitReadOnly
到此角色,但无济于事。
在eb-activity.log
尝试从 CodeCommit 获取包时,它会出现 SSH 错误:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
我应该如何配置从 EBS 对 AWS CodeCommit 的访问?