日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

創建VPC邊界防火墻(防護通過高速通道連接的兩個VPC之間的流量)

本文介紹如何使用Terraform創建VPC邊界防火墻(防護通過高速通道連接的兩個VPC之間的流量)。

注意事項

前提條件

  • 已創建阿里云賬號和訪問密鑰(AccessKey)。具體操作,請參見創建AccessKey

  • 已經安裝并配置了Terraform。

創建VPC邊界防火墻

  1. 在Terraform執行目錄下的terraform.tf文件中,配置如下內容。

    代碼示例如下:

    provider "alicloud" {
      version = "~> 1.203.0"
    }
    
    resource "alicloud_cloud_firewall_vpc_firewall" "default" {
      vpc_firewall_name = "tf-test"
      member_uid        = "141518928482****"
      local_vpc {
        vpc_id    = "vpc-bp1d065m6hzn1xbw8****"
        region_no = "cn-hangzhou"
        local_vpc_cidr_table_list {
          local_route_table_id = "vtb-bp1lj0ddg846856ch****"
          local_route_entry_list {
            local_next_hop_instance_id = "ri-bp1uobww3aputjlww****"
            local_destination_cidr     = "10.XX.XX.0/16"
          }
        }
      }
      peer_vpc {
        vpc_id    = "vpc-bp1gcmm64o3caox84****"
        region_no = "cn-hangzhou"
        peer_vpc_cidr_table_list {
          peer_route_table_id = "vtb-bp1f516f2hh4sok1i****"
          peer_route_entry_list {
            peer_destination_cidr     = "10.XX.XX.0/16"
            peer_next_hop_instance_id = "ri-bp1thhtgf6ydr2or5****"
          }
        }
      }
      status = "open"
    }
  2. 運行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,開始創建。

    代碼示例如下,創建成功后,可以返回VPC邊界防火墻ID為vfw-d7b8ce273791475b****。

    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_vpc_firewall.default will be created
      + resource "alicloud_cloud_firewall_vpc_firewall" "default" {
          + bandwidth         = (known after apply)
          + connect_type      = (known after apply)
          + id                = (known after apply)
          + lang              = (known after apply)
          + member_uid        = "141518928482****"
          + region_status     = (known after apply)
          + status            = "open"
          + vpc_firewall_id   = (known after apply)
          + vpc_firewall_name = "tf-test"
    
          + local_vpc {
              + eni_id                 = (known after apply)
              + eni_private_ip_address = (known after apply)
              + region_no              = "cn-hangzhou"
              + router_interface_id    = (known after apply)
              + vpc_id                 = "vpc-bp1d065m6hzn1xbw8****"
              + vpc_name               = (known after apply)
    
              + local_vpc_cidr_table_list {
                  + local_route_table_id = "vtb-bp1lj0ddg846856ch****"
    
                  + local_route_entry_list {
                      + local_destination_cidr     = "10.XX.XX.0/16"
                      + local_next_hop_instance_id = "ri-bp1uobww3aputjlww****"
                    }
                }
            }
    
          + peer_vpc {
              + eni_id                 = (known after apply)
              + eni_private_ip_address = (known after apply)
              + region_no              = "cn-hangzhou"
              + router_interface_id    = (known after apply)
              + vpc_id                 = "vpc-bp1gcmm64o3caox84****"
              + vpc_name               = (known after apply)
    
              + peer_vpc_cidr_table_list {
                  + peer_route_table_id = "vtb-bp1f516f2hh4sok1i****"
    
                  + peer_route_entry_list {
                      + peer_destination_cidr     = "10.XX.XX.0/16"
                      + peer_next_hop_instance_id = "ri-bp1thhtgf6ydr2or5****"
                    }
                }
            }
        }
    
    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_vpc_firewall.default: Creating...
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [10s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [20s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [30s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [40s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [50s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [1m0s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [1m10s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [1m20s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [1m30s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [1m40s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [1m50s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [2m0s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [2m10s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [2m20s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [2m30s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [2m40s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [2m50s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [3m0s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [3m10s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [3m20s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [3m30s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [3m40s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [3m50s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [4m0s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [4m10s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [4m20s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [4m30s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [4m40s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [4m50s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [5m0s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [5m10s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Still creating... [5m20s elapsed]
    alicloud_cloud_firewall_vpc_firewall.default: Creation complete after 5m26s [id=vfw-d7b8ce273791475b****]
    
    Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

  2. 查看結果。

    • 運行terraform show查看VPC邊界防火墻詳細信息。

      # alicloud_cloud_firewall_vpc_firewall.default:
      resource "alicloud_cloud_firewall_vpc_firewall" "default" {
          bandwidth         = 100
          connect_type      = "expressconnect"
          id                = "vfw-d7b8ce273791475b****"
          member_uid        = "141518928482****"
          status            = "open"
          vpc_firewall_id   = "vfw-d7b8ce273791475b****"
          vpc_firewall_name = "tf-test"
      
          local_vpc {
              eni_id                 = "eni-bp1ho0xiqvydpl74****"
              eni_private_ip_address = "10.XX.XX.173"
              region_no              = "cn-hangzhou"
              router_interface_id    = "ri-bp1uobww3aputjlww****"
              vpc_id                 = "vpc-bp1d065m6hzn1xbw8****"
              vpc_name               = "aihan_test_vpc01"
      
              local_vpc_cidr_table_list {
                  local_route_table_id = "vtb-bp1lj0ddg846856ch****"
      
                  local_route_entry_list {
                      local_destination_cidr     = "10.XX.XX.0/16"
                      local_next_hop_instance_id = "ri-bp1uobww3aputjlww****"
                  }
              }
          }
      
          peer_vpc {
              eni_id                 = "eni-bp19qja9ze9zq7gh****"
              eni_private_ip_address = "10.XX.XX.12"
              region_no              = "cn-hangzhou"
              router_interface_id    = "ri-bp1thhtgf6ydr2or5****"
              vpc_id                 = "vpc-bp1gcmm64o3caox84****"
              vpc_name               = "aihan_test_vpc02"
      
              peer_vpc_cidr_table_list {
                  peer_route_table_id = "vtb-bp1f516f2hh4sok1i****"
      
                  peer_route_entry_list {
                      peer_destination_cidr     = "10.XX.XX.0/16"
                      peer_next_hop_instance_id = "ri-bp1thhtgf6ydr2or5****"
                  }
              }
          }
      }
    • 登錄云防火墻控制臺,在防火墻開關>VPC邊界防火墻頁面,搜索VPC邊界防火墻實例ID查看詳細信息。

      image..png