gpt4 book ai didi

java - ElasticBeanstalk DescribeConfigurationSettings API 方法的访问被拒绝

转载 作者:行者123 更新时间:2023-12-05 03:33:53 33 4
gpt4 key购买 nike

我尝试按如下方式为 ElasticBeanstalk 运行 DescribeConfigurationSettings API 方法:

AWSElasticBeanstalk ebs = AWSElasticBeanstalkClientBuilder.standard().withRegion(Regions.EU_CENTRAL_1).withCredentials(new AWSStaticCredentialsProvider(credentials)).build();
for(ApplicationDescription ad : ebs.describeApplications().getApplications()){
System.out.println(ad);
for(EnvironmentDescription ed : ebs.describeEnvironments(new DescribeEnvironmentsRequest().withApplicationName(ad.getApplicationName())).getEnvironments()) {
System.out.println(ebs.describeConfigurationSettings(new DescribeConfigurationSettingsRequest().withApplicationName(ad.getApplicationName()).withEnvironmentName(ed.getEnvironmentName())).getConfigurationSettings());

}


}

但是,我收到以下消息的拒绝访问异常:

Exception in thread "main"com.amazonaws.services.elasticbeanstalk.model.AWSElasticBeanstalkException:Access Denied: S3Bucket=elasticbeanstalk-env-resources-eu-central-1,S3Key=eb_patching_resources/instance_patch_extension.linux (Service:Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID:NB44V0RXQG2WHH4T; Proxy: null) (Service: AWSElasticBeanstalk; StatusCode: 400; Error Code: InvalidParameterValue; Request ID:b058aa54-fc9c-4879-9502-5cb5818bc64a; Proxy: null)

我该如何解决这个问题?

最佳答案

根据您收到的错误,您似乎缺少某些 IAM 权限。我将从添加 AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy 开始您的用户的托管政策。

此策略可能比您实际需要的更宽松,但很难准确指出哪些权限是必需的。

关于java - ElasticBeanstalk DescribeConfigurationSettings API 方法的访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70263500/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com