이 문서에서는 다음 작업을 수행할 수 있도록 권한을 설정하고 액세스를 사용 설정하는 방법을 설명합니다.
- Service Health 대시보드를 사용하여 Personalized Service Health 이벤트를 확인합니다.
- Service Health API를 사용하여 Service Health 정보를 가져옵니다.
- 프로젝트와 관련된 알림을 구성합니다.
시작하기 전에
Google Cloud 프로젝트에 결제가 사용 설정되어 있는지 확인합니다.
Service Health API 및 대시보드 액세스
Service Health API 및 대시보드에 액세스하는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 Personalized Service Health 뷰어(roles/servicehealth.viewer) IAM 역할을 부여해 달라고 요청하세요.
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
커스텀 역할이나 다른 사전 정의된 역할을 통해 필요한 권한을 얻을 수도 있습니다.
gcloud CLI를 통해 역할과 권한을 직접 사용하여 적절한 액세스 제어를 설정할 수 있습니다. 예를 들어 다음 명령어를 사용하여 역할을 직접 부여할 수 있습니다.
gcloud projects add-iam-policy-binding PROJECT_ID \
--member {USER|GROUP|SERVICE_ACCOUNT} \
--role roles/servicehealth.viewer
다음 명령어를 사용하여 지정된 프로젝트의 Identity and Access Management(IAM) 정책을 볼 수 있습니다.
gcloud projects get-iam-policy PROJECT_ID
또는 기존 역할에 권한을 직접 추가할 수 있습니다.
gcloud iam roles update ROLE_ID \
--project=PROJECT_ID \
--permissions="servicehealth.events.get,servicehealth.events.list,servicehealth.impacts.get,servicehealth.impacts.list,servicehealth.locations.get,servicehealth.locations.list,servicehealth.organizationEvents.get,servicehealth.organizationEvents.list,servicehealth.organizationImpacts.get,servicehealth.organizationImpacts.list,servicehealth.statuses.get,resourcemanager.projects.get,resourcemanager.projects.list"
영향을 받는 리소스 세부정보에 대한 액세스 제어(미리보기)
servicehealth.impacts.list 및 servicehealth.impacts.get 권한은 사전 정의된 Service Health 뷰어 역할(roles/servicehealth.viewer)과 기본 뷰어, 편집자, 소유자 역할(roles/viewer, roles/editor, roles/owner)에 포함되어 있습니다.
서비스 중단이 프로젝트의 특정 리소스에 영향을 미치는 경우 이러한 권한을 통해 주 구성원은 프로젝트 전체에서 영향을 받는 리소스의 전체 리소스 이름(assetName)과 리소스 유형(assetType)을 볼 수 있습니다.
주 구성원이 프로젝트에서 영향을 받는 개별 리소스의 이름을 보지 않고 프로젝트 수준 Service Health 이벤트를 보게 하려면 servicehealth.events.get 및 servicehealth.events.list를 포함하지만 servicehealth.impacts.get 및 servicehealth.impacts.list를 생략하는 커스텀 역할을 만듭니다.
gcloud iam roles create EVENT_ONLY_ROLE_ID --project=PROJECT_ID \
--title="Service Health Event-Only Viewer" \
--description="Grants access to Service Health project events without resource-level impact details" \
--permissions="servicehealth.events.get,servicehealth.events.list,servicehealth.locations.get,servicehealth.locations.list,servicehealth.statuses.get,resourcemanager.projects.get"
프로젝트에서 API 및 서비스 사용
- 프로젝트에 Service Health API를 사용 설정합니다.
- 서비스 사용량 소비자 역할(
roles/serviceusage.serviceUsageConsumer)을 부여합니다.
로그 액세스 및 로그 알림 구성
다음 단계를 따르세요.
- 프로젝트에 Service Health API를 사용 설정합니다.
- 로그 기반 알림 권한을 가져옵니다.
모니터링 NotificationChannel 편집자 역할(roles/monitoring.notificationChannelEditor)을 부여하지 않으려면 대신 모니터링 NotificationChannel 뷰어 역할(roles/monitoring.notificationChannelViewer)을 부여하여 알림 채널을 알림 정책에 연결할 수 있습니다.
역할 부여 방법에 대한 자세한 내용은 액세스 관리를 참조하세요.
커스텀 역할이나 다른 사전 정의된 역할을 통해 필요한 권한을 얻을 수도 있습니다.
단일 프로젝트에 Service Health API 사용 설정
알림을 설정하고 Service Health 정보를 가져오려면 Service Health API를 사용 설정해야 합니다.Google Cloud 콘솔 또는 Google Cloud CLI를 통해 API를 사용 설정할 수 있습니다.
콘솔
API 및 서비스 라이브러리에서 Service Health API로 이동합니다.
또는 API 라이브러리로 이동하여 'Service Health API'를 검색할 수 있습니다.
프로젝트를 선택합니다.
사용 설정 버튼을 선택합니다.
gcloud
-
Google Cloud 콘솔에서 Cloud Shell을 활성화합니다.
최신 버전의 Google Cloud CLI가 설치되어 있는지 확인합니다. Cloud Shell에서 다음 명령어를 실행합니다.
gcloud components update
새 프로젝트
PROJECT_ID를 만들거나 선택합니다.Google Cloud 프로젝트를 만듭니다.
gcloud projects create PROJECT_ID
만든 Google Cloud 프로젝트를 선택합니다.
gcloud projects config set project PROJECT_ID
방금 만든 프로젝트에서 Service Health API를 사용 설정합니다.
gcloud services enable servicehealth.googleapis.com \ --project PROJECT_ID
스크립트
스크립트를 사용하여 조직 또는 폴더의 프로젝트에 Service Health API를 사용 설정할 수 있습니다.
Service Health API 및 알림은 API 사용 설정 후 몇 시간 후에 새 이벤트를 인식합니다.