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

tencentcloud.LighthouseFirewallRule

Explore with Pulumi AI

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

    Provides a resource to create a lighthouse firewall rule

    NOTE: Use an empty template to clean up the default rules before using this resource manage firewall rules.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const firewallRule = new tencentcloud.LighthouseFirewallRule("firewallRule", {
        firewallRules: [
            {
                action: "ACCEPT",
                cidrBlock: "10.0.0.1",
                firewallRuleDescription: "description 1",
                port: "80",
                protocol: "TCP",
            },
            {
                action: "ACCEPT",
                cidrBlock: "10.0.0.2",
                firewallRuleDescription: "description 2",
                port: "80",
                protocol: "TCP",
            },
        ],
        instanceId: "lhins-xxxxxxx",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    firewall_rule = tencentcloud.LighthouseFirewallRule("firewallRule",
        firewall_rules=[
            {
                "action": "ACCEPT",
                "cidr_block": "10.0.0.1",
                "firewall_rule_description": "description 1",
                "port": "80",
                "protocol": "TCP",
            },
            {
                "action": "ACCEPT",
                "cidr_block": "10.0.0.2",
                "firewall_rule_description": "description 2",
                "port": "80",
                "protocol": "TCP",
            },
        ],
        instance_id="lhins-xxxxxxx")
    
    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 {
    		_, err := tencentcloud.NewLighthouseFirewallRule(ctx, "firewallRule", &tencentcloud.LighthouseFirewallRuleArgs{
    			FirewallRules: tencentcloud.LighthouseFirewallRuleFirewallRuleArray{
    				&tencentcloud.LighthouseFirewallRuleFirewallRuleArgs{
    					Action:                  pulumi.String("ACCEPT"),
    					CidrBlock:               pulumi.String("10.0.0.1"),
    					FirewallRuleDescription: pulumi.String("description 1"),
    					Port:                    pulumi.String("80"),
    					Protocol:                pulumi.String("TCP"),
    				},
    				&tencentcloud.LighthouseFirewallRuleFirewallRuleArgs{
    					Action:                  pulumi.String("ACCEPT"),
    					CidrBlock:               pulumi.String("10.0.0.2"),
    					FirewallRuleDescription: pulumi.String("description 2"),
    					Port:                    pulumi.String("80"),
    					Protocol:                pulumi.String("TCP"),
    				},
    			},
    			InstanceId: pulumi.String("lhins-xxxxxxx"),
    		})
    		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 firewallRule = new Tencentcloud.LighthouseFirewallRule("firewallRule", new()
        {
            FirewallRules = new[]
            {
                new Tencentcloud.Inputs.LighthouseFirewallRuleFirewallRuleArgs
                {
                    Action = "ACCEPT",
                    CidrBlock = "10.0.0.1",
                    FirewallRuleDescription = "description 1",
                    Port = "80",
                    Protocol = "TCP",
                },
                new Tencentcloud.Inputs.LighthouseFirewallRuleFirewallRuleArgs
                {
                    Action = "ACCEPT",
                    CidrBlock = "10.0.0.2",
                    FirewallRuleDescription = "description 2",
                    Port = "80",
                    Protocol = "TCP",
                },
            },
            InstanceId = "lhins-xxxxxxx",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.LighthouseFirewallRule;
    import com.pulumi.tencentcloud.LighthouseFirewallRuleArgs;
    import com.pulumi.tencentcloud.inputs.LighthouseFirewallRuleFirewallRuleArgs;
    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) {
            var firewallRule = new LighthouseFirewallRule("firewallRule", LighthouseFirewallRuleArgs.builder()
                .firewallRules(            
                    LighthouseFirewallRuleFirewallRuleArgs.builder()
                        .action("ACCEPT")
                        .cidrBlock("10.0.0.1")
                        .firewallRuleDescription("description 1")
                        .port("80")
                        .protocol("TCP")
                        .build(),
                    LighthouseFirewallRuleFirewallRuleArgs.builder()
                        .action("ACCEPT")
                        .cidrBlock("10.0.0.2")
                        .firewallRuleDescription("description 2")
                        .port("80")
                        .protocol("TCP")
                        .build())
                .instanceId("lhins-xxxxxxx")
                .build());
    
        }
    }
    
    resources:
      firewallRule:
        type: tencentcloud:LighthouseFirewallRule
        properties:
          firewallRules:
            - action: ACCEPT
              cidrBlock: 10.0.0.1
              firewallRuleDescription: description 1
              port: '80'
              protocol: TCP
            - action: ACCEPT
              cidrBlock: 10.0.0.2
              firewallRuleDescription: description 2
              port: '80'
              protocol: TCP
          instanceId: lhins-xxxxxxx
    

    Create LighthouseFirewallRule Resource

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

    Constructor syntax

    new LighthouseFirewallRule(name: string, args: LighthouseFirewallRuleArgs, opts?: CustomResourceOptions);
    @overload
    def LighthouseFirewallRule(resource_name: str,
                               args: LighthouseFirewallRuleArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def LighthouseFirewallRule(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               firewall_rules: Optional[Sequence[LighthouseFirewallRuleFirewallRuleArgs]] = None,
                               instance_id: Optional[str] = None,
                               lighthouse_firewall_rule_id: Optional[str] = None)
    func NewLighthouseFirewallRule(ctx *Context, name string, args LighthouseFirewallRuleArgs, opts ...ResourceOption) (*LighthouseFirewallRule, error)
    public LighthouseFirewallRule(string name, LighthouseFirewallRuleArgs args, CustomResourceOptions? opts = null)
    public LighthouseFirewallRule(String name, LighthouseFirewallRuleArgs args)
    public LighthouseFirewallRule(String name, LighthouseFirewallRuleArgs args, CustomResourceOptions options)
    
    type: tencentcloud:LighthouseFirewallRule
    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 LighthouseFirewallRuleArgs
    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 LighthouseFirewallRuleArgs
    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 LighthouseFirewallRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LighthouseFirewallRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LighthouseFirewallRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    LighthouseFirewallRule 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 LighthouseFirewallRule resource accepts the following input properties:

    FirewallRules List<LighthouseFirewallRuleFirewallRule>
    Firewall rule list.
    InstanceId string
    Instance ID.
    LighthouseFirewallRuleId string
    ID of the resource.
    FirewallRules []LighthouseFirewallRuleFirewallRuleArgs
    Firewall rule list.
    InstanceId string
    Instance ID.
    LighthouseFirewallRuleId string
    ID of the resource.
    firewallRules List<LighthouseFirewallRuleFirewallRule>
    Firewall rule list.
    instanceId String
    Instance ID.
    lighthouseFirewallRuleId String
    ID of the resource.
    firewallRules LighthouseFirewallRuleFirewallRule[]
    Firewall rule list.
    instanceId string
    Instance ID.
    lighthouseFirewallRuleId string
    ID of the resource.
    firewallRules List<Property Map>
    Firewall rule list.
    instanceId String
    Instance ID.
    lighthouseFirewallRuleId String
    ID of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LighthouseFirewallRule 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 LighthouseFirewallRule Resource

    Get an existing LighthouseFirewallRule 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?: LighthouseFirewallRuleState, opts?: CustomResourceOptions): LighthouseFirewallRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            firewall_rules: Optional[Sequence[LighthouseFirewallRuleFirewallRuleArgs]] = None,
            instance_id: Optional[str] = None,
            lighthouse_firewall_rule_id: Optional[str] = None) -> LighthouseFirewallRule
    func GetLighthouseFirewallRule(ctx *Context, name string, id IDInput, state *LighthouseFirewallRuleState, opts ...ResourceOption) (*LighthouseFirewallRule, error)
    public static LighthouseFirewallRule Get(string name, Input<string> id, LighthouseFirewallRuleState? state, CustomResourceOptions? opts = null)
    public static LighthouseFirewallRule get(String name, Output<String> id, LighthouseFirewallRuleState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:LighthouseFirewallRule    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:
    FirewallRules List<LighthouseFirewallRuleFirewallRule>
    Firewall rule list.
    InstanceId string
    Instance ID.
    LighthouseFirewallRuleId string
    ID of the resource.
    FirewallRules []LighthouseFirewallRuleFirewallRuleArgs
    Firewall rule list.
    InstanceId string
    Instance ID.
    LighthouseFirewallRuleId string
    ID of the resource.
    firewallRules List<LighthouseFirewallRuleFirewallRule>
    Firewall rule list.
    instanceId String
    Instance ID.
    lighthouseFirewallRuleId String
    ID of the resource.
    firewallRules LighthouseFirewallRuleFirewallRule[]
    Firewall rule list.
    instanceId string
    Instance ID.
    lighthouseFirewallRuleId string
    ID of the resource.
    firewallRules List<Property Map>
    Firewall rule list.
    instanceId String
    Instance ID.
    lighthouseFirewallRuleId String
    ID of the resource.

    Supporting Types

    LighthouseFirewallRuleFirewallRule, LighthouseFirewallRuleFirewallRuleArgs

    Protocol string
    Protocol. Valid values are TCP, UDP, ICMP, ALL.
    Action string
    Valid values are ACCEPT, DROP. Default value is ACCEPT.
    CidrBlock string
    IP range or IP (mutually exclusive). Default value is 0.0.0.0/0, which indicates all sources.
    FirewallRuleDescription string
    Firewall rule description.
    Port string
    Port. Valid values are ALL, one single port, multiple ports separated by commas, or port range indicated by a minus sign.
    Protocol string
    Protocol. Valid values are TCP, UDP, ICMP, ALL.
    Action string
    Valid values are ACCEPT, DROP. Default value is ACCEPT.
    CidrBlock string
    IP range or IP (mutually exclusive). Default value is 0.0.0.0/0, which indicates all sources.
    FirewallRuleDescription string
    Firewall rule description.
    Port string
    Port. Valid values are ALL, one single port, multiple ports separated by commas, or port range indicated by a minus sign.
    protocol String
    Protocol. Valid values are TCP, UDP, ICMP, ALL.
    action String
    Valid values are ACCEPT, DROP. Default value is ACCEPT.
    cidrBlock String
    IP range or IP (mutually exclusive). Default value is 0.0.0.0/0, which indicates all sources.
    firewallRuleDescription String
    Firewall rule description.
    port String
    Port. Valid values are ALL, one single port, multiple ports separated by commas, or port range indicated by a minus sign.
    protocol string
    Protocol. Valid values are TCP, UDP, ICMP, ALL.
    action string
    Valid values are ACCEPT, DROP. Default value is ACCEPT.
    cidrBlock string
    IP range or IP (mutually exclusive). Default value is 0.0.0.0/0, which indicates all sources.
    firewallRuleDescription string
    Firewall rule description.
    port string
    Port. Valid values are ALL, one single port, multiple ports separated by commas, or port range indicated by a minus sign.
    protocol str
    Protocol. Valid values are TCP, UDP, ICMP, ALL.
    action str
    Valid values are ACCEPT, DROP. Default value is ACCEPT.
    cidr_block str
    IP range or IP (mutually exclusive). Default value is 0.0.0.0/0, which indicates all sources.
    firewall_rule_description str
    Firewall rule description.
    port str
    Port. Valid values are ALL, one single port, multiple ports separated by commas, or port range indicated by a minus sign.
    protocol String
    Protocol. Valid values are TCP, UDP, ICMP, ALL.
    action String
    Valid values are ACCEPT, DROP. Default value is ACCEPT.
    cidrBlock String
    IP range or IP (mutually exclusive). Default value is 0.0.0.0/0, which indicates all sources.
    firewallRuleDescription String
    Firewall rule description.
    port String
    Port. Valid values are ALL, one single port, multiple ports separated by commas, or port range indicated by a minus sign.

    Import

    lighthouse firewall_rule can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/lighthouseFirewallRule:LighthouseFirewallRule firewall_rule lighthouse_instance_id
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack