1. Packages
  2. Ibm Provider
  3. API Docs
  4. Firewall
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.Firewall

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a firewall in IBM. One firewall protects one public VLAN and provides in-bound network packet filtering. You can order or find firewalls in the IBM Cloud infrastructure customer portal by navigating to Network > IP Management > VLANs and clicking the Gateway/Firewall column. For an overview of supported firewalls, see exploring firewalls.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const testfw = new ibm.Firewall("testfw", {
        firewallType: "HARDWARE_FIREWALL_DEDICATED",
        haEnabled: false,
        publicVlanId: 12345678,
        tags: [
            "collectd",
            "mesos-master",
        ],
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    testfw = ibm.Firewall("testfw",
        firewall_type="HARDWARE_FIREWALL_DEDICATED",
        ha_enabled=False,
        public_vlan_id=12345678,
        tags=[
            "collectd",
            "mesos-master",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewFirewall(ctx, "testfw", &ibm.FirewallArgs{
    			FirewallType: pulumi.String("HARDWARE_FIREWALL_DEDICATED"),
    			HaEnabled:    pulumi.Bool(false),
    			PublicVlanId: pulumi.Float64(12345678),
    			Tags: pulumi.StringArray{
    				pulumi.String("collectd"),
    				pulumi.String("mesos-master"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var testfw = new Ibm.Firewall("testfw", new()
        {
            FirewallType = "HARDWARE_FIREWALL_DEDICATED",
            HaEnabled = false,
            PublicVlanId = 12345678,
            Tags = new[]
            {
                "collectd",
                "mesos-master",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.Firewall;
    import com.pulumi.ibm.FirewallArgs;
    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 testfw = new Firewall("testfw", FirewallArgs.builder()
                .firewallType("HARDWARE_FIREWALL_DEDICATED")
                .haEnabled(false)
                .publicVlanId(12345678)
                .tags(            
                    "collectd",
                    "mesos-master")
                .build());
    
        }
    }
    
    resources:
      testfw:
        type: ibm:Firewall
        properties:
          firewallType: HARDWARE_FIREWALL_DEDICATED
          haEnabled: false
          publicVlanId: 1.2345678e+07
          tags:
            - collectd
            - mesos-master
    

    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: FirewallArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Firewall(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 public_vlan_id: Optional[float] = None,
                 firewall_id: Optional[str] = None,
                 firewall_type: Optional[str] = None,
                 ha_enabled: Optional[bool] = None,
                 tags: Optional[Sequence[str]] = None)
    func NewFirewall(ctx *Context, name string, args FirewallArgs, opts ...ResourceOption) (*Firewall, error)
    public Firewall(string name, FirewallArgs args, CustomResourceOptions? opts = null)
    public Firewall(String name, FirewallArgs args)
    public Firewall(String name, FirewallArgs args, CustomResourceOptions options)
    
    type: ibm: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.

    Constructor example

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

    var firewallResource = new Ibm.Firewall("firewallResource", new()
    {
        PublicVlanId = 0,
        FirewallId = "string",
        FirewallType = "string",
        HaEnabled = false,
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := ibm.NewFirewall(ctx, "firewallResource", &ibm.FirewallArgs{
    	PublicVlanId: pulumi.Float64(0),
    	FirewallId:   pulumi.String("string"),
    	FirewallType: pulumi.String("string"),
    	HaEnabled:    pulumi.Bool(false),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var firewallResource = new Firewall("firewallResource", FirewallArgs.builder()
        .publicVlanId(0)
        .firewallId("string")
        .firewallType("string")
        .haEnabled(false)
        .tags("string")
        .build());
    
    firewall_resource = ibm.Firewall("firewallResource",
        public_vlan_id=0,
        firewall_id="string",
        firewall_type="string",
        ha_enabled=False,
        tags=["string"])
    
    const firewallResource = new ibm.Firewall("firewallResource", {
        publicVlanId: 0,
        firewallId: "string",
        firewallType: "string",
        haEnabled: false,
        tags: ["string"],
    });
    
    type: ibm:Firewall
    properties:
        firewallId: string
        firewallType: string
        haEnabled: false
        publicVlanId: 0
        tags:
            - 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

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

    The Firewall resource accepts the following input properties:

    PublicVlanId double
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    FirewallId string
    (String) The unique identifier of the VLAN.
    FirewallType string
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    HaEnabled bool
    Specifies whether the local load balancer needs to be HA-enabled.
    Tags List<string>
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    PublicVlanId float64
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    FirewallId string
    (String) The unique identifier of the VLAN.
    FirewallType string
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    HaEnabled bool
    Specifies whether the local load balancer needs to be HA-enabled.
    Tags []string
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    publicVlanId Double
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    firewallId String
    (String) The unique identifier of the VLAN.
    firewallType String
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    haEnabled Boolean
    Specifies whether the local load balancer needs to be HA-enabled.
    tags List<String>
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    publicVlanId number
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    firewallId string
    (String) The unique identifier of the VLAN.
    firewallType string
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    haEnabled boolean
    Specifies whether the local load balancer needs to be HA-enabled.
    tags string[]
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    public_vlan_id float
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    firewall_id str
    (String) The unique identifier of the VLAN.
    firewall_type str
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    ha_enabled bool
    Specifies whether the local load balancer needs to be HA-enabled.
    tags Sequence[str]
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    publicVlanId Number
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    firewallId String
    (String) The unique identifier of the VLAN.
    firewallType String
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    haEnabled Boolean
    Specifies whether the local load balancer needs to be HA-enabled.
    tags List<String>
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.

    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.
    Location string
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    Password string
    Password for the given User
    PrimaryIp string
    Primary IP address
    Username string
    User name
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    Password string
    Password for the given User
    PrimaryIp string
    Primary IP address
    Username string
    User name
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password String
    Password for the given User
    primaryIp String
    Primary IP address
    username String
    User name
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password string
    Password for the given User
    primaryIp string
    Primary IP address
    username string
    User name
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password str
    Password for the given User
    primary_ip str
    Primary IP address
    username str
    User name
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password String
    Password for the given User
    primaryIp String
    Primary IP address
    username String
    User name

    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,
            firewall_id: Optional[str] = None,
            firewall_type: Optional[str] = None,
            ha_enabled: Optional[bool] = None,
            location: Optional[str] = None,
            password: Optional[str] = None,
            primary_ip: Optional[str] = None,
            public_vlan_id: Optional[float] = None,
            tags: Optional[Sequence[str]] = None,
            username: 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)
    resources:  _:    type: ibm:Firewall    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:
    FirewallId string
    (String) The unique identifier of the VLAN.
    FirewallType string
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    HaEnabled bool
    Specifies whether the local load balancer needs to be HA-enabled.
    Location string
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    Password string
    Password for the given User
    PrimaryIp string
    Primary IP address
    PublicVlanId double
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    Tags List<string>
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    Username string
    User name
    FirewallId string
    (String) The unique identifier of the VLAN.
    FirewallType string
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    HaEnabled bool
    Specifies whether the local load balancer needs to be HA-enabled.
    Location string
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    Password string
    Password for the given User
    PrimaryIp string
    Primary IP address
    PublicVlanId float64
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    Tags []string
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    Username string
    User name
    firewallId String
    (String) The unique identifier of the VLAN.
    firewallType String
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    haEnabled Boolean
    Specifies whether the local load balancer needs to be HA-enabled.
    location String
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password String
    Password for the given User
    primaryIp String
    Primary IP address
    publicVlanId Double
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    tags List<String>
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    username String
    User name
    firewallId string
    (String) The unique identifier of the VLAN.
    firewallType string
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    haEnabled boolean
    Specifies whether the local load balancer needs to be HA-enabled.
    location string
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password string
    Password for the given User
    primaryIp string
    Primary IP address
    publicVlanId number
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    tags string[]
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    username string
    User name
    firewall_id str
    (String) The unique identifier of the VLAN.
    firewall_type str
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    ha_enabled bool
    Specifies whether the local load balancer needs to be HA-enabled.
    location str
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password str
    Password for the given User
    primary_ip str
    Primary IP address
    public_vlan_id float
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    tags Sequence[str]
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    username str
    User name
    firewallId String
    (String) The unique identifier of the VLAN.
    firewallType String
    Specifies the type of firewall to create. Valid options are HARDWARE_FIREWALL_DEDICATED or FORTIGATE_SECURITY_APPLIANCE. Defaults to HARDWARE_FIREWALL_DEDICATED-
    haEnabled Boolean
    Specifies whether the local load balancer needs to be HA-enabled.
    location String
    (String) The location/datacenter of the created firewall device.

    • primary_ip: - (String) The public gateway IP address.
    • username: - (String) The username that is used to log in into the device, in case of Forti Gate Appliances.
    • password: - (String) The password that is used to log in into the device, in case of Forti Gate Appliances.
    password String
    Password for the given User
    primaryIp String
    Primary IP address
    publicVlanId Number
    The target public VLAN ID that you want the firewall to protect. You can find accepted values here. Click the VLAN that you want to use and note the ID number in the resulting URL. You can also refer to a VLAN name by using a data source.
    tags List<String>
    Set tags on the firewall. Permitted characters include: A-Z, 0-9, whitespace, _ (underscore), - (hyphen), . (period), and : (colon). All other characters are removed.
    username String
    User name

    Package Details

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