1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CfwEdgeFirewallSwitch
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.CfwEdgeFirewallSwitch

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a cfw edge_firewall_switch

    Example Usage

    If not set subnet_id

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleCfwEdgeFwSwitches = tencentcloud.getCfwEdgeFwSwitches({});
    const exampleCfwEdgeFirewallSwitch = new tencentcloud.CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch", {
        publicIp: exampleCfwEdgeFwSwitches.then(exampleCfwEdgeFwSwitches => exampleCfwEdgeFwSwitches.datas?.[0]?.publicIp),
        switchMode: 1,
        enable: 0,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_cfw_edge_fw_switches = tencentcloud.get_cfw_edge_fw_switches()
    example_cfw_edge_firewall_switch = tencentcloud.CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch",
        public_ip=example_cfw_edge_fw_switches.datas[0].public_ip,
        switch_mode=1,
        enable=0)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleCfwEdgeFwSwitches, err := tencentcloud.GetCfwEdgeFwSwitches(ctx, &tencentcloud.GetCfwEdgeFwSwitchesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCfwEdgeFirewallSwitch(ctx, "exampleCfwEdgeFirewallSwitch", &tencentcloud.CfwEdgeFirewallSwitchArgs{
    			PublicIp:   pulumi.String(exampleCfwEdgeFwSwitches.Datas[0].PublicIp),
    			SwitchMode: pulumi.Float64(1),
    			Enable:     pulumi.Float64(0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleCfwEdgeFwSwitches = Tencentcloud.GetCfwEdgeFwSwitches.Invoke();
    
        var exampleCfwEdgeFirewallSwitch = new Tencentcloud.CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch", new()
        {
            PublicIp = exampleCfwEdgeFwSwitches.Apply(getCfwEdgeFwSwitchesResult => getCfwEdgeFwSwitchesResult.Datas[0]?.PublicIp),
            SwitchMode = 1,
            Enable = 0,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetCfwEdgeFwSwitchesArgs;
    import com.pulumi.tencentcloud.CfwEdgeFirewallSwitch;
    import com.pulumi.tencentcloud.CfwEdgeFirewallSwitchArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var exampleCfwEdgeFwSwitches = TencentcloudFunctions.getCfwEdgeFwSwitches();
    
            var exampleCfwEdgeFirewallSwitch = new CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch", CfwEdgeFirewallSwitchArgs.builder()
                .publicIp(exampleCfwEdgeFwSwitches.applyValue(getCfwEdgeFwSwitchesResult -> getCfwEdgeFwSwitchesResult.datas()[0].publicIp()))
                .switchMode(1)
                .enable(0)
                .build());
    
        }
    }
    
    resources:
      exampleCfwEdgeFirewallSwitch:
        type: tencentcloud:CfwEdgeFirewallSwitch
        properties:
          publicIp: ${exampleCfwEdgeFwSwitches.datas[0].publicIp}
          switchMode: 1
          enable: 0
    variables:
      exampleCfwEdgeFwSwitches:
        fn::invoke:
          function: tencentcloud:getCfwEdgeFwSwitches
          arguments: {}
    

    If set subnet id

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleCfwEdgeFwSwitches = tencentcloud.getCfwEdgeFwSwitches({});
    const exampleCfwEdgeFirewallSwitch = new tencentcloud.CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch", {
        publicIp: exampleCfwEdgeFwSwitches.then(exampleCfwEdgeFwSwitches => exampleCfwEdgeFwSwitches.datas?.[0]?.publicIp),
        subnetId: "subnet-id",
        switchMode: 1,
        enable: 1,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_cfw_edge_fw_switches = tencentcloud.get_cfw_edge_fw_switches()
    example_cfw_edge_firewall_switch = tencentcloud.CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch",
        public_ip=example_cfw_edge_fw_switches.datas[0].public_ip,
        subnet_id="subnet-id",
        switch_mode=1,
        enable=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleCfwEdgeFwSwitches, err := tencentcloud.GetCfwEdgeFwSwitches(ctx, &tencentcloud.GetCfwEdgeFwSwitchesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCfwEdgeFirewallSwitch(ctx, "exampleCfwEdgeFirewallSwitch", &tencentcloud.CfwEdgeFirewallSwitchArgs{
    			PublicIp:   pulumi.String(exampleCfwEdgeFwSwitches.Datas[0].PublicIp),
    			SubnetId:   pulumi.String("subnet-id"),
    			SwitchMode: pulumi.Float64(1),
    			Enable:     pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleCfwEdgeFwSwitches = Tencentcloud.GetCfwEdgeFwSwitches.Invoke();
    
        var exampleCfwEdgeFirewallSwitch = new Tencentcloud.CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch", new()
        {
            PublicIp = exampleCfwEdgeFwSwitches.Apply(getCfwEdgeFwSwitchesResult => getCfwEdgeFwSwitchesResult.Datas[0]?.PublicIp),
            SubnetId = "subnet-id",
            SwitchMode = 1,
            Enable = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetCfwEdgeFwSwitchesArgs;
    import com.pulumi.tencentcloud.CfwEdgeFirewallSwitch;
    import com.pulumi.tencentcloud.CfwEdgeFirewallSwitchArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var exampleCfwEdgeFwSwitches = TencentcloudFunctions.getCfwEdgeFwSwitches();
    
            var exampleCfwEdgeFirewallSwitch = new CfwEdgeFirewallSwitch("exampleCfwEdgeFirewallSwitch", CfwEdgeFirewallSwitchArgs.builder()
                .publicIp(exampleCfwEdgeFwSwitches.applyValue(getCfwEdgeFwSwitchesResult -> getCfwEdgeFwSwitchesResult.datas()[0].publicIp()))
                .subnetId("subnet-id")
                .switchMode(1)
                .enable(1)
                .build());
    
        }
    }
    
    resources:
      exampleCfwEdgeFirewallSwitch:
        type: tencentcloud:CfwEdgeFirewallSwitch
        properties:
          publicIp: ${exampleCfwEdgeFwSwitches.datas[0].publicIp}
          subnetId: subnet-id
          switchMode: 1
          enable: 1
    variables:
      exampleCfwEdgeFwSwitches:
        fn::invoke:
          function: tencentcloud:getCfwEdgeFwSwitches
          arguments: {}
    

    Create CfwEdgeFirewallSwitch Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CfwEdgeFirewallSwitch(name: string, args: CfwEdgeFirewallSwitchArgs, opts?: CustomResourceOptions);
    @overload
    def CfwEdgeFirewallSwitch(resource_name: str,
                              args: CfwEdgeFirewallSwitchArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def CfwEdgeFirewallSwitch(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              enable: Optional[float] = None,
                              public_ip: Optional[str] = None,
                              switch_mode: Optional[float] = None,
                              cfw_edge_firewall_switch_id: Optional[str] = None,
                              subnet_id: Optional[str] = None)
    func NewCfwEdgeFirewallSwitch(ctx *Context, name string, args CfwEdgeFirewallSwitchArgs, opts ...ResourceOption) (*CfwEdgeFirewallSwitch, error)
    public CfwEdgeFirewallSwitch(string name, CfwEdgeFirewallSwitchArgs args, CustomResourceOptions? opts = null)
    public CfwEdgeFirewallSwitch(String name, CfwEdgeFirewallSwitchArgs args)
    public CfwEdgeFirewallSwitch(String name, CfwEdgeFirewallSwitchArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CfwEdgeFirewallSwitch
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CfwEdgeFirewallSwitchArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CfwEdgeFirewallSwitchArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CfwEdgeFirewallSwitchArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CfwEdgeFirewallSwitchArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CfwEdgeFirewallSwitchArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CfwEdgeFirewallSwitch Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CfwEdgeFirewallSwitch resource accepts the following input properties:

    Enable double
    Switch, 0: off, 1: on.
    PublicIp string
    Public Ip.
    SwitchMode double
    0: bypass; 1: serial.
    CfwEdgeFirewallSwitchId string
    ID of the resource.
    SubnetId string
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    Enable float64
    Switch, 0: off, 1: on.
    PublicIp string
    Public Ip.
    SwitchMode float64
    0: bypass; 1: serial.
    CfwEdgeFirewallSwitchId string
    ID of the resource.
    SubnetId string
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    enable Double
    Switch, 0: off, 1: on.
    publicIp String
    Public Ip.
    switchMode Double
    0: bypass; 1: serial.
    cfwEdgeFirewallSwitchId String
    ID of the resource.
    subnetId String
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    enable number
    Switch, 0: off, 1: on.
    publicIp string
    Public Ip.
    switchMode number
    0: bypass; 1: serial.
    cfwEdgeFirewallSwitchId string
    ID of the resource.
    subnetId string
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    enable float
    Switch, 0: off, 1: on.
    public_ip str
    Public Ip.
    switch_mode float
    0: bypass; 1: serial.
    cfw_edge_firewall_switch_id str
    ID of the resource.
    subnet_id str
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    enable Number
    Switch, 0: off, 1: on.
    publicIp String
    Public Ip.
    switchMode Number
    0: bypass; 1: serial.
    cfwEdgeFirewallSwitchId String
    ID of the resource.
    subnetId String
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CfwEdgeFirewallSwitch resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CfwEdgeFirewallSwitch Resource

    Get an existing CfwEdgeFirewallSwitch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CfwEdgeFirewallSwitchState, opts?: CustomResourceOptions): CfwEdgeFirewallSwitch
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cfw_edge_firewall_switch_id: Optional[str] = None,
            enable: Optional[float] = None,
            public_ip: Optional[str] = None,
            subnet_id: Optional[str] = None,
            switch_mode: Optional[float] = None) -> CfwEdgeFirewallSwitch
    func GetCfwEdgeFirewallSwitch(ctx *Context, name string, id IDInput, state *CfwEdgeFirewallSwitchState, opts ...ResourceOption) (*CfwEdgeFirewallSwitch, error)
    public static CfwEdgeFirewallSwitch Get(string name, Input<string> id, CfwEdgeFirewallSwitchState? state, CustomResourceOptions? opts = null)
    public static CfwEdgeFirewallSwitch get(String name, Output<String> id, CfwEdgeFirewallSwitchState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CfwEdgeFirewallSwitch    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CfwEdgeFirewallSwitchId string
    ID of the resource.
    Enable double
    Switch, 0: off, 1: on.
    PublicIp string
    Public Ip.
    SubnetId string
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    SwitchMode double
    0: bypass; 1: serial.
    CfwEdgeFirewallSwitchId string
    ID of the resource.
    Enable float64
    Switch, 0: off, 1: on.
    PublicIp string
    Public Ip.
    SubnetId string
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    SwitchMode float64
    0: bypass; 1: serial.
    cfwEdgeFirewallSwitchId String
    ID of the resource.
    enable Double
    Switch, 0: off, 1: on.
    publicIp String
    Public Ip.
    subnetId String
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    switchMode Double
    0: bypass; 1: serial.
    cfwEdgeFirewallSwitchId string
    ID of the resource.
    enable number
    Switch, 0: off, 1: on.
    publicIp string
    Public Ip.
    subnetId string
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    switchMode number
    0: bypass; 1: serial.
    cfw_edge_firewall_switch_id str
    ID of the resource.
    enable float
    Switch, 0: off, 1: on.
    public_ip str
    Public Ip.
    subnet_id str
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    switch_mode float
    0: bypass; 1: serial.
    cfwEdgeFirewallSwitchId String
    ID of the resource.
    enable Number
    Switch, 0: off, 1: on.
    publicIp String
    Public Ip.
    subnetId String
    The first EIP switch in the vpc is turned on, and you need to specify a subnet to create a private connection. If switch_mode is 1 and enable is 1, this field is required.
    switchMode Number
    0: bypass; 1: serial.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack