1. Packages
  2. OVH
  3. API Docs
  4. Ip
  5. Firewall
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

ovh.Ip.Firewall

Explore with Pulumi AI

Use this resource to manage an IP firewall.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";

const myFirewall = new ovh.ip.Firewall("myFirewall", {
    ip: "XXXXXX",
    ipOnFirewall: "XXXXXX",
});
Copy
import pulumi
import pulumi_ovh as ovh

my_firewall = ovh.ip.Firewall("myFirewall",
    ip="XXXXXX",
    ip_on_firewall="XXXXXX")
Copy
package main

import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/ip"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ip.NewFirewall(ctx, "myFirewall", &ip.FirewallArgs{
			Ip:           pulumi.String("XXXXXX"),
			IpOnFirewall: pulumi.String("XXXXXX"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var myFirewall = new Ovh.Ip.Firewall("myFirewall", new()
    {
        Ip = "XXXXXX",
        IpOnFirewall = "XXXXXX",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.ovhcloud.pulumi.ovh.Ip.Firewall;
import com.ovhcloud.pulumi.ovh.Ip.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 myFirewall = new Firewall("myFirewall", FirewallArgs.builder()
            .ip("XXXXXX")
            .ipOnFirewall("XXXXXX")
            .build());

    }
}
Copy
resources:
  myFirewall:
    type: ovh:Ip:Firewall
    properties:
      ip: XXXXXX
      ipOnFirewall: XXXXXX
Copy

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,
             ip: Optional[str] = None,
             ip_on_firewall: Optional[str] = None,
             enabled: Optional[bool] = 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: ovh:Ip:Firewall
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. FirewallArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. FirewallArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. FirewallArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 Ovh.Ip.Firewall("firewallResource", new()
{
    Ip = "string",
    IpOnFirewall = "string",
    Enabled = false,
});
Copy
example, err := Ip.NewFirewall(ctx, "firewallResource", &Ip.FirewallArgs{
	Ip:           pulumi.String("string"),
	IpOnFirewall: pulumi.String("string"),
	Enabled:      pulumi.Bool(false),
})
Copy
var firewallResource = new Firewall("firewallResource", FirewallArgs.builder()
    .ip("string")
    .ipOnFirewall("string")
    .enabled(false)
    .build());
Copy
firewall_resource = ovh.ip.Firewall("firewallResource",
    ip="string",
    ip_on_firewall="string",
    enabled=False)
Copy
const firewallResource = new ovh.ip.Firewall("firewallResource", {
    ip: "string",
    ipOnFirewall: "string",
    enabled: false,
});
Copy
type: ovh:Ip:Firewall
properties:
    enabled: false
    ip: string
    ipOnFirewall: string
Copy

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:

Ip This property is required. string
The IP or the CIDR
IpOnFirewall This property is required. string
IPv4 address

  • enabled - Whether firewall should be enabled
Enabled bool
Ip This property is required. string
The IP or the CIDR
IpOnFirewall This property is required. string
IPv4 address

  • enabled - Whether firewall should be enabled
Enabled bool
ip This property is required. String
The IP or the CIDR
ipOnFirewall This property is required. String
IPv4 address

  • enabled - Whether firewall should be enabled
enabled Boolean
ip This property is required. string
The IP or the CIDR
ipOnFirewall This property is required. string
IPv4 address

  • enabled - Whether firewall should be enabled
enabled boolean
ip This property is required. str
The IP or the CIDR
ip_on_firewall This property is required. str
IPv4 address

  • enabled - Whether firewall should be enabled
enabled bool
ip This property is required. String
The IP or the CIDR
ipOnFirewall This property is required. String
IPv4 address

  • enabled - Whether firewall should be enabled
enabled Boolean

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.
State string
Current state of your ip on firewall
Id string
The provider-assigned unique ID for this managed resource.
State string
Current state of your ip on firewall
id String
The provider-assigned unique ID for this managed resource.
state String
Current state of your ip on firewall
id string
The provider-assigned unique ID for this managed resource.
state string
Current state of your ip on firewall
id str
The provider-assigned unique ID for this managed resource.
state str
Current state of your ip on firewall
id String
The provider-assigned unique ID for this managed resource.
state String
Current state of your ip on firewall

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,
        enabled: Optional[bool] = None,
        ip: Optional[str] = None,
        ip_on_firewall: Optional[str] = None,
        state: 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: ovh:Ip:Firewall    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Enabled bool
Ip string
The IP or the CIDR
IpOnFirewall string
IPv4 address

  • enabled - Whether firewall should be enabled
State string
Current state of your ip on firewall
Enabled bool
Ip string
The IP or the CIDR
IpOnFirewall string
IPv4 address

  • enabled - Whether firewall should be enabled
State string
Current state of your ip on firewall
enabled Boolean
ip String
The IP or the CIDR
ipOnFirewall String
IPv4 address

  • enabled - Whether firewall should be enabled
state String
Current state of your ip on firewall
enabled boolean
ip string
The IP or the CIDR
ipOnFirewall string
IPv4 address

  • enabled - Whether firewall should be enabled
state string
Current state of your ip on firewall
enabled bool
ip str
The IP or the CIDR
ip_on_firewall str
IPv4 address

  • enabled - Whether firewall should be enabled
state str
Current state of your ip on firewall
enabled Boolean
ip String
The IP or the CIDR
ipOnFirewall String
IPv4 address

  • enabled - Whether firewall should be enabled
state String
Current state of your ip on firewall

Package Details

Repository
ovh ovh/pulumi-ovh
License
Apache-2.0
Notes
This Pulumi package is based on the ovh Terraform Provider.