すべてのプロダクト
Search
ドキュメントセンター

Cloud Firewall:Cloud Firewall へのメンバーアカウントの追加

最終更新日:Nov 09, 2025

このトピックでは、Terraform を使用して Cloud Firewall にメンバーアカウントを追加する方法について説明します。

使用上の注意

  • Terraform ランタイム環境: Cloud Shell

  • Terraform バージョン: 0.12

  • alicloud バージョン: 1.203.0

  • リソース定義: cloud_firewall_instance_member

前提条件

  • Alibaba Cloud アカウントと AccessKey ペアが作成されていること。 詳細については、「AccessKey ペアの作成」をご参照ください。

  • Terraform がインストールされ、構成されていること。

Cloud Firewall へのメンバーアカウントの追加

  1. Terraform の作業ディレクトリで、次の内容を terraform.tf ファイルに追加します。

    次のコードは例を示しています。

    provider "alicloud" {
      version = "~> 1.203.0"
    }
    
    resource "alicloud_cloud_firewall_instance_member" "default" {
      member_desc = "Added memberUid by Terraform"
      member_uid  = 180998553943****
    }

  1. terraform init を実行して環境を初期化します。

    次のコードは例を示しています。

    Initializing the backend...
    
    Initializing provider plugins...
    - Checking for available provider plugins...
    - Downloading plugin for provider "alicloud" (hashicorp/alicloud) 1.203.0...
    
    
    Warning: registry.terraform.io: For users on Terraform 0.13 or greater, this provider has moved to aliyun/alicloud. Please update your source in required_providers.
    
    
    Terraform has been successfully initialized!
    
    You may now begin working with Terraform. Try running "terraform plan" to see
    any changes that are required for your infrastructure. All Terraform commands
    should now work.
    
    If you ever set or change modules or backend configuration for Terraform,
    rerun this command to reinitialize your working directory. If you forget, other
    commands will detect it and remind you to do so if necessary.

  1. terraform apply を実行します。構成情報が表示されたら、構成を確認し、yes と入力して変更を適用します。

    次のコードは例を示しています。

    Terraform will perform the following actions:
    
      # alicloud_cloud_firewall_instance_member.default will be created
      + resource "alicloud_cloud_firewall_instance_member" "default" {
          + create_time         = (known after apply)
          + id                  = (known after apply)
          + member_desc         = "Added memberUid by Terraform"
          + member_display_name = (known after apply)
          + member_uid          = "180998553943****"
          + modify_time         = (known after apply)
          + status              = (known after apply)
        }
    
    Plan: 1 to add, 0 to change, 0 to destroy.
    
    Do you want to perform these actions?
      Terraform will perform the actions described above.
      Only 'yes' will be accepted to approve.
    
      Enter a value: yes
    
    alicloud_cloud_firewall_instance_member.default: Creating...
    alicloud_cloud_firewall_instance_member.default: Creation complete after 9s [id=180998553943****]
    
    Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

    メンバーアカウントが作成されると、180998553943**** のような ID が返されます。

  2. 結果の表示

    • terraform show を実行して、Cloud Firewall メンバーアカウントの詳細を表示します。

      # alicloud_cloud_firewall_instance_member.default:
      resource "alicloud_cloud_firewall_instance_member" "default" {
          create_time         = 1681899524
          id                  = "180998553943****"
          member_desc         = "Added memberUid by Terraform"
          member_display_name = "beaver_qa3"
          member_uid          = "180998553943****"
          modify_time         = 1681899524
          status              = "normal"
      }
    • Cloud Firewall コンソールにログインします。[システム設定] > [マルチアカウント] [管理] ページで、Cloud Firewall メンバーアカウントの詳細を表示できます。