我在使用 SecretsManager 的 AWS Fargate 中运行 SpringBoot 应用程序。这是我作为凭证提供者提供给 AWS 开发工具包的内容:
public class ProfiledCredentialsProvider extends AWSCredentialsProviderChain {
public ProfiledCredentialsProvider(@Nullable final String profile) {
super(new DefaultAWSCredentialsProviderChain(), new EC2ContainerCredentialsProviderWrapper(),
new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(),
StringUtils.isBlank(profile) ? new ProfileCredentialsProvider()
: new ProfileCredentialsProvider(profile));
this.setReuseLastProvider(true);
}
}
Run Code Online (Sandbox Code Playgroud)
这使我可以使用备用 AWS 配置文件在本地运行此应用程序。但是,当我在 Fargate 中运行此应用程序时,我得到以下堆栈跟踪:
com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [com.amazonaws.auth.DefaultAWSCredentialsProviderChain@3439f68d: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or …Run Code Online (Sandbox Code Playgroud) 我的 CloudFormation 堆栈创建失败并出现一个非常普遍的错误,我似乎无法弄清楚原因。
我正在使用 ALB 创建单容器 ECS 服务任务。
这是我的堆栈模板:
AWSTemplateFormatVersion: '2010-09-09'
Description: Services Containers
Parameters:
VpcId:
Type: String
Default: vpc-4796bd23
SubnetId:
Type: String
Default: subnet-f4701ff8
ELBSecondarySubnetId:
Type: String
Default: subnet-8a453cef
ECSCluster:
Type: String
Default: dev-ecs
EcsSecurityGroup:
Type: String
Default: sg-74cb7b0c
Color:
Type: String
AllowedValues: ['blue', 'green']
Description: The deployment color
Default: 'blue'
BuildVersion:
Type: String
Description: The build version to deploy
ComPublic:
Type: String
Description: Hosted Zone ID
Default: Z00669325SSURKTK4ZPA
MQPort:
Type: Number
Description: MQ Connectivity port
Default: 5672
Resources: …Run Code Online (Sandbox Code Playgroud) amazon-web-services amazon-ecs aws-cloudformation aws-fargate aws-application-load-balancer