feat(cloud-connection): 연결 가이드 API — 입력값·위치 + 추천 IAM 정책(전체본) - #296
Merged
Conversation
클라우드 연결 화면에서 사용자는 무슨 값을 어디서 가져와 넣어야 하는지, 우리가 접근·처리하려면
어느 수준의 정책을 붙여야 하는지 알 수 없었다. 그래서 그 가이드를 BE 가 단일 소스로 서빙한다.
GET /api/v1/cloud-connections/requirements?provider=AWS&credentialType=ROLE_ARN
→ { credentialOptions, fields[{key,label,whereToFind,example,required,secret}],
steps[{order,title,detail}], recommendedPolicy(JSON 전체본), trustPolicy(ROLE_ARN),
policyName, roleName, notes }
핵심 설계:
- 추천 정책을 FE 에 하드코딩하지 않고 BE 가 서빙한다 — 정책은 우리가 실제 호출하는 AWS 액션에서
나오므로, FE 하드코딩이면 BE 가 액션을 늘릴 때 조용히 낡아 새 연결이 배포 때 권한부족으로 죽는다.
정책은 프로비저닝 코드 옆 리소스 파일(aws/qeploy-aws-*.json)에 두고 통째로 서빙 = 단일 진실원.
- 정책은 코드베이스 전수 스캔으로 도출한 최소권한(ec2/rds/s3/cloudfront/acm/ssm/iam/sts 9개
서비스). S3(qeploy-* 버킷)·SSM(/qeploy/*)·IAM(qeploy-instance-*)로 리소스를 좁혔고, PassRole 은
ec2 서비스로 조건 제한. ECR 은 image-transfer=ECR 일 때만 필요해 기본 정책에서 빼고 노트로 안내.
- ROLE_ARN 기본 권장(장기 키 미저장). 신뢰 정책은 Qeploy 컨트롤 플레인 principal 을 위임 주체로
두며, 그 ARN 은 환경마다 달라 설정으로 받는다(qeploy.cloud-connection.guide.platform-principal-arn).
미설정이면 placeholder + 경고 노트를 노출한다.
- 왜 필요한가: 연결 검증(CloudProviderVerificationClient)은 STS GetCallerIdentity 만 확인하고
프로비저닝 권한은 확인하지 않는다. 그래서 정책을 미리 붙이지 않으면 연결은 CONNECTED 여도
배포에서 실패한다 — 이 함정을 화면에서 미리 알리는 것이 가이드의 목적이다.
테스트: 정책 리소스 파싱 + 코드가 쓰는 핵심 액션 전부 포함(드리프트 가드), ROLE_ARN/ACCESS_KEY
분기, 신뢰정책 placeholder 치환, GCP 미지원. 전체 스위트 통과.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHX8hzKT3JsTTRRvdUkL5K
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
클라우드 연결 화면에서 사용자는 무슨 값을 어디서 가져와 넣을지, 우리가 접근·처리하려면 어느 수준의 IAM 정책을 붙여야 할지 알 수 없습니다. 그 가이드를 BE 가 단일 소스로 서빙합니다.
API
기본값 provider=AWS, credentialType=ROLE_ARN. 지금은 AWS만 지원(사용자 결정), GCP 는 400.
핵심 설계
aws/qeploy-aws-*.json)에 두고 통째로 서빙 = 단일 진실원.qeploy-*버킷)·SSM(/qeploy/*)·IAM(qeploy-instance-*)로 리소스 스코핑, PassRole 은ec2.amazonaws.com조건. ECR 은image-transfer=ECR일 때만이라 기본 정책에서 빼고 노트로 안내.qeploy.cloud-connection.guide.platform-principal-arn, envQEPLOY_CLOUD_CONNECTION_PLATFORM_PRINCIPAL_ARN). 미설정이면 placeholder + 경고 노트.GetCallerIdentity만 확인하고 프로비저닝 권한은 확인 안 합니다. 그래서 정책을 미리 안 붙이면 연결이 CONNECTED 여도 배포에서 실패 — 이 함정을 화면에서 미리 알리는 게 목적.검증
분담
BE(엔드포인트·정책·콘텐츠·계약) = 이 PR. 슬라이드오버 UI 는 FE 세션에 계약 넘김(채팅 프리뷰 위로 슬라이드).
배포 후 필요
운영에서
QEPLOY_CLOUD_CONNECTION_PLATFORM_PRINCIPAL_ARN설정 필요(미설정 시 신뢰정책이 placeholder).🤖 Generated with Claude Code