ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ฌ ์ญํ ๋ถ์ฌ
Resource Manager API์์ ์ข์ํ๋ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด๋ก IAM ๋ฉ์๋๋ฅผ ์์ํ๋ ๋ฐฉ๋ฒ์ ์์๋ด ๋๋ค.
Google Cloud ์ฝ์์์ ์ด ํ์คํฌ์ ๋ํ ๋จ๊ณ๋ณ ์๋ด๋ฅผ ์ง์ ์ํํ๋ ค๋ฉด ๋๋ฌ๋ณด๊ธฐ๋ฅผ ํด๋ฆญํฉ๋๋ค.
์์ํ๊ธฐ ์ ์
Google Cloud ํ๋ก์ ํธ ๋ง๋ค๊ธฐ
์ด ๋น ๋ฅธ ์์์์๋ ์ Google Cloud ํ๋ก์ ํธ๊ฐ ํ์ํฉ๋๋ค.
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
Install the Google Cloud CLI.
-
์ธ๋ถ ID ๊ณต๊ธ์ ์ฒด(IdP)๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋จผ์ ์ ํด ID๋ก gcloud CLI์ ๋ก๊ทธ์ธํด์ผ ํฉ๋๋ค.
-
gcloud CLI๋ฅผ ์ด๊ธฐํํ๋ ค๋ฉด, ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
gcloud init
-
Create or select a Google Cloud project.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_ID
with a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_ID
with your Google Cloud project name.
-
-
Enable the Resource Manager API:
gcloud services enable cloudresourcemanager.googleapis.com
-
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/resourcemanager.projectIamAdmin
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID
: your project ID.USER_IDENTIFIER
: the identifier for your user accountโfor example,myemail@example.com
.ROLE
: the IAM role that you grant to your user account.
-
Install the Google Cloud CLI.
-
์ธ๋ถ ID ๊ณต๊ธ์ ์ฒด(IdP)๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋จผ์ ์ ํด ID๋ก gcloud CLI์ ๋ก๊ทธ์ธํด์ผ ํฉ๋๋ค.
-
gcloud CLI๋ฅผ ์ด๊ธฐํํ๋ ค๋ฉด, ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
gcloud init
-
Create or select a Google Cloud project.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_ID
with a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_ID
with your Google Cloud project name.
-
-
Enable the Resource Manager API:
gcloud services enable cloudresourcemanager.googleapis.com
-
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/resourcemanager.projectIamAdmin
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID
: your project ID.USER_IDENTIFIER
: the identifier for your user accountโfor example,myemail@example.com
.ROLE
: the IAM role that you grant to your user account.
- Google Cloudํ๋ก์ ํธ๋ฅผ ๊ด๋ฆฌํ๋ Resource Manager ์๋น์ค๋ฅผ ์ด๊ธฐํํฉ๋๋ค.
- ํ๋ก์ ํธ์ ํ์ฉ ์ ์ฑ ์ ์ฝ์ต๋๋ค.
- Google ๊ณ์ ์ ๋ก๊ทธ ์์ฑ์ ์ญํ (
roles/logging.logWriter
)์ ๋ถ์ฌํ์ฌ ํ์ฉ ์ ์ฑ ์ ์์ ํฉ๋๋ค. - ์ ๋ฐ์ดํธ๋ ํ์ฉ ์ ์ฑ ์ ์์ฑํฉ๋๋ค.
- ํ๋ก์ ํธ ์์ค์์ ๋ก๊ทธ ์์ฑ์ ์ญํ (
roles/logging.logWriter
)์ด ์๋ ๋ชจ๋ ์ฃผ ๊ตฌ์ฑ์์ ์ถ๋ ฅํฉ๋๋ค. - ๋ก๊ทธ ์์ฑ์ ์ญํ ์ ์ทจ์ํฉ๋๋ค.
your-project
: ํ๋ก์ ํธ์ ID์ ๋๋ค.your-member
: ์ฌ์ฉ์ ๊ณ์ ์ ์ด๋ฉ์ผ ์ฃผ์์ ๋๋ค. ์๋ฅผ ๋ค๋ฉดuser:my-user@example.com
์ ๋๋ค.-
Optional: Revoke the authentication credentials that you created, and delete the local credential file.
gcloud auth application-default revoke
-
Optional: Revoke credentials from the gcloud CLI.
gcloud auth revoke
- IAM์ ์๋ ์๋ฆฌ ์ฝ์ด๋ณด๊ธฐ
- ์ก์ธ์ค ๊ถํ ๋ถ์ฌ, ๋ณ๊ฒฝ, ์ทจ์ ์์ธํ ์์๋ณด๊ธฐ
- ์ ์ฑ ๋ฌธ์ ํด๊ฒฐ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์ก์ธ์ค ๋ฌธ์ ํด๊ฒฐํ๊ธฐ
ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
C#
C# ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ์ ๊ดํ ์์ธํ ๋ด์ฉ์ C# ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ๊ฐ์ด๋๋ฅผ ์ฐธ์กฐํ์ธ์.
install-package Google.Apis.Iam.v1 install-package Google.Apis.CloudResourceManager.v1
Go
go get golang.org/x/oauth2/google go get google.golang.org/api/cloudresourcemanager/v1
Java
์๋ฐ ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ์ ๊ดํ ์์ธํ ๋ด์ฉ์ ์๋ฐ ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ๊ฐ์ด๋๋ฅผ ์ฐธ์กฐํ์ธ์.
Maven์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐpom.xml
ํ์ผ์ ๋ค์์ ์ถ๊ฐํฉ๋๋ค.
Python
Python ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ์ ๊ดํ ์์ธํ ๋ด์ฉ์ Python ๊ฐ๋ฐ ํ๊ฒฝ ์ค์ ๊ฐ์ด๋๋ฅผ ์ฐธ์กฐํ์ธ์.
pip install --upgrade google-api-python-client google-auth google-auth-httplib2
ํ์ฉ ์ ์ฑ ์ฝ๊ธฐ, ์์ , ์ฐ๊ธฐ
์ด ๋น ๋ฅธ ์์์ ์ฝ๋ ์ค๋ํซ์ ๋ค์ ์์ ์ ์ํํฉ๋๋ค.
์ฝ๋ ์ค๋ํซ์ ์คํํ๊ธฐ ์ ์ ๋ค์ ๊ฐ์ ๋ฐ๊ฟ๋๋ค.
C#
Resource Manager์ ๋ํด ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ๊ณ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ Resource Manager ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์. ์์ธํ ๋ด์ฉ์ Resource Manager C# API ์ฐธ๊ณ ๋ฌธ์๋ฅผ ํ์ธํ์ธ์.
Resource Manager์ ์ธ์ฆํ๋ ค๋ฉด ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์ ์ธ์ฆ ์ค์ ์ ์ฐธ์กฐํ์ธ์.
Go
Resource Manager์ ๋ํด ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ๊ณ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ Resource Manager ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์. ์์ธํ ๋ด์ฉ์ Resource Manager Go API ์ฐธ๊ณ ๋ฌธ์๋ฅผ ํ์ธํ์ธ์.
Resource Manager์ ์ธ์ฆํ๋ ค๋ฉด ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์ ์ธ์ฆ ์ค์ ์ ์ฐธ์กฐํ์ธ์.
Java
Resource Manager์ ๋ํด ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ๊ณ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ Resource Manager ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์. ์์ธํ ๋ด์ฉ์ Resource Manager Java API ์ฐธ๊ณ ๋ฌธ์๋ฅผ ํ์ธํ์ธ์.
Resource Manager์ ์ธ์ฆํ๋ ค๋ฉด ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์ ์ธ์ฆ ์ค์ ์ ์ฐธ์กฐํ์ธ์.
Python
Resource Manager์ ๋ํด ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ๊ณ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ Resource Manager ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์. ์์ธํ ๋ด์ฉ์ Resource Manager Python API ์ฐธ๊ณ ๋ฌธ์๋ฅผ ํ์ธํ์ธ์.
Resource Manager์ ์ธ์ฆํ๋ ค๋ฉด ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์ ์ธ์ฆ ์ค์ ์ ์ฐธ์กฐํ์ธ์.
์๊ณ ํ์ จ์ต๋๋ค. Resource Manager API์ IAM ๋ฉ์๋๋ฅผ ์ฌ์ฉํ์ฌ ํ๋ก์ ํธ์ ์ก์ธ์ค ๊ถํ์ ์์ ํ์ต๋๋ค.
์ด๋ ๋์?
์ญ์
๋ค์ ๋จ๊ณ