프로그래밍/버그노트

Spring 프로젝트 AWS 연동 버그

abfc 2019. 4. 5.
반응형

 

 

 

발생 : AWS S3를 연동한 스프링부트 프로젝트를 aws 서버에 배포할때 에러발생(로컬에서는 문제 없었음)

 

에러내용 :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.aws.core.env.ResourceIdResolver.BEAN_NAME': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stackResourceRegistryFactoryBean' defined in class path resource [org/springframework/cloud/aws/autoconfigure/context/ContextStackAutoConfiguration$StackAutoDetectConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.aws.core.env.stack.config.StackResourceRegistryFactoryBean]: Factory method 'stackResourceRegistryFactoryBean' threw exception; nested exception is com.amazonaws.services.cloudformation.model.AmazonCloudFormationException: User: arn:aws:iam::812378804814: is not authorized to perform: cloudformation:DescribeStackResources (Service: AmazonCloudFormation; Status Code: 403; Error Code: AccessDenied; Request ID: )

 

해결

application.properties 파일에 cloud.aws.stack.auto=false 추가

프로젝트 배포시 기본으로 CloudFormation 구성을 시작하기 때문에 설정한 CloudFormation이 없으면 프로젝트 실행이 되지 않음. 해당 기능을 사용하지 않도록 false로 설정.

 

 

 

반응형

댓글

💲 추천 글