Spring 上传文件到S3存储桶。无法从环境变量加载客户端监视配置
我正在尝试将文件上载到S3存储桶 我的代码:Spring 上传文件到S3存储桶。无法从环境变量加载客户端监视配置,spring,amazon-web-services,kotlin,amazon-s3,Spring,Amazon Web Services,Kotlin,Amazon S3,我正在尝试将文件上载到S3存储桶 我的代码: @Configuration class AmazonConfig { @Bean fun s3(): AmazonS3 { val awsCredentials = BasicAWSCredentials( "blabla", "blabla" ) return AmazonS3ClientBui
@Configuration
class AmazonConfig {
@Bean
fun s3(): AmazonS3 {
val awsCredentials = BasicAWSCredentials(
"blabla",
"blabla"
)
return AmazonS3ClientBuilder
.standard()
.withRegion(Regions.US_EAST_2)
.withCredentials(AWSStaticCredentialsProvider(awsCredentials))
.build()
}
}
我得到一份工作SdkClientException@6820:“com.amazonaws.SdkClientException:无法从环境变量加载客户端监视配置!”您可以将文件上载到Spring应用程序中的Amazon S3存储桶。下面是一个使用AWS SDK for Java V2的多服务示例应用程序。Amazon建议使用V2而不是V1 在这个示例SpringBoot应用程序中,用户可以选择要上载AmazonS3存储桶的文件。然后使用Amazon Rekognition服务对照片进行分析。然后使用SES服务通过电子邮件发送报告