Terraform 401 인증 에러

흑두루미·2026년 5월 21일

Terraform 401 인증 에러 발생

You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.

Error: Failed to get endpoint list
with provider["registry.terraform.io/samsungsdscloud/samsungcloudplatformv2"],
on provider.tf line 25, in provider "samsungcloudplatformv2":
25: provider "samsungcloudplatformv2" {

Error details: {"status":"UNAUTHORIZED","name":"Request was rejected by
gateway","message":"[Security Configuration] Access key not allowed."}

🔍원인

  1. API 호출 IP 접근 제어 (가장 유력함)
    Terraform plan 결과에 출력된 현재 퍼블릭 IP가 SCP 콘솔의 API 접근 허용 IP 목록에 등록되어 있는지 확인
  • 확인하였으나 허용IP 목록에 등록되어 있음

  1. Access Key 및 Secret Key 오류
    provider.tf 파일이나 환경 변수에 입력한 인증 정보(Access Key, Secret Key 등)가 잘못 입력되었거나 만료되었을 수 있음
  • Access Key 및 Secret Key 재발급
  • provider.tf 파일에 인증정보 넣지 않고 conf 디렉토리의 config.json으로 변수 선언
  • export를 통해 직접 Access Key 및 Secret Key 설정해 보았으나 동일하게 인증 에러 발생

  1. 프로젝트 및 권한 부족
    해당 Access Key를 발급받은 계정에 현재 작업하려는 프로젝트(Project ID)에 대한 접근 권한이나 인프라 생성/조회 권한이 부여되지 않았을 수 있음
  • 운영자 권한 확인

✅확인

  1. credential.json 파일 확인
  • credential.json 파일의 auth_url 재확인 > 이상없음

  1. Terraform 상세 로그 활성화
export TF_LOG=DEBUG
  • DEBUG 로그 확인 시 API Gateway 통신은 정상, 엔드포인트 조회 문제
  • 네트워크 차단 문제가 아닌 Access Key 권한 문제 확률로 확인

📝결과

콘솔의 인증키 보안설정 재확인

수정 전 : 임시키 인증 | 접근 허용 IP 미사용
수정 후 : 인증키 인증 | 접근 허용 IP 미사용

테스트를 위해 접근 허용 IP는 미사용으로 시도

*인증키 보안 설정이 인증키 인증이 아닌 임시키로 되어 있어 발생했던 인증 에러


0개의 댓글