管理ハブを有効にして管理する

このページでは、Management Hub を有効にして管理する方法について説明します。

管理ハブを有効にする

コマンドライン

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. gcloud alpha storage management-hub enable コマンドを使用して、プロジェクト、フォルダ、または組織で Management Hub を有効にします。以降のセクションでは、リソースタイプごとにこのコマンドの使用方法について説明します。

    プロジェクトで管理ハブを有効にする

    gcloud alpha storage management-hub enable --project=PROJECT_ID

    ここで

    PROJECT_ID は、 Google Cloud プロジェクト ID です。プロジェクト ID は英数字です(例: my-project)。

    フォルダで管理ハブを有効にする

    gcloud alpha storage management-hub enable --sub-folder=FOLDER_ID

    ここで

    FOLDER_ID は Google Cloud フォルダ ID です。フォルダ ID は数値です(例: 123456789012)。

    組織で管理ハブを有効にする

    gcloud alpha storage management-hub enable --organization=ORGANIZATION_ID

    ここで

    ORGANIZATION_ID は Google Cloud 組織 ID です。組織 ID は数値で指定します(例: 123456789012)。

    名前ベースのバケット フィルタを適用するには、次のフラグを使用します。

    • --exclude-bucket-ids: Management Hub プランから除外するバケット ID のリスト。
    • --exclude-bucket-regexes: Management Hub プランから除外するバケット ID の正規表現のリスト。
    • --include-bucket-ids: Management Hub プランに含めるバケット ID のリスト。
    • --include-bucket-regexes: Management Hub プランに含めるバケット ID の正規表現のリスト。

    次に例を示します。

    $gcloud alpha storage management-hub enable --organization=my-org --exclude-bucket-ids="my-bucket" --exclude-bucket-regexes="my-bucket-.*"

    位置情報ベースのバケット フィルタを適用するには、次のフラグを使用します。

    • --exclude-locations: Management Hub プランから除外するロケーションのリスト。
    • --include-locations: Management Hub プランに含めるロケーションのリスト。

    次に例を示します。

    $gcloud alpha storage management-hub enable --sub-folder=123456 --include-locations="us-east1","us-west1"

管理ハブの構成を表示する

このセクションでは、リソースの Management Hub 構成を表示する方法について説明します。

コマンドライン

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. gcloud alpha storage management-hub describe コマンドを使用して、プロジェクト、フォルダ、または組織の Management Hub 構成を表示します。以降のセクションでは、リソースタイプごとにこのコマンドの使用方法について説明します。

    プロジェクトの Management Hub 構成を表示する

    gcloud alpha storage management-hub describe --project=PROJECT_ID

    ここで

    PROJECT_ID は、 Google Cloud プロジェクト ID です。プロジェクト ID は英数字です(例: my-project)。

    フォルダの Management Hub 構成を表示する

    gcloud alpha storage management-hub view --sub-folder=FOLDER_ID

    ここで

    FOLDER_ID は Google Cloud フォルダ ID です。フォルダ ID は数値です(例: 123456789012)。

    組織の Management Hub の構成を表示する

    gcloud alpha storage management-hub describe --organization=ORGANIZATION_ID

    ここで

    ORGANIZATION_ID は Google Cloud 組織 ID です。組織 ID は数値で指定します(例: 123456789012)。

管理ハブの構成を更新する

このセクションでは、リソースの Management Hub 構成を更新する方法について説明します。

コマンドライン

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. gcloud alpha storage management-hub update コマンドを使用して、プロジェクト、フォルダ、または組織の Management Hub 構成を更新します。以降のセクションでは、リソースタイプごとにこのコマンドの使用方法について説明します。

    プロジェクトの Management Hub 構成を更新する

    gcloud alpha storage management-hub update --project=PROJECT_ID

    ここで

    PROJECT_ID は、 Google Cloud プロジェクト ID です。プロジェクト ID は英数字です(例: my-project)。

    フォルダの Management Hub 構成を更新する

    開発環境で次のコマンドを実行します。

    gcloud alpha storage management-hub update --sub-folder=FOLDER_ID

    ここで

    FOLDER_ID は Google Cloud フォルダ ID です。フォルダ ID は数値です(例: 123456789012)。

    組織の Management Hub 構成を更新する

    gcloud alpha storage management-hub update --organization=ORGANIZATION_ID

    ここで

    ORGANIZATION_ID は Google Cloud 組織 ID です。組織 ID は数値で指定します(例: 123456789012)。

    バケット フィルタを適用する方法については、バケット フィルタを適用するをご覧ください。

管理ハブを無効にする

このセクションでは、Management Hub を無効にする方法について説明します。

コマンドライン

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. gcloud alpha storage management-hub disable コマンドを使用して、プロジェクト、フォルダ、または組織で Management Hub を無効にします。以降のセクションでは、リソースタイプごとにこのコマンドの使用方法について説明します。

    gcloud alpha storage management-hub disable --project=PROJECT_ID

    ここで

    PROJECT_ID は、 Google Cloud プロジェクト ID です。プロジェクト ID は英数字です(例: my-project)。

    フォルダの管理ハブを無効にする

    gcloud alpha storage management-hub disable --sub-folder=FOLDER_ID

    ここで

    FOLDER_ID は Google Cloud フォルダ ID です。フォルダ ID は数値です(例: 123456789012)。

    組織の管理ハブを無効にする

    gcloud alpha storage management-hub disable --organization=ORGANIZATION_ID

    ここで

    ORGANIZATION_ID は Google Cloud 組織 ID です。組織 ID は数値で指定します(例: 123456789012)。

次のステップ