작성자 : 김다희
S3 Upload 기능 구현을 위해 아래 블로그를 참고함.
https://bamdule.tistory.com/177?category=439472
S3 생성
의존성 추가
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-aws', version: '2.2.1.RELEASE'
application run
because the application is not running in the EC2 environment. Region detection is only possible if the application is running on a EC2 instance
애플리케이션이 EC2 인스턴스에서 실행 중인 경우에만 리전 감지가 가능하다고 한다.
버킷 정보를 yaml 파일에 등록해주자.
cloud:
aws:
credentials:
accessKey: ${IAM_ACCESS_KEY}
secretKey: ${IAM_SECRET_KEY}
s3:
bucket: ${BUCKET_NAME}
region:
static: ap-northeast-2
stack:
auto: false