FirewallRule

Provides a Civo Cloud Firewall Rule resource. This can be used to create, modify, and delete Firewalls Rules. This resource don’t have an update option because the backend don’t have the support for that, so in this case we use ForceNew for all object in the resource.

Create a FirewallRule Resource

new FirewallRule(name: string, args: FirewallRuleArgs, opts?: CustomResourceOptions);
@overload
def FirewallRule(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 cidrs: Optional[Sequence[str]] = None,
                 direction: Optional[str] = None,
                 end_port: Optional[str] = None,
                 firewall_id: Optional[str] = None,
                 label: Optional[str] = None,
                 protocol: Optional[str] = None,
                 region: Optional[str] = None,
                 start_port: Optional[str] = None)
@overload
def FirewallRule(resource_name: str,
                 args: FirewallRuleArgs,
                 opts: Optional[ResourceOptions] = None)
func NewFirewallRule(ctx *Context, name string, args FirewallRuleArgs, opts ...ResourceOption) (*FirewallRule, error)
public FirewallRule(string name, FirewallRuleArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args FirewallRuleArgs
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 FirewallRuleArgs
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 FirewallRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FirewallRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

FirewallId string
The Firewall id
Cidrs List<string>
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
Direction string
will this rule affect ingress traffic
EndPort string
The end port where traffic to be allowed.
Label string
a string that will be the displayed name/reference for this rule (optional)
Protocol string
This may be one of “tcp”, “udp”, or “icmp”.
Region string
The region for this rule
StartPort string
The start port where traffic to be allowed.
FirewallId string
The Firewall id
Cidrs []string
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
Direction string
will this rule affect ingress traffic
EndPort string
The end port where traffic to be allowed.
Label string
a string that will be the displayed name/reference for this rule (optional)
Protocol string
This may be one of “tcp”, “udp”, or “icmp”.
Region string
The region for this rule
StartPort string
The start port where traffic to be allowed.
firewallId string
The Firewall id
cidrs string[]
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
direction string
will this rule affect ingress traffic
endPort string
The end port where traffic to be allowed.
label string
a string that will be the displayed name/reference for this rule (optional)
protocol string
This may be one of “tcp”, “udp”, or “icmp”.
region string
The region for this rule
startPort string
The start port where traffic to be allowed.
firewall_id str
The Firewall id
cidrs Sequence[str]
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
direction str
will this rule affect ingress traffic
end_port str
The end port where traffic to be allowed.
label str
a string that will be the displayed name/reference for this rule (optional)
protocol str
This may be one of “tcp”, “udp”, or “icmp”.
region str
The region for this rule
start_port str
The start port where traffic to be allowed.

Outputs

All input properties are implicitly available as output properties. Additionally, the FirewallRule 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing FirewallRule Resource

Get an existing FirewallRule 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?: FirewallRuleState, opts?: CustomResourceOptions): FirewallRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cidrs: Optional[Sequence[str]] = None,
        direction: Optional[str] = None,
        end_port: Optional[str] = None,
        firewall_id: Optional[str] = None,
        label: Optional[str] = None,
        protocol: Optional[str] = None,
        region: Optional[str] = None,
        start_port: Optional[str] = None) -> FirewallRule
func GetFirewallRule(ctx *Context, name string, id IDInput, state *FirewallRuleState, opts ...ResourceOption) (*FirewallRule, error)
public static FirewallRule Get(string name, Input<string> id, FirewallRuleState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Cidrs List<string>
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
Direction string
will this rule affect ingress traffic
EndPort string
The end port where traffic to be allowed.
FirewallId string
The Firewall id
Label string
a string that will be the displayed name/reference for this rule (optional)
Protocol string
This may be one of “tcp”, “udp”, or “icmp”.
Region string
The region for this rule
StartPort string
The start port where traffic to be allowed.
Cidrs []string
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
Direction string
will this rule affect ingress traffic
EndPort string
The end port where traffic to be allowed.
FirewallId string
The Firewall id
Label string
a string that will be the displayed name/reference for this rule (optional)
Protocol string
This may be one of “tcp”, “udp”, or “icmp”.
Region string
The region for this rule
StartPort string
The start port where traffic to be allowed.
cidrs string[]
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
direction string
will this rule affect ingress traffic
endPort string
The end port where traffic to be allowed.
firewallId string
The Firewall id
label string
a string that will be the displayed name/reference for this rule (optional)
protocol string
This may be one of “tcp”, “udp”, or “icmp”.
region string
The region for this rule
startPort string
The start port where traffic to be allowed.
cidrs Sequence[str]
the IP address of the other end (i.e. not your instance) to affect, or a valid network CIDR (defaults to being globally applied, i.e. 0.0.0.0/0).
direction str
will this rule affect ingress traffic
end_port str
The end port where traffic to be allowed.
firewall_id str
The Firewall id
label str
a string that will be the displayed name/reference for this rule (optional)
protocol str
This may be one of “tcp”, “udp”, or “icmp”.
region str
The region for this rule
start_port str
The start port where traffic to be allowed.

Import

Firewalls can be imported using the firewall firewall_id:firewall_rule_id, e.g.

 $ pulumi import civo:index/firewallRule:FirewallRule http b8ecd2ab-2267-4a5e-8692-cbf1d32583e3:4b0022ee-00b2-4f81-a40d-b4f8728923a7

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.