インスタンスを作成してアクセスする
Secure Source Manager インスタンスを作成し、そのウェブ インターフェースにアクセスして、リポジトリの作成とユーザーへのアクセス権の付与の準備をします。
始める前に
- 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.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
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.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Secure Source Manager API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles.gcloud services enable securesourcemanager.googleapis.com
-
Install the Google Cloud CLI.
-
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
-
gcloud CLI を初期化するには、次のコマンドを実行します。
gcloud init
-
Create or select a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
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.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Secure Source Manager API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles.gcloud services enable securesourcemanager.googleapis.com
beta
Google Cloud CLI コンポーネントをインストールします。gcloud components install beta
次のコマンドを実行して、
us-central1
ロケーションにmy-instance
という名前のインスタンスを作成します。gcloud CLI への認証を求められることがあります。gcloud beta source-manager instances create my-instance \ --region=us-central1
ここで
my-instance
はインスタンス名です。us-central1
は、インスタンスを作成するリージョンです。
長時間実行のインスタンス作成オペレーションが開始されます。出力は次のようになります。
Create request issued for [my-instance]. done: false metadata: '@type': type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata apiVersion: v1 createTime: '2023-02-27T20:57:52.315609549Z' requestedCancellation: false target: projects/PROJECT_ID/locations/us-central1/instances/my-instance verb: create name: projects/PROJECT_ID/locations/us-central1/operations/operation-1234567894561-5ec69948c0f2b-60dd727f-a9b97a2e
ここで
projects/PROJECT_ID/locations/us-central1/operations/operation-1234567894561-5ec69948c0f2b-60dd727f-a9b97a2e
はOPERATION_NAME
です。PROJECT_ID
はプロジェクト ID です。
インスタンスの作成には最大 60 分かかります。
OPERATION_NAME
は、オペレーションのステータスを確認するために使用する必要があるため、メモしておきます。次のコマンドを実行して、
create
オペレーションのステータスを確認します。gcloud beta source-manager operations describe OPERATION_NAME \ --region=us-central1
次のように置き換えます。
OPERATION_NAME
: 作成コマンドのレスポンスから取得したオペレーション名。
インスタンスの準備が完了すると、次のようなレスポンスが返されます。
{ "name": "projects/PROJECT_ID/locations/us-central1/operations/operation-123456789012-5ec69948c0f2b-60dd727f-a9b97a2e", "metadata": { "@type": "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata", "createTime": "2022-11-01T14:31:32.420469714Z", "endTime": "2022-11-01T14:48:34.140378114Z", "target": "projects/PROJECT_ID/locations/us-central1/instances/my-instance", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": true, "response": { "@type": "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance", "name": "projects/PROJECT_ID/locations/us-central1/instances/my-instance", "createTime": "2022-11-01T14:31:32.416413630Z", "updateTime": "2022-11-01T14:31:32.416413630Z" }, "state": "ACTIVE", "hostConfig": { "html": "my-instance-098765432109.us-central1.sourcemanager.dev", "api": "my-instance-098765432109-api.us-central1.sourcemanager.dev", "gitHttp": "my-instance-098765432109-git.us-central1.sourcemanager.dev" } } }
ここで
my-instance-098765432109.us-central1.sourcemanager.dev
はインスタンスの HTML URL です。PROJECT_ID
はプロジェクト ID です。
正常に作成されたステータス確認コマンドから HTML URL をコピーします。この URL は、ウェブブラウザからインスタンスにアクセスするために必要です。
インスタンスの HTML URL を取得するには、次のコマンドをもう一度実行します。
gcloud beta source-manager operations describe OPERATION_NAME \ --region=us-central1
gcloud beta source-manager operations describe
コマンドからの成功レスポンスから HTML URL をコピーし、ブラウザのアドレスバーに貼り付けます。OAuth 2.0 画面が表示され、
sourcemanager.dev
に Google Cloud アカウントへのアクセス権を付与するかどうかを尋ねられます。[許可] ボタンをクリックします。
Secure Source Manager のウェブ インターフェースが開きます。ウェブ インターフェースから、リポジトリと関連するすべての問題と pull リクエストを作成して表示できます。
必要なロール
Secure Source Manager インスタンスの作成に必要な権限を取得するには、 Google Cloud プロジェクトに対するインスタンス オーナー (roles/securesourcemanager.instanceOwner
)IAM ロールの付与を管理者に依頼してください。
Secure Source Manager のロールは、プリンシパルに付与されるまで Google Cloud コンソールに表示されません。Secure Source Manager ロールを初めて付与するには、IAM ロールを付与して取り消すをご覧ください。
インスタンスの作成
インスタンスにアクセスする
インスタンスの作成後、ブラウザを使用してウェブ インターフェースからインスタンスにアクセスできます。
クリーンアップ
このページで使用したリソースについて、 Google Cloud アカウントに課金されないようにするには、リソースを含む Google Cloud プロジェクトを削除します。
Delete a Google Cloud project:
gcloud projects delete PROJECT_ID