반응형

현상

ci/cd구축을 위해 code pipeline을 생성한 후, source에서 아래와 같은 에러가 발생함.

(제 pipeline은 S3를 통해 pkg를 가져오는 구조입니다.)

 

권한 부족

The provided role does not have permissions to prform this action.

 

 

IAM에서 여러 권한을 줘봤으나 현상은 모두 동일했고, 구글링을 반나절 해본 결과...

S3 bucket > 버킷정책을 확인해보라는 말을 보았다.

 

그래서 S3 bucket으로 가서, 버킷 정책을 확인했다.

codepipeline에 대한 권한이 없어 codepipeline을 *로 주었고, 생성한 codepipeline의 arn 추가했더니 

아래와 같이 2가지 에러가 발생했다.

Ln 16, Col 4에 언급된 링크를 들어가보면,

https://docs.aws.amazon.com/ko_kr/IAM/latest/UserGuide/access-analyzer-reference-policy-checks.html#access-analyzer-reference-policy-checks-error-unsupported-resource-arn-in-policy

 

Access Analyzer 정책 검사 참조 - AWS Identity and Access Management

Access Analyzer 정책 검사 참조 AWS IAM Access Analyzer 정책 검사를 사용하여 정책을 검증할 수 있습니다. AWS CLI, AWS API 또는 IAM 콘솔의 JSON 정책 편집기를 사용하여 정책을 생성 또는 편집할 수 있습니다.

docs.aws.amazon.com

 

 

Resolving the error (이슈 해결)

Some resource ARNs aren't supported in the Resource element of the resource-based policy when the policy is attached to a different resource type. For example, AWS KMS ARNs aren't supported in the Resource element for Amazon S3 bucket policies. Specify a resource ARN that is supported by a resource type attached to your resource-based policy.

일부 리소스 ARN들은 정책이 다른 리소스 타입에 연결된 경우, 리소스 요소를 지원하지 않는다,

예를 들어 AWS KMS ARN은 S3 버킷 정책에서 지원되지 않는다. --> codepipeline 만들 때 KMS를 썼었다. 이걸 제거하자.

 

 

결론

그래서 결국엔, codepipeline을 생성할 때, KMS를 사용하지 않고 기본 AWS 관리형 키를 선택한 결과 소스 가져오기가 성공하였다.

 

 

 

휴 일단 소스 가져오기까진 성공!

반응형

+ Recent posts