Java 使用实例元数据配置SpringCloud配置,以便可以使用IAM角色从CodeCommit进行克隆

Java 使用实例元数据配置SpringCloud配置,以便可以使用IAM角色从CodeCommit进行克隆,java,spring,amazon-web-services,spring-cloud-config,spring-cloud-aws,Java,Spring,Amazon Web Services,Spring Cloud Config,Spring Cloud Aws,我试图在ECS生成的docker容器中运行spring cloud配置应用程序。我在正确设置它时遇到问题,因此元数据用于从CodeCommit克隆git repo 我有以下设置 pom.xml依赖项 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> &l

我试图在ECS生成的docker容器中运行spring cloud配置应用程序。我在正确设置它时遇到问题,因此元数据用于从CodeCommit克隆git repo

我有以下设置

pom.xml依赖项

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-config-server</artifactId>
</dependency>

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-aws</artifactId>
</dependency>

# some other non related settings such as port
spring:
  cloud:
    config:
      server:
        git:
          uri: https://git-codecommit.eu-central-1.amazonaws.com/v1/repos/<repo name>
          skip-ssl-validation: true
cloud:
  aws:
    credentials:
      instance-profile: true
    stack:
      auto: false
2019-04-25 16:37:54.209  WARN 1 --- [nio-5000-exec-1] .c.s.e.MultipleJGitEnvironmentRepository : Error occured cloning to base directory.

org.eclipse.jgit.api.errors.TransportException: https://git-codecommit.eu-central-1.amazonaws.com/v1/repos/<repo name>: git-upload-pack not permitted on 'https://git-codecommit.eu-central-1.amazonaws.com/v1/repos/<repo name>/'
If you provide a username and password with an AWS CodeCommit URI, they must be the AWS accessKeyId and secretAccessKey that provide access to the repository.
If you do not specify a username and password, the accessKeyId and secretAccessKey are retrieved by using the AWS Default Credential Provider Chain.