1. Packages
  2. Civo
  3. API Docs
  4. Firewall
Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi

civo.Firewall

Explore with Pulumi AI

civo logo
Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi

    Provides a Civo firewall resource. This can be used to create, modify, and delete firewalls.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as civo from "@pulumi/civo";
    
    // Create a network
    const customNet = new civo.Network("customNet", {label: "my-custom-network"});
    // Create a firewall
    const wwwFirewall = new civo.Firewall("wwwFirewall", {networkId: customNet.id});
    // Create a firewall with the default rules
    const wwwIndex_firewallFirewall = new civo.Firewall("wwwIndex/firewallFirewall", {
        networkId: customNet.id,
        createDefaultRules: true,
    });
    // Create a firewall withouth the default rules but with a custom rule
    const wwwCivoIndex_firewallFirewall = new civo.Firewall("wwwCivoIndex/firewallFirewall", {
        networkId: customNet.id,
        createDefaultRules: false,
        ingressRules: [
            {
                label: "k8s",
                protocol: "tcp",
                portRange: "6443",
                cidrs: [
                    "192.168.1.1/32",
                    "192.168.10.4/32",
                    "192.168.10.10/32",
                ],
                action: "allow",
            },
            {
                label: "ssh",
                protocol: "tcp",
                portRange: "22",
                cidrs: [
                    "192.168.1.1/32",
                    "192.168.10.4/32",
                    "192.168.10.10/32",
                ],
                action: "allow",
            },
        ],
        egressRules: [{
            label: "all",
            protocol: "tcp",
            portRange: "1-65535",
            cidrs: ["0.0.0.0/0"],
            action: "allow",
        }],
    });
    
    import pulumi
    import pulumi_civo as civo
    
    # Create a network
    custom_net = civo.Network("customNet", label="my-custom-network")
    # Create a firewall
    www_firewall = civo.Firewall("wwwFirewall", network_id=custom_net.id)
    # Create a firewall with the default rules
    www_index_firewall_firewall = civo.Firewall("wwwIndex/firewallFirewall",
        network_id=custom_net.id,
        create_default_rules=True)
    # Create a firewall withouth the default rules but with a custom rule
    www_civo_index_firewall_firewall = civo.Firewall("wwwCivoIndex/firewallFirewall",
        network_id=custom_net.id,
        create_default_rules=False,
        ingress_rules=[
            civo.FirewallIngressRuleArgs(
                label="k8s",
                protocol="tcp",
                port_range="6443",
                cidrs=[
                    "192.168.1.1/32",
                    "192.168.10.4/32",
                    "192.168.10.10/32",
                ],
                action="allow",
            ),
            civo.FirewallIngressRuleArgs(
                label="ssh",
                protocol="tcp",
                port_range="22",
                cidrs=[
                    "192.168.1.1/32",
                    "192.168.10.4/32",
                    "192.168.10.10/32",
                ],
                action="allow",
            ),
        ],
        egress_rules=[civo.FirewallEgressRuleArgs(
            label="all",
            protocol="tcp",
            port_range="1-65535",
            cidrs=["0.0.0.0/0"],
            action="allow",
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a network
    		customNet, err := civo.NewNetwork(ctx, "customNet", &civo.NetworkArgs{
    			Label: pulumi.String("my-custom-network"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create a firewall
    		_, err = civo.NewFirewall(ctx, "wwwFirewall", &civo.FirewallArgs{
    			NetworkId: customNet.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		// Create a firewall with the default rules
    		_, err = civo.NewFirewall(ctx, "wwwIndex/firewallFirewall", &civo.FirewallArgs{
    			NetworkId:          customNet.ID(),
    			CreateDefaultRules: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		// Create a firewall withouth the default rules but with a custom rule
    		_, err = civo.NewFirewall(ctx, "wwwCivoIndex/firewallFirewall", &civo.FirewallArgs{
    			NetworkId:          customNet.ID(),
    			CreateDefaultRules: pulumi.Bool(false),
    			IngressRules: civo.FirewallIngressRuleArray{
    				&civo.FirewallIngressRuleArgs{
    					Label:     pulumi.String("k8s"),
    					Protocol:  pulumi.String("tcp"),
    					PortRange: pulumi.String("6443"),
    					Cidrs: pulumi.StringArray{
    						pulumi.String("192.168.1.1/32"),
    						pulumi.String("192.168.10.4/32"),
    						pulumi.String("192.168.10.10/32"),
    					},
    					Action: pulumi.String("allow"),
    				},
    				&civo.FirewallIngressRuleArgs{
    					Label:     pulumi.String("ssh"),
    					Protocol:  pulumi.String("tcp"),
    					PortRange: pulumi.String("22"),
    					Cidrs: pulumi.StringArray{
    						pulumi.String("192.168.1.1/32"),
    						pulumi.String("192.168.10.4/32"),
    						pulumi.String("192.168.10.10/32"),
    					},
    					Action: pulumi.String("allow"),
    				},
    			},
    			EgressRules: civo.FirewallEgressRuleArray{
    				&civo.FirewallEgressRuleArgs{
    					Label:     pulumi.String("all"),
    					Protocol:  pulumi.String("tcp"),
    					PortRange: pulumi.String("1-65535"),
    					Cidrs: pulumi.StringArray{
    						pulumi.String("0.0.0.0/0"),
    					},
    					Action: pulumi.String("allow"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Civo = Pulumi.Civo;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a network
        var customNet = new Civo.Network("customNet", new()
        {
            Label = "my-custom-network",
        });
    
        // Create a firewall
        var wwwFirewall = new Civo.Firewall("wwwFirewall", new()
        {
            NetworkId = customNet.Id,
        });
    
        // Create a firewall with the default rules
        var wwwIndex_firewallFirewall = new Civo.Firewall("wwwIndex/firewallFirewall", new()
        {
            NetworkId = customNet.Id,
            CreateDefaultRules = true,
        });
    
        // Create a firewall withouth the default rules but with a custom rule
        var wwwCivoIndex_firewallFirewall = new Civo.Firewall("wwwCivoIndex/firewallFirewall", new()
        {
            NetworkId = customNet.Id,
            CreateDefaultRules = false,
            IngressRules = new[]
            {
                new Civo.Inputs.FirewallIngressRuleArgs
                {
                    Label = "k8s",
                    Protocol = "tcp",
                    PortRange = "6443",
                    Cidrs = new[]
                    {
                        "192.168.1.1/32",
                        "192.168.10.4/32",
                        "192.168.10.10/32",
                    },
                    Action = "allow",
                },
                new Civo.Inputs.FirewallIngressRuleArgs
                {
                    Label = "ssh",
                    Protocol = "tcp",
                    PortRange = "22",
                    Cidrs = new[]
                    {
                        "192.168.1.1/32",
                        "192.168.10.4/32",
                        "192.168.10.10/32",
                    },
                    Action = "allow",
                },
            },
            EgressRules = new[]
            {
                new Civo.Inputs.FirewallEgressRuleArgs
                {
                    Label = "all",
                    Protocol = "tcp",
                    PortRange = "1-65535",
                    Cidrs = new[]
                    {
                        "0.0.0.0/0",
                    },
                    Action = "allow",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.civo.Network;
    import com.pulumi.civo.NetworkArgs;
    import com.pulumi.civo.Firewall;
    import com.pulumi.civo.FirewallArgs;
    import com.pulumi.civo.inputs.FirewallIngressRuleArgs;
    import com.pulumi.civo.inputs.FirewallEgressRuleArgs;
    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 customNet = new Network("customNet", NetworkArgs.builder()        
                .label("my-custom-network")
                .build());
    
            var wwwFirewall = new Firewall("wwwFirewall", FirewallArgs.builder()        
                .networkId(customNet.id())
                .build());
    
            var wwwIndex_firewallFirewall = new Firewall("wwwIndex/firewallFirewall", FirewallArgs.builder()        
                .networkId(customNet.id())
                .createDefaultRules(true)
                .build());
    
            var wwwCivoIndex_firewallFirewall = new Firewall("wwwCivoIndex/firewallFirewall", FirewallArgs.builder()        
                .networkId(customNet.id())
                .createDefaultRules(false)
                .ingressRules(            
                    FirewallIngressRuleArgs.builder()
                        .label("k8s")
                        .protocol("tcp")
                        .portRange("6443")
                        .cidrs(                    
                            "192.168.1.1/32",
                            "192.168.10.4/32",
                            "192.168.10.10/32")
                        .action("allow")
                        .build(),
                    FirewallIngressRuleArgs.builder()
                        .label("ssh")
                        .protocol("tcp")
                        .portRange("22")
                        .cidrs(                    
                            "192.168.1.1/32",
                            "192.168.10.4/32",
                            "192.168.10.10/32")
                        .action("allow")
                        .build())
                .egressRules(FirewallEgressRuleArgs.builder()
                    .label("all")
                    .protocol("tcp")
                    .portRange("1-65535")
                    .cidrs("0.0.0.0/0")
                    .action("allow")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create a network
      customNet:
        type: civo:Network
        properties:
          label: my-custom-network
      # Create a firewall
      wwwFirewall:
        type: civo:Firewall
        properties:
          networkId: ${customNet.id}
      # Create a firewall with the default rules
      wwwIndex/firewallFirewall:
        type: civo:Firewall
        properties:
          networkId: ${customNet.id}
          createDefaultRules: true
      # Create a firewall withouth the default rules but with a custom rule
      wwwCivoIndex/firewallFirewall:
        type: civo:Firewall
        properties:
          networkId: ${customNet.id}
          createDefaultRules: false
          ingressRules:
            - label: k8s
              protocol: tcp
              portRange: '6443'
              cidrs:
                - 192.168.1.1/32
                - 192.168.10.4/32
                - 192.168.10.10/32
              action: allow
            - label: ssh
              protocol: tcp
              portRange: '22'
              cidrs:
                - 192.168.1.1/32
                - 192.168.10.4/32
                - 192.168.10.10/32
              action: allow
          egressRules:
            - label: all
              protocol: tcp
              portRange: 1-65535
              cidrs:
                - 0.0.0.0/0
              action: allow
    

    Create Firewall Resource

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

    Constructor syntax

    new Firewall(name: string, args?: FirewallArgs, opts?: CustomResourceOptions);
    @overload
    def Firewall(resource_name: str,
                 args: Optional[FirewallArgs] = None,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Firewall(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 create_default_rules: Optional[bool] = None,
                 egress_rules: Optional[Sequence[FirewallEgressRuleArgs]] = None,
                 ingress_rules: Optional[Sequence[FirewallIngressRuleArgs]] = None,
                 name: Optional[str] = None,
                 network_id: Optional[str] = None,
                 region: Optional[str] = None)
    func NewFirewall(ctx *Context, name string, args *FirewallArgs, opts ...ResourceOption) (*Firewall, error)
    public Firewall(string name, FirewallArgs? args = null, CustomResourceOptions? opts = null)
    public Firewall(String name, FirewallArgs args)
    public Firewall(String name, FirewallArgs args, CustomResourceOptions options)
    
    type: civo:Firewall
    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 FirewallArgs
    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 FirewallArgs
    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 FirewallArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FirewallArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FirewallArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var firewallResource = new Civo.Firewall("firewallResource", new()
    {
        CreateDefaultRules = false,
        EgressRules = new[]
        {
            new Civo.Inputs.FirewallEgressRuleArgs
            {
                Action = "string",
                Cidrs = new[]
                {
                    "string",
                },
                Id = "string",
                Label = "string",
                PortRange = "string",
                Protocol = "string",
            },
        },
        IngressRules = new[]
        {
            new Civo.Inputs.FirewallIngressRuleArgs
            {
                Action = "string",
                Cidrs = new[]
                {
                    "string",
                },
                Id = "string",
                Label = "string",
                PortRange = "string",
                Protocol = "string",
            },
        },
        Name = "string",
        NetworkId = "string",
        Region = "string",
    });
    
    example, err := civo.NewFirewall(ctx, "firewallResource", &civo.FirewallArgs{
    	CreateDefaultRules: pulumi.Bool(false),
    	EgressRules: civo.FirewallEgressRuleArray{
    		&civo.FirewallEgressRuleArgs{
    			Action: pulumi.String("string"),
    			Cidrs: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Id:        pulumi.String("string"),
    			Label:     pulumi.String("string"),
    			PortRange: pulumi.String("string"),
    			Protocol:  pulumi.String("string"),
    		},
    	},
    	IngressRules: civo.FirewallIngressRuleArray{
    		&civo.FirewallIngressRuleArgs{
    			Action: pulumi.String("string"),
    			Cidrs: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Id:        pulumi.String("string"),
    			Label:     pulumi.String("string"),
    			PortRange: pulumi.String("string"),
    			Protocol:  pulumi.String("string"),
    		},
    	},
    	Name:      pulumi.String("string"),
    	NetworkId: pulumi.String("string"),
    	Region:    pulumi.String("string"),
    })
    
    var firewallResource = new Firewall("firewallResource", FirewallArgs.builder()        
        .createDefaultRules(false)
        .egressRules(FirewallEgressRuleArgs.builder()
            .action("string")
            .cidrs("string")
            .id("string")
            .label("string")
            .portRange("string")
            .protocol("string")
            .build())
        .ingressRules(FirewallIngressRuleArgs.builder()
            .action("string")
            .cidrs("string")
            .id("string")
            .label("string")
            .portRange("string")
            .protocol("string")
            .build())
        .name("string")
        .networkId("string")
        .region("string")
        .build());
    
    firewall_resource = civo.Firewall("firewallResource",
        create_default_rules=False,
        egress_rules=[civo.FirewallEgressRuleArgs(
            action="string",
            cidrs=["string"],
            id="string",
            label="string",
            port_range="string",
            protocol="string",
        )],
        ingress_rules=[civo.FirewallIngressRuleArgs(
            action="string",
            cidrs=["string"],
            id="string",
            label="string",
            port_range="string",
            protocol="string",
        )],
        name="string",
        network_id="string",
        region="string")
    
    const firewallResource = new civo.Firewall("firewallResource", {
        createDefaultRules: false,
        egressRules: [{
            action: "string",
            cidrs: ["string"],
            id: "string",
            label: "string",
            portRange: "string",
            protocol: "string",
        }],
        ingressRules: [{
            action: "string",
            cidrs: ["string"],
            id: "string",
            label: "string",
            portRange: "string",
            protocol: "string",
        }],
        name: "string",
        networkId: "string",
        region: "string",
    });
    
    type: civo:Firewall
    properties:
        createDefaultRules: false
        egressRules:
            - action: string
              cidrs:
                - string
              id: string
              label: string
              portRange: string
              protocol: string
        ingressRules:
            - action: string
              cidrs:
                - string
              id: string
              label: string
              portRange: string
              protocol: string
        name: string
        networkId: string
        region: string
    

    Firewall Resource Properties

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

    Inputs

    The Firewall resource accepts the following input properties:

    CreateDefaultRules bool
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    EgressRules List<FirewallEgressRule>
    The egress rules, this is a list of rules that will be applied to the firewall
    IngressRules List<FirewallIngressRule>
    The ingress rules, this is a list of rules that will be applied to the firewall
    Name string
    The firewall name
    NetworkId string
    The firewall network, if is not defined we use the default network
    Region string
    The firewall region, if is not defined we use the global defined in the provider
    CreateDefaultRules bool
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    EgressRules []FirewallEgressRuleArgs
    The egress rules, this is a list of rules that will be applied to the firewall
    IngressRules []FirewallIngressRuleArgs
    The ingress rules, this is a list of rules that will be applied to the firewall
    Name string
    The firewall name
    NetworkId string
    The firewall network, if is not defined we use the default network
    Region string
    The firewall region, if is not defined we use the global defined in the provider
    createDefaultRules Boolean
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egressRules List<FirewallEgressRule>
    The egress rules, this is a list of rules that will be applied to the firewall
    ingressRules List<FirewallIngressRule>
    The ingress rules, this is a list of rules that will be applied to the firewall
    name String
    The firewall name
    networkId String
    The firewall network, if is not defined we use the default network
    region String
    The firewall region, if is not defined we use the global defined in the provider
    createDefaultRules boolean
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egressRules FirewallEgressRule[]
    The egress rules, this is a list of rules that will be applied to the firewall
    ingressRules FirewallIngressRule[]
    The ingress rules, this is a list of rules that will be applied to the firewall
    name string
    The firewall name
    networkId string
    The firewall network, if is not defined we use the default network
    region string
    The firewall region, if is not defined we use the global defined in the provider
    create_default_rules bool
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egress_rules Sequence[FirewallEgressRuleArgs]
    The egress rules, this is a list of rules that will be applied to the firewall
    ingress_rules Sequence[FirewallIngressRuleArgs]
    The ingress rules, this is a list of rules that will be applied to the firewall
    name str
    The firewall name
    network_id str
    The firewall network, if is not defined we use the default network
    region str
    The firewall region, if is not defined we use the global defined in the provider
    createDefaultRules Boolean
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egressRules List<Property Map>
    The egress rules, this is a list of rules that will be applied to the firewall
    ingressRules List<Property Map>
    The ingress rules, this is a list of rules that will be applied to the firewall
    name String
    The firewall name
    networkId String
    The firewall network, if is not defined we use the default network
    region String
    The firewall region, if is not defined we use the global defined in the provider

    Outputs

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

    Get an existing Firewall 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?: FirewallState, opts?: CustomResourceOptions): Firewall
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_default_rules: Optional[bool] = None,
            egress_rules: Optional[Sequence[FirewallEgressRuleArgs]] = None,
            ingress_rules: Optional[Sequence[FirewallIngressRuleArgs]] = None,
            name: Optional[str] = None,
            network_id: Optional[str] = None,
            region: Optional[str] = None) -> Firewall
    func GetFirewall(ctx *Context, name string, id IDInput, state *FirewallState, opts ...ResourceOption) (*Firewall, error)
    public static Firewall Get(string name, Input<string> id, FirewallState? state, CustomResourceOptions? opts = null)
    public static Firewall get(String name, Output<String> id, FirewallState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    CreateDefaultRules bool
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    EgressRules List<FirewallEgressRule>
    The egress rules, this is a list of rules that will be applied to the firewall
    IngressRules List<FirewallIngressRule>
    The ingress rules, this is a list of rules that will be applied to the firewall
    Name string
    The firewall name
    NetworkId string
    The firewall network, if is not defined we use the default network
    Region string
    The firewall region, if is not defined we use the global defined in the provider
    CreateDefaultRules bool
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    EgressRules []FirewallEgressRuleArgs
    The egress rules, this is a list of rules that will be applied to the firewall
    IngressRules []FirewallIngressRuleArgs
    The ingress rules, this is a list of rules that will be applied to the firewall
    Name string
    The firewall name
    NetworkId string
    The firewall network, if is not defined we use the default network
    Region string
    The firewall region, if is not defined we use the global defined in the provider
    createDefaultRules Boolean
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egressRules List<FirewallEgressRule>
    The egress rules, this is a list of rules that will be applied to the firewall
    ingressRules List<FirewallIngressRule>
    The ingress rules, this is a list of rules that will be applied to the firewall
    name String
    The firewall name
    networkId String
    The firewall network, if is not defined we use the default network
    region String
    The firewall region, if is not defined we use the global defined in the provider
    createDefaultRules boolean
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egressRules FirewallEgressRule[]
    The egress rules, this is a list of rules that will be applied to the firewall
    ingressRules FirewallIngressRule[]
    The ingress rules, this is a list of rules that will be applied to the firewall
    name string
    The firewall name
    networkId string
    The firewall network, if is not defined we use the default network
    region string
    The firewall region, if is not defined we use the global defined in the provider
    create_default_rules bool
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egress_rules Sequence[FirewallEgressRuleArgs]
    The egress rules, this is a list of rules that will be applied to the firewall
    ingress_rules Sequence[FirewallIngressRuleArgs]
    The ingress rules, this is a list of rules that will be applied to the firewall
    name str
    The firewall name
    network_id str
    The firewall network, if is not defined we use the default network
    region str
    The firewall region, if is not defined we use the global defined in the provider
    createDefaultRules Boolean
    The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
    egressRules List<Property Map>
    The egress rules, this is a list of rules that will be applied to the firewall
    ingressRules List<Property Map>
    The ingress rules, this is a list of rules that will be applied to the firewall
    name String
    The firewall name
    networkId String
    The firewall network, if is not defined we use the default network
    region String
    The firewall region, if is not defined we use the global defined in the provider

    Supporting Types

    FirewallEgressRule, FirewallEgressRuleArgs

    Action string
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    Cidrs List<string>
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    Id string
    Label string
    A string that will be the displayed name/reference for this rule
    PortRange string
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    Protocol string
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    Action string
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    Cidrs []string
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    Id string
    Label string
    A string that will be the displayed name/reference for this rule
    PortRange string
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    Protocol string
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action String
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs List<String>
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id String
    label String
    A string that will be the displayed name/reference for this rule
    portRange String
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol String
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action string
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs string[]
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id string
    label string
    A string that will be the displayed name/reference for this rule
    portRange string
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol string
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action str
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs Sequence[str]
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id str
    label str
    A string that will be the displayed name/reference for this rule
    port_range str
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol str
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action String
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs List<String>
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id String
    label String
    A string that will be the displayed name/reference for this rule
    portRange String
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol String
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)

    FirewallIngressRule, FirewallIngressRuleArgs

    Action string
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    Cidrs List<string>
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    Id string
    Label string
    A string that will be the displayed name/reference for this rule
    PortRange string
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    Protocol string
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    Action string
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    Cidrs []string
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    Id string
    Label string
    A string that will be the displayed name/reference for this rule
    PortRange string
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    Protocol string
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action String
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs List<String>
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id String
    label String
    A string that will be the displayed name/reference for this rule
    portRange String
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol String
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action string
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs string[]
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id string
    label string
    A string that will be the displayed name/reference for this rule
    portRange string
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol string
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action str
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs Sequence[str]
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id str
    label str
    A string that will be the displayed name/reference for this rule
    port_range str
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol str
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)
    action String
    The action of the rule can be allow or deny. When we set the action = 'allow', this is going to add a rule to allow traffic. Similarly, setting action = 'deny' will deny the traffic.
    cidrs List<String>
    The CIDR notation of the other end to affect, or a valid network CIDR (e.g. 0.0.0.0/0 to open for everyone or 1.2.3.4/32 to open just for a specific IP address)
    id String
    label String
    A string that will be the displayed name/reference for this rule
    portRange String
    The port or port range to open, can be a single port or a range separated by a dash (-), e.g. 80 or 80-443
    protocol String
    The protocol choice from tcp, udp or icmp (the default if unspecified is tcp)

    Import

    using ID

    $ pulumi import civo:index/firewall:Firewall www b8ecd2ab-2267-4a5e-8692-cbf1d32583e3
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Civo pulumi/pulumi-civo
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the civo Terraform Provider.
    civo logo
    Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi