Civo

Pulumi Official
Package maintained by Pulumi
v2.2.4 published on Friday, Jul 29, 2022 by Pulumi

Firewall

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

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a network
        var customNet = new Civo.Network("customNet", new Civo.NetworkArgs
        {
            Label = "my-custom-network",
        });
        // Create a firewall
        var www = new Civo.Firewall("www", new Civo.FirewallArgs
        {
            NetworkId = customNet.Id,
        });
    }

}
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 {
		customNet, err := civo.NewNetwork(ctx, "customNet", &civo.NetworkArgs{
			Label: pulumi.String("my-custom-network"),
		})
		if err != nil {
			return err
		}
		_, err = civo.NewFirewall(ctx, "www", &civo.FirewallArgs{
			NetworkId: customNet.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 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 www = new Firewall("www", FirewallArgs.builder()        
            .networkId(customNet.id())
            .build());

    }
}
import pulumi
import pulumi_civo as civo

# Create a network
custom_net = civo.Network("customNet", label="my-custom-network")
# Create a firewall
www = civo.Firewall("www", network_id=custom_net.id)
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 www = new civo.Firewall("www", {networkId: customNet.id});
resources:
  # Create a network
  customNet:
    type: civo:Network
    properties:
      label: my-custom-network
  # Create a firewall
  www:
    type: civo:Firewall
    properties:
      networkId: ${customNet.id}

Create a Firewall Resource

new Firewall(name: string, args?: FirewallArgs, opts?: CustomResourceOptions);
@overload
def Firewall(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             create_default_rules: Optional[bool] = None,
             name: Optional[str] = None,
             network_id: Optional[str] = None,
             region: Optional[str] = None)
@overload
def Firewall(resource_name: str,
             args: Optional[FirewallArgs] = None,
             opts: Optional[ResourceOptions] = 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.

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.

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

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

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

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

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

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

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 an 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,
        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

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

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

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

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

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

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

Import

using ID

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

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.