Day 1 - GCP 기초
프로젝트 · gcloud CLI · IAM · 결제·API
목차
학습 목표
- Project / Folder / Organization 계층 이해
gcloud로 프로젝트 전환·API 활성화- 서비스 계정과 역할(Role) 구분
핵심 개념
| 용어 | 설명 |
|---|---|
| Project | 리소스·빌링·권한의 기본 단위 |
| Billing account | 결제 계정 (프로젝트에 연결) |
| IAM | 누가(who) 무엇을(role) 어디에(resource) |
| Service Account | 애플리케이션용 신원 |
| Region / Zone | 리전·존 (예: asia-northeast3) |
gcloud 설치·로그인
# macOS
brew install --cask google-cloud-sdk
gcloud init
gcloud auth login
gcloud auth application-default login # 로컬 앱·Terraform용
gcloud config list
프로젝트 설정
# 프로젝트 목록
gcloud projects list
# 기본 프로젝트
gcloud config set project PROJECT_ID
# 자주 쓰는 API 활성화 예
gcloud services enable compute.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable storage.googleapis.com
IAM 기본
- Primitive roles: Owner / Editor / Viewer (넓음 — 실습 외 지양)
- Predefined roles:
roles/compute.instanceAdmin.v1등 - 사람 계정 vs 서비스 계정 키 관리 (키 파일 커밋 금지)
gcloud projects get-iam-policy PROJECT_ID
실습
- 새 프로젝트 생성 · 결제 연결
gcloud config set project확인- Compute API 활성화
- (선택) 서비스 계정 1개 생성 후 역할 부여