tencentcloud.CfwNatFirewallSwitch
Explore with Pulumi AI
Provides a resource to create a cfw nat_firewall_switch
Example Usage
Turn off switch
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleCfwNatFwSwitches = tencentcloud.getCfwNatFwSwitches({
natInsId: "cfwnat-18d2ba18",
});
const exampleCfwNatFirewallSwitch = new tencentcloud.CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch", {
natInsId: exampleCfwNatFwSwitches.then(exampleCfwNatFwSwitches => exampleCfwNatFwSwitches.id),
subnetId: exampleCfwNatFwSwitches.then(exampleCfwNatFwSwitches => exampleCfwNatFwSwitches.datas?.[0]?.subnetId),
enable: 0,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_cfw_nat_fw_switches = tencentcloud.get_cfw_nat_fw_switches(nat_ins_id="cfwnat-18d2ba18")
example_cfw_nat_firewall_switch = tencentcloud.CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch",
nat_ins_id=example_cfw_nat_fw_switches.id,
subnet_id=example_cfw_nat_fw_switches.datas[0].subnet_id,
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 {
exampleCfwNatFwSwitches, err := tencentcloud.GetCfwNatFwSwitches(ctx, &tencentcloud.GetCfwNatFwSwitchesArgs{
NatInsId: pulumi.StringRef("cfwnat-18d2ba18"),
}, nil)
if err != nil {
return err
}
_, err = tencentcloud.NewCfwNatFirewallSwitch(ctx, "exampleCfwNatFirewallSwitch", &tencentcloud.CfwNatFirewallSwitchArgs{
NatInsId: pulumi.String(exampleCfwNatFwSwitches.Id),
SubnetId: pulumi.String(exampleCfwNatFwSwitches.Datas[0].SubnetId),
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 exampleCfwNatFwSwitches = Tencentcloud.GetCfwNatFwSwitches.Invoke(new()
{
NatInsId = "cfwnat-18d2ba18",
});
var exampleCfwNatFirewallSwitch = new Tencentcloud.CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch", new()
{
NatInsId = exampleCfwNatFwSwitches.Apply(getCfwNatFwSwitchesResult => getCfwNatFwSwitchesResult.Id),
SubnetId = exampleCfwNatFwSwitches.Apply(getCfwNatFwSwitchesResult => getCfwNatFwSwitchesResult.Datas[0]?.SubnetId),
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.GetCfwNatFwSwitchesArgs;
import com.pulumi.tencentcloud.CfwNatFirewallSwitch;
import com.pulumi.tencentcloud.CfwNatFirewallSwitchArgs;
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 exampleCfwNatFwSwitches = TencentcloudFunctions.getCfwNatFwSwitches(GetCfwNatFwSwitchesArgs.builder()
.natInsId("cfwnat-18d2ba18")
.build());
var exampleCfwNatFirewallSwitch = new CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch", CfwNatFirewallSwitchArgs.builder()
.natInsId(exampleCfwNatFwSwitches.applyValue(getCfwNatFwSwitchesResult -> getCfwNatFwSwitchesResult.id()))
.subnetId(exampleCfwNatFwSwitches.applyValue(getCfwNatFwSwitchesResult -> getCfwNatFwSwitchesResult.datas()[0].subnetId()))
.enable(0)
.build());
}
}
resources:
exampleCfwNatFirewallSwitch:
type: tencentcloud:CfwNatFirewallSwitch
properties:
natInsId: ${exampleCfwNatFwSwitches.id}
subnetId: ${exampleCfwNatFwSwitches.datas[0].subnetId}
enable: 0
variables:
exampleCfwNatFwSwitches:
fn::invoke:
function: tencentcloud:getCfwNatFwSwitches
arguments:
natInsId: cfwnat-18d2ba18
Or turn on switch
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleCfwNatFwSwitches = tencentcloud.getCfwNatFwSwitches({
natInsId: "cfwnat-18d2ba18",
});
const exampleCfwNatFirewallSwitch = new tencentcloud.CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch", {
natInsId: exampleCfwNatFwSwitches.then(exampleCfwNatFwSwitches => exampleCfwNatFwSwitches.id),
subnetId: exampleCfwNatFwSwitches.then(exampleCfwNatFwSwitches => exampleCfwNatFwSwitches.datas?.[0]?.subnetId),
enable: 1,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_cfw_nat_fw_switches = tencentcloud.get_cfw_nat_fw_switches(nat_ins_id="cfwnat-18d2ba18")
example_cfw_nat_firewall_switch = tencentcloud.CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch",
nat_ins_id=example_cfw_nat_fw_switches.id,
subnet_id=example_cfw_nat_fw_switches.datas[0].subnet_id,
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 {
exampleCfwNatFwSwitches, err := tencentcloud.GetCfwNatFwSwitches(ctx, &tencentcloud.GetCfwNatFwSwitchesArgs{
NatInsId: pulumi.StringRef("cfwnat-18d2ba18"),
}, nil)
if err != nil {
return err
}
_, err = tencentcloud.NewCfwNatFirewallSwitch(ctx, "exampleCfwNatFirewallSwitch", &tencentcloud.CfwNatFirewallSwitchArgs{
NatInsId: pulumi.String(exampleCfwNatFwSwitches.Id),
SubnetId: pulumi.String(exampleCfwNatFwSwitches.Datas[0].SubnetId),
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 exampleCfwNatFwSwitches = Tencentcloud.GetCfwNatFwSwitches.Invoke(new()
{
NatInsId = "cfwnat-18d2ba18",
});
var exampleCfwNatFirewallSwitch = new Tencentcloud.CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch", new()
{
NatInsId = exampleCfwNatFwSwitches.Apply(getCfwNatFwSwitchesResult => getCfwNatFwSwitchesResult.Id),
SubnetId = exampleCfwNatFwSwitches.Apply(getCfwNatFwSwitchesResult => getCfwNatFwSwitchesResult.Datas[0]?.SubnetId),
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.GetCfwNatFwSwitchesArgs;
import com.pulumi.tencentcloud.CfwNatFirewallSwitch;
import com.pulumi.tencentcloud.CfwNatFirewallSwitchArgs;
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 exampleCfwNatFwSwitches = TencentcloudFunctions.getCfwNatFwSwitches(GetCfwNatFwSwitchesArgs.builder()
.natInsId("cfwnat-18d2ba18")
.build());
var exampleCfwNatFirewallSwitch = new CfwNatFirewallSwitch("exampleCfwNatFirewallSwitch", CfwNatFirewallSwitchArgs.builder()
.natInsId(exampleCfwNatFwSwitches.applyValue(getCfwNatFwSwitchesResult -> getCfwNatFwSwitchesResult.id()))
.subnetId(exampleCfwNatFwSwitches.applyValue(getCfwNatFwSwitchesResult -> getCfwNatFwSwitchesResult.datas()[0].subnetId()))
.enable(1)
.build());
}
}
resources:
exampleCfwNatFirewallSwitch:
type: tencentcloud:CfwNatFirewallSwitch
properties:
natInsId: ${exampleCfwNatFwSwitches.id}
subnetId: ${exampleCfwNatFwSwitches.datas[0].subnetId}
enable: 1
variables:
exampleCfwNatFwSwitches:
fn::invoke:
function: tencentcloud:getCfwNatFwSwitches
arguments:
natInsId: cfwnat-18d2ba18
Create CfwNatFirewallSwitch Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CfwNatFirewallSwitch(name: string, args: CfwNatFirewallSwitchArgs, opts?: CustomResourceOptions);
@overload
def CfwNatFirewallSwitch(resource_name: str,
args: CfwNatFirewallSwitchArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CfwNatFirewallSwitch(resource_name: str,
opts: Optional[ResourceOptions] = None,
enable: Optional[float] = None,
nat_ins_id: Optional[str] = None,
subnet_id: Optional[str] = None,
cfw_nat_firewall_switch_id: Optional[str] = None)
func NewCfwNatFirewallSwitch(ctx *Context, name string, args CfwNatFirewallSwitchArgs, opts ...ResourceOption) (*CfwNatFirewallSwitch, error)
public CfwNatFirewallSwitch(string name, CfwNatFirewallSwitchArgs args, CustomResourceOptions? opts = null)
public CfwNatFirewallSwitch(String name, CfwNatFirewallSwitchArgs args)
public CfwNatFirewallSwitch(String name, CfwNatFirewallSwitchArgs args, CustomResourceOptions options)
type: tencentcloud:CfwNatFirewallSwitch
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 CfwNatFirewallSwitchArgs
- 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 CfwNatFirewallSwitchArgs
- 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 CfwNatFirewallSwitchArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CfwNatFirewallSwitchArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CfwNatFirewallSwitchArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CfwNatFirewallSwitch 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 CfwNatFirewallSwitch resource accepts the following input properties:
- Enable double
- Switch, 0: off, 1: on.
- Nat
Ins stringId - Firewall instance id.
- Subnet
Id string - subnet id.
- Cfw
Nat stringFirewall Switch Id - ID of the resource.
- Enable float64
- Switch, 0: off, 1: on.
- Nat
Ins stringId - Firewall instance id.
- Subnet
Id string - subnet id.
- Cfw
Nat stringFirewall Switch Id - ID of the resource.
- enable Double
- Switch, 0: off, 1: on.
- nat
Ins StringId - Firewall instance id.
- subnet
Id String - subnet id.
- cfw
Nat StringFirewall Switch Id - ID of the resource.
- enable number
- Switch, 0: off, 1: on.
- nat
Ins stringId - Firewall instance id.
- subnet
Id string - subnet id.
- cfw
Nat stringFirewall Switch Id - ID of the resource.
- enable float
- Switch, 0: off, 1: on.
- nat_
ins_ strid - Firewall instance id.
- subnet_
id str - subnet id.
- cfw_
nat_ strfirewall_ switch_ id - ID of the resource.
- enable Number
- Switch, 0: off, 1: on.
- nat
Ins StringId - Firewall instance id.
- subnet
Id String - subnet id.
- cfw
Nat StringFirewall Switch Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the CfwNatFirewallSwitch 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 CfwNatFirewallSwitch Resource
Get an existing CfwNatFirewallSwitch 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?: CfwNatFirewallSwitchState, opts?: CustomResourceOptions): CfwNatFirewallSwitch
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cfw_nat_firewall_switch_id: Optional[str] = None,
enable: Optional[float] = None,
nat_ins_id: Optional[str] = None,
subnet_id: Optional[str] = None) -> CfwNatFirewallSwitch
func GetCfwNatFirewallSwitch(ctx *Context, name string, id IDInput, state *CfwNatFirewallSwitchState, opts ...ResourceOption) (*CfwNatFirewallSwitch, error)
public static CfwNatFirewallSwitch Get(string name, Input<string> id, CfwNatFirewallSwitchState? state, CustomResourceOptions? opts = null)
public static CfwNatFirewallSwitch get(String name, Output<String> id, CfwNatFirewallSwitchState state, CustomResourceOptions options)
resources: _: type: tencentcloud:CfwNatFirewallSwitch 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.
- Cfw
Nat stringFirewall Switch Id - ID of the resource.
- Enable double
- Switch, 0: off, 1: on.
- Nat
Ins stringId - Firewall instance id.
- Subnet
Id string - subnet id.
- Cfw
Nat stringFirewall Switch Id - ID of the resource.
- Enable float64
- Switch, 0: off, 1: on.
- Nat
Ins stringId - Firewall instance id.
- Subnet
Id string - subnet id.
- cfw
Nat StringFirewall Switch Id - ID of the resource.
- enable Double
- Switch, 0: off, 1: on.
- nat
Ins StringId - Firewall instance id.
- subnet
Id String - subnet id.
- cfw
Nat stringFirewall Switch Id - ID of the resource.
- enable number
- Switch, 0: off, 1: on.
- nat
Ins stringId - Firewall instance id.
- subnet
Id string - subnet id.
- cfw_
nat_ strfirewall_ switch_ id - ID of the resource.
- enable float
- Switch, 0: off, 1: on.
- nat_
ins_ strid - Firewall instance id.
- subnet_
id str - subnet id.
- cfw
Nat StringFirewall Switch Id - ID of the resource.
- enable Number
- Switch, 0: off, 1: on.
- nat
Ins StringId - Firewall instance id.
- subnet
Id String - subnet id.
Import
cfw nat_firewall_switch can be imported using the id, e.g.
$ pulumi import tencentcloud:index/cfwNatFirewallSwitch:CfwNatFirewallSwitch example cfwnat-18d2ba18#subnet-ef7wyymr
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.