content: package org.goormthon.seasonthon.nocheongmaru.global.config;
  
  import org.springframework.beans.factory.annotation.Value;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
  import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
  import software.amazon.awssdk.regions.Region;
  import software.amazon.awssdk.services.s3.S3Client;
  
  @Configuration
  public class S3StorageConfig {
      
      @Value("${cloud.aws.credentials.accessKey}")
      private String accessKey;
      
      @Value("${cloud.aws.credentials.secretKey}")
      private String secretKey;
      
      @Value("${cloud.aws.region.static}")
      private String region;
      
      @Bean
      public S3Client amazonS3Client() {
          return S3Client.builder()
              .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey)))
              .region(Region.of(region))
              .build();
      }
      
  }
  