[AWS] Failed to connect to service endpoint 에러

DragonTiger·2022년 12월 27일
1

com.amazonaws.SdkClientException: Failed to connect to service endpoint:
Caused by: java.net.SocketTimeoutException: connect timed out

회사에서 새로운 프로젝트를 세팅하다 만난 오류이다.

결론 부터 말하자면,

aws에 사용하는 애플리케이션을 연동해야할때 만날수있는 에러이다.

(aws sdk 에러 spring-cloud-starter-aws 의존성 주입시 로컬환경은 aws환경이 아니기때문에 나는 에러라고 한다.)

application 동작하는데에는 별 문제가 되어보이지않는 에러지만

앱 실행시 시간이 오래걸리기도하고 거슬리기도해서 나의 영혼의 친구 구글과 함께 이상황을

헤쳐나가보려한다.

그러나?!

해결방법은 간단했다.

SpringBootApplication 에 적용시키면 된다.

@SpringBootApplication(
        exclude = {
                org.springframework.cloud.aws.autoconfigure.context.ContextInstanceDataAutoConfiguration.class,
                org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration.class,
                org.springframework.cloud.aws.autoconfigure.context.ContextRegionProviderAutoConfiguration.class
        }
)

profile
take the bull by the horns

0개의 댓글