1. AwsCredentialsProviderChain : Unable to load credentials from system settings.
< 에러코드 >
: Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain(credentialsProviders=[SystemPropertyCredentialsProvider(), EnvironmentVariableCredentialsProvider(), WebIdentityTokenCredentialsProvider(), ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(profilesAndSectionsMap=[])), ContainerCredentialsProvider(), InstanceProfileCredentialsProvider()]) : [SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., EnvironmentVariableCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., WebIdentityTokenCredentialsProvider(): Either the environment variable AWS_WEB_IDENTITY_TOKEN_FILE or the javaproperty aws.webIdentityTokenFile must be set., ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(profilesAndSectionsMap=[])): Profile file contained no credentials for profile 'default': ProfileFile(profilesAndSectionsMap=[]), ContainerCredentialsProvider(): Cannot fetch credentials from container - neither AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variables are set., InstanceProfileCredentialsProvider(): Failed to load credentials from IMDS.]
- 에러 내용 : Aws credential에 load 할 수 없음 => Access key 등록 필요
- 원인 : Aws CLI 설정을 하지 않음
- 해결 : Aws CLI 설치 후 Acess Key 등록
2. User: is not authorized to perform: transcribe: ~ because no identity-based
< 에러코드 >
User: arn:aws:sts::{accountID}:assumed-role/AmazonLightsailInstanceRole is not authorized
to perform: transcribe:StartTranscriptionJob
on resource: arn:aws:transcribe:{region}:{accountID}:transcription-job/{transcribeJobName}
because no identity-based policy allows the transcribe:StartTranscriptionJob action (Service: Transcribe, Status Code: 400, Request ID: )
- 에러 내용 : User가 Aws Transcribe 리소스에 접근할 권한이 없음
- 원인 : docker로 띄워진 백엔드 서비스 컨테이너가 서버 로컬에 있는 Aws Credetial에 접근하지 못해 발생
- 해결 과정
[실패] Aws IAM Policy(정책) 및 Role(역할) 생성하여 권한 부여https://docs.aws.amazon.com/ko_kr/transcribe/latest/dg/security_iam_id-based-policy-examples.htmlUser: arn:aws:sts::{accountID}:assumed-role 의 역할에 대한 신뢰할만한 정책을 생성해야 하는 줄 알고 역할을 생성하고, transcribe 관련 권한을 추가해줬습니다.
하지만, 여전히 동일한 에러가 발생했고 IAM의 자격 증명 관련 에러는 아니라고 생각하게 되었습니다.
[성공] docker 컨테이너가 서버 로컬의 Aws Credential에 접근 가능하도록 볼륨 설정
IAM 관련 시도할 방법들은 다 해봤다고 생각했고, 친구와 에러에 대해 이야기 하던 중(+ gpt의 도움),
아주 ~~~ 기초적인 개념인 Docker 컨테이너가 당연히 로컬에 접근하지 못한다는 것을 깨달았습니다 ^^
결론 : docker-compose 파일에 volume을 설정하여 로컬의 /.aws에 credential에 접근하도록 설정해주었습니다.
version: '3'
services:
app:
container_name: {CONTAINER_NAME}
image: docker-springboot:0.1
ports:
- 8081:8081
volumes:
- /home/ubuntu/.aws:/root/.aws
build:
context: .
dockerfile: Dockerfile
Amazone Transcribe를 활용하여 STT(Speech To Text)를 구현하고 있는데 로컬에서는 잘되던게 서버에 올리니 에러가 빵빵빵빠레 터져서 하루동안 에러만 붙잡고 있었는데 해결했습니다. (못하면 인간 STT가 되려고했어요^^)
Amazon Transcribe 자격 증명 기반 정책 예제 - Amazon Transcribe
에IAMAWS Management Console 로그인하고 정책 이름으로 검색하여 관리형 권한 정책을 검토할 수 있습니다. “Transcribe”를 검색하면 위에 나열된 정책 (AmazonTranscribeReadOnly및 AmazonTranscribeFullAccess) 이 모
docs.aws.amazon.com