civo.Firewall
Explore with Pulumi AI
Provides a Civo firewall resource. This can be used to create, modify, and delete firewalls.
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: Optional[FirewallArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Firewall(resource_name: str,
opts: Optional[ResourceOptions] = None,
create_default_rules: Optional[bool] = None,
egress_rules: Optional[Sequence[FirewallEgressRuleArgs]] = None,
ingress_rules: Optional[Sequence[FirewallIngressRuleArgs]] = None,
name: Optional[str] = None,
network_id: Optional[str] = None,
region: Optional[str] = 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.
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 Civo.Firewall("firewallResource", new()
{
CreateDefaultRules = false,
EgressRules = new[]
{
new Civo.Inputs.FirewallEgressRuleArgs
{
Action = "string",
Cidrs = new[]
{
"string",
},
Id = "string",
Label = "string",
PortRange = "string",
Protocol = "string",
},
},
IngressRules = new[]
{
new Civo.Inputs.FirewallIngressRuleArgs
{
Action = "string",
Cidrs = new[]
{
"string",
},
Id = "string",
Label = "string",
PortRange = "string",
Protocol = "string",
},
},
Name = "string",
NetworkId = "string",
Region = "string",
});
example, err := civo.NewFirewall(ctx, "firewallResource", &civo.FirewallArgs{
CreateDefaultRules: pulumi.Bool(false),
EgressRules: civo.FirewallEgressRuleArray{
&civo.FirewallEgressRuleArgs{
Action: pulumi.String("string"),
Cidrs: pulumi.StringArray{
pulumi.String("string"),
},
Id: pulumi.String("string"),
Label: pulumi.String("string"),
PortRange: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
},
IngressRules: civo.FirewallIngressRuleArray{
&civo.FirewallIngressRuleArgs{
Action: pulumi.String("string"),
Cidrs: pulumi.StringArray{
pulumi.String("string"),
},
Id: pulumi.String("string"),
Label: pulumi.String("string"),
PortRange: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
NetworkId: pulumi.String("string"),
Region: pulumi.String("string"),
})
var firewallResource = new Firewall("firewallResource", FirewallArgs.builder()
.createDefaultRules(false)
.egressRules(FirewallEgressRuleArgs.builder()
.action("string")
.cidrs("string")
.id("string")
.label("string")
.portRange("string")
.protocol("string")
.build())
.ingressRules(FirewallIngressRuleArgs.builder()
.action("string")
.cidrs("string")
.id("string")
.label("string")
.portRange("string")
.protocol("string")
.build())
.name("string")
.networkId("string")
.region("string")
.build());
firewall_resource = civo.Firewall("firewallResource",
create_default_rules=False,
egress_rules=[civo.FirewallEgressRuleArgs(
action="string",
cidrs=["string"],
id="string",
label="string",
port_range="string",
protocol="string",
)],
ingress_rules=[civo.FirewallIngressRuleArgs(
action="string",
cidrs=["string"],
id="string",
label="string",
port_range="string",
protocol="string",
)],
name="string",
network_id="string",
region="string")
const firewallResource = new civo.Firewall("firewallResource", {
createDefaultRules: false,
egressRules: [{
action: "string",
cidrs: ["string"],
id: "string",
label: "string",
portRange: "string",
protocol: "string",
}],
ingressRules: [{
action: "string",
cidrs: ["string"],
id: "string",
label: "string",
portRange: "string",
protocol: "string",
}],
name: "string",
networkId: "string",
region: "string",
});
type: civo:Firewall
properties:
createDefaultRules: false
egressRules:
- action: string
cidrs:
- string
id: string
label: string
portRange: string
protocol: string
ingressRules:
- action: string
cidrs:
- string
id: string
label: string
portRange: string
protocol: string
name: string
networkId: string
region: 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
The Firewall resource accepts the following input properties:
- Create
Default boolRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- Egress
Rules List<FirewallEgress Rule> - The egress rules, this is a list of rules that will be applied to the firewall
- Ingress
Rules List<FirewallIngress Rule> - The ingress rules, this is a list of rules that will be applied to the firewall
- Name string
- The firewall name
- Network
Id 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 boolRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- Egress
Rules []FirewallEgress Rule Args - The egress rules, this is a list of rules that will be applied to the firewall
- Ingress
Rules []FirewallIngress Rule Args - The ingress rules, this is a list of rules that will be applied to the firewall
- Name string
- The firewall name
- Network
Id 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 BooleanRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress
Rules List<FirewallEgress Rule> - The egress rules, this is a list of rules that will be applied to the firewall
- ingress
Rules List<FirewallIngress Rule> - The ingress rules, this is a list of rules that will be applied to the firewall
- name String
- The firewall name
- network
Id 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 booleanRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress
Rules FirewallEgress Rule[] - The egress rules, this is a list of rules that will be applied to the firewall
- ingress
Rules FirewallIngress Rule[] - The ingress rules, this is a list of rules that will be applied to the firewall
- name string
- The firewall name
- network
Id 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_ boolrules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress_
rules Sequence[FirewallEgress Rule Args] - The egress rules, this is a list of rules that will be applied to the firewall
- ingress_
rules Sequence[FirewallIngress Rule Args] - The ingress rules, this is a list of rules that will be applied to the firewall
- 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
- create
Default BooleanRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress
Rules List<Property Map> - The egress rules, this is a list of rules that will be applied to the firewall
- ingress
Rules List<Property Map> - The ingress rules, this is a list of rules that will be applied to the firewall
- name String
- The firewall name
- network
Id 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 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,
egress_rules: Optional[Sequence[FirewallEgressRuleArgs]] = None,
ingress_rules: Optional[Sequence[FirewallIngressRuleArgs]] = 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.
- Create
Default boolRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- Egress
Rules List<FirewallEgress Rule> - The egress rules, this is a list of rules that will be applied to the firewall
- Ingress
Rules List<FirewallIngress Rule> - The ingress rules, this is a list of rules that will be applied to the firewall
- Name string
- The firewall name
- Network
Id 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 boolRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- Egress
Rules []FirewallEgress Rule Args - The egress rules, this is a list of rules that will be applied to the firewall
- Ingress
Rules []FirewallIngress Rule Args - The ingress rules, this is a list of rules that will be applied to the firewall
- Name string
- The firewall name
- Network
Id 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 BooleanRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress
Rules List<FirewallEgress Rule> - The egress rules, this is a list of rules that will be applied to the firewall
- ingress
Rules List<FirewallIngress Rule> - The ingress rules, this is a list of rules that will be applied to the firewall
- name String
- The firewall name
- network
Id 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 booleanRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress
Rules FirewallEgress Rule[] - The egress rules, this is a list of rules that will be applied to the firewall
- ingress
Rules FirewallIngress Rule[] - The ingress rules, this is a list of rules that will be applied to the firewall
- name string
- The firewall name
- network
Id 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_ boolrules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress_
rules Sequence[FirewallEgress Rule Args] - The egress rules, this is a list of rules that will be applied to the firewall
- ingress_
rules Sequence[FirewallIngress Rule Args] - The ingress rules, this is a list of rules that will be applied to the firewall
- 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
- create
Default BooleanRules - The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you set to false you need to define at least one ingress or egress rule
- egress
Rules List<Property Map> - The egress rules, this is a list of rules that will be applied to the firewall
- ingress
Rules List<Property Map> - The ingress rules, this is a list of rules that will be applied to the firewall
- name String
- The firewall name
- network
Id 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
Supporting Types
FirewallEgressRule, FirewallEgressRuleArgs
- 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)
- Id string
- Label string
- A string that will be the displayed name/reference for this rule
- Port
Range string - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- Protocol string
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- Id string
- Label string
- A string that will be the displayed name/reference for this rule
- Port
Range string - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- Protocol string
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id String
- label String
- A string that will be the displayed name/reference for this rule
- port
Range String - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol String
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id string
- label string
- A string that will be the displayed name/reference for this rule
- port
Range string - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol string
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id str
- label str
- A string that will be the displayed name/reference for this rule
- port_
range str - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol str
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id String
- label String
- A string that will be the displayed name/reference for this rule
- port
Range String - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol String
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
FirewallIngressRule, FirewallIngressRuleArgs
- 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)
- Id string
- Label string
- A string that will be the displayed name/reference for this rule
- Port
Range string - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- Protocol string
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- Id string
- Label string
- A string that will be the displayed name/reference for this rule
- Port
Range string - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- Protocol string
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id String
- label String
- A string that will be the displayed name/reference for this rule
- port
Range String - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol String
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id string
- label string
- A string that will be the displayed name/reference for this rule
- port
Range string - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol string
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id str
- label str
- A string that will be the displayed name/reference for this rule
- port_
range str - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol str
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
- 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)
- id String
- label String
- A string that will be the displayed name/reference for this rule
- port
Range String - The port or port range to open, can be a single port or a range separated by a dash (
-
), e.g.80
or80-443
- protocol String
- The protocol choice from
tcp
,udp
oricmp
(the default if unspecified istcp
)
Import
using ID
$ pulumi import civo:index/firewall:Firewall www b8ecd2ab-2267-4a5e-8692-cbf1d32583e3
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Civo pulumi/pulumi-civo
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
civo
Terraform Provider.