civo.FirewallRule
Explore with Pulumi AI
Provides a Civo firewall rule resource. This can be used to create, modify, and delete firewalls rules. This resource don’t have an update option because Civo backend doesn’t support it at this moment. In that case, we use ForceNew
for all object in the resource.
Create FirewallRule Resource
new FirewallRule(name: string, args: FirewallRuleArgs, opts?: CustomResourceOptions);
@overload
def FirewallRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = 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)
public FirewallRule(String name, FirewallRuleArgs args)
public FirewallRule(String name, FirewallRuleArgs args, CustomResourceOptions options)
type: civo:FirewallRule
properties: # The arguments to resource properties.
options: # 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.
- 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.
- name String
- The unique name of the resource.
- args FirewallRuleArgs
- The arguments to resource properties.
- options 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:
- 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, settingaction = '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)
- Direction string
The direction of the rule can be ingress or egress
- Firewall
Id string The Firewall ID
- End
Port string The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- Label string
A string that will be the displayed name/reference for this rule
- Protocol string
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- Region string
The region for this rule
- Start
Port string The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- Direction string
The direction of the rule can be ingress or egress
- Firewall
Id string The Firewall ID
- End
Port string The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- Label string
A string that will be the displayed name/reference for this rule
- Protocol string
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- Region string
The region for this rule
- Start
Port string The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction String
The direction of the rule can be ingress or egress
- firewall
Id String The Firewall ID
- end
Port String The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- label String
A string that will be the displayed name/reference for this rule
- protocol String
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region String
The region for this rule
- start
Port String The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction string
The direction of the rule can be ingress or egress
- firewall
Id string The Firewall ID
- end
Port string The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- label string
A string that will be the displayed name/reference for this rule
- protocol string
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region string
The region for this rule
- start
Port string The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction str
The direction of the rule can be ingress or egress
- firewall_
id str The Firewall ID
- end_
port str The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- label str
A string that will be the displayed name/reference for this rule
- protocol str
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region str
The region for this rule
- start_
port str The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction String
The direction of the rule can be ingress or egress
- firewall
Id String The Firewall ID
- end
Port String The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- label String
A string that will be the displayed name/reference for this rule
- protocol String
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region String
The region for this rule
- start
Port String The start of the port range to configure for this rule (or the single port if required)
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 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 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,
action: Optional[str] = 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)
public static FirewallRule get(String name, Output<String> id, FirewallRuleState 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.
- 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, settingaction = '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)
- Direction string
The direction of the rule can be ingress or egress
- End
Port string The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- Firewall
Id string The Firewall ID
- Label string
A string that will be the displayed name/reference for this rule
- Protocol string
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- Region string
The region for this rule
- Start
Port string The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- Direction string
The direction of the rule can be ingress or egress
- End
Port string The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- Firewall
Id string The Firewall ID
- Label string
A string that will be the displayed name/reference for this rule
- Protocol string
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- Region string
The region for this rule
- Start
Port string The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction String
The direction of the rule can be ingress or egress
- end
Port String The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- firewall
Id String The Firewall ID
- label String
A string that will be the displayed name/reference for this rule
- protocol String
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region String
The region for this rule
- start
Port String The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction string
The direction of the rule can be ingress or egress
- end
Port string The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- firewall
Id string The Firewall ID
- label string
A string that will be the displayed name/reference for this rule
- protocol string
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region string
The region for this rule
- start
Port string The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction str
The direction of the rule can be ingress or egress
- end_
port str The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- firewall_
id str The Firewall ID
- label str
A string that will be the displayed name/reference for this rule
- protocol str
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region str
The region for this rule
- start_
port str The start of the port range to configure for this rule (or the single port if required)
- 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, settingaction = '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)
- direction String
The direction of the rule can be ingress or egress
- end
Port String The end of the port range (this is optional, by default it will only apply to the single port listed in start_port)
- firewall
Id String The Firewall ID
- label String
A string that will be the displayed name/reference for this rule
- protocol String
The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)- region String
The region for this rule
- start
Port String The start of the port range to configure for this rule (or the single port if required)
Import
using firewall_id:firewall_rule_id
$ pulumi import civo:index/firewallRule:FirewallRule http b8ecd2ab-2267-4a5e-8692-cbf1d32583e3:4b0022ee-00b2-4f81-a40d-b4f8728923a7
Package Details
- Repository
- Civo pulumi/pulumi-civo
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
civo
Terraform Provider.