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

Cloud Firewall:インターネットファイアウォール用に作成されたアクセス制御ポリシーの優先度を変更する

最終更新日:Aug 14, 2024

このトピックでは、Terraformを使用してインターネットファイアウォール用に作成されたアクセス制御ポリシーの優先度を変更する方法について説明します。

前提条件

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

  • Terraformがインストールされ、設定されます。

使用上の注意

手順

  1. Terraformの実行ディレクトリで、terraform.tfファイルを設定します。

    以下にコードの例を示します。

    provider "alicloud" {
      version = "~> 1.203.0"
    }
    
    resource "alicloud_cloud_firewall_control_policy_order" "example" {
      acl_uuid  = "1b5f9953-0a00-46d6-8282-0cf08ff5****"
      direction = "out"
      order     = 1
    }

  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と入力し、アクセス制御ポリシーの優先順位を変更します。

    次のコードは例を提供します。 コードの実行後、IDが1b5f9953-0a00-46d6-8282-0cf08ff5 **** である送信アクセス制御ポリシーの優先度が変更されます。

    An execution plan has been generated and is shown below.
    Resource actions are indicated with the following symbols:
      + create
    
    Terraform will perform the following actions:
    
      # alicloud_cloud_firewall_control_policy_order.example will be created
      + resource "alicloud_cloud_firewall_control_policy_order" "example" {
          + acl_uuid  = "1b5f9953-0a00-46d6-8282-0cf08ff5****"
          + direction = "out"
          + id        = (known after apply)
          + order     = 1
        }
    
    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_control_policy_order.example: Creating...
    alicloud_cloud_firewall_control_policy_order.example: Creation complete after 1s [id=1b5f9953-0a00-46d6-8282-0cf08ff5****:out]

  2. 結果を表示します。

    • terraform showコマンドを実行して、変更後のアクセス制御ポリシーの優先度を表示します。

      # alicloud_cloud_firewall_control_policy_order.example:
      resource "alicloud_cloud_firewall_control_policy_order" "example" {
          acl_uuid  = "1b5f9953-0a00-46d6-8282-0cf08ff5****"
          direction = "out"
          id        = "1b5f9953-0a00-46d6-8282-0cf08ff5****:out"
          order     = 1
      }
    • Cloud Firewallコンソールにログインし、[アクセス制御] > [インターネットボーダー] ページに移動します。 [Internet Border] ページで、ポリシーIDを使用してアクセス制御ポリシーを検索し、変更後のアクセス制御ポリシーの優先度を表示します。