Rule
Manages a v1 firewall rule resource within OpenStack.
Example Usage
using Pulumi;
using OpenStack = Pulumi.OpenStack;
class MyStack : Stack
{
public MyStack()
{
var rule1 = new OpenStack.Firewall.Rule("rule1", new OpenStack.Firewall.RuleArgs
{
Action = "deny",
Description = "drop TELNET traffic",
DestinationPort = "23",
Enabled = true,
Protocol = "tcp",
});
}
}
Coming soon!
import pulumi
import pulumi_openstack as openstack
rule1 = openstack.firewall.Rule("rule1",
action="deny",
description="drop TELNET traffic",
destination_port="23",
enabled="true",
protocol="tcp")import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const rule1 = new openstack.firewall.Rule("rule_1", {
action: "deny",
description: "drop TELNET traffic",
destinationPort: "23",
enabled: true,
protocol: "tcp",
});Create a Rule Resource
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);def Rule(resource_name, opts=None, action=None, description=None, destination_ip_address=None, destination_port=None, enabled=None, ip_version=None, name=None, protocol=None, region=None, source_ip_address=None, source_port=None, tenant_id=None, value_specs=None, __props__=None);public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Rule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Rule resource accepts the following input properties:
- Action string
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- Protocol string
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- Description string
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- Destination
Ip stringAddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- Destination
Port string The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- Enabled bool
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- Ip
Version int IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- Name string
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- Region string
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- Source
Ip stringAddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- Source
Port string The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- Tenant
Id string The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- Value
Specs Dictionary<string, object> Map of additional options.
- Action string
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- Protocol string
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- Description string
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- Destination
Ip stringAddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- Destination
Port string The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- Enabled bool
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- Ip
Version int IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- Name string
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- Region string
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- Source
Ip stringAddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- Source
Port string The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- Tenant
Id string The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- Value
Specs map[string]interface{} Map of additional options.
- action string
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- protocol string
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- description string
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- destination
Ip stringAddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- destination
Port string The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- enabled boolean
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- ip
Version number IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- name string
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- region string
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- source
Ip stringAddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- source
Port string The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- tenant
Id string The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- value
Specs {[key: string]: any} Map of additional options.
- action str
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- protocol str
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- description str
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- destination_
ip_ straddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- destination_
port str The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- enabled bool
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- ip_
version float IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- name str
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- region str
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- source_
ip_ straddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- source_
port str The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- tenant_
id str The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- value_
specs Dict[str, Any] Map of additional options.
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule resource produces the following output properties:
Look up an Existing Rule Resource
Get an existing Rule 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?: RuleState, opts?: CustomResourceOptions): Rulestatic get(resource_name, id, opts=None, action=None, description=None, destination_ip_address=None, destination_port=None, enabled=None, ip_version=None, name=None, protocol=None, region=None, source_ip_address=None, source_port=None, tenant_id=None, value_specs=None, __props__=None);public static Rule Get(string name, Input<string> id, RuleState? 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:
- Action string
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- Description string
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- Destination
Ip stringAddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- Destination
Port string The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- Enabled bool
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- Ip
Version int IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- Name string
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- Protocol string
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- Region string
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- Source
Ip stringAddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- Source
Port string The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- Tenant
Id string The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- Value
Specs Dictionary<string, object> Map of additional options.
- Action string
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- Description string
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- Destination
Ip stringAddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- Destination
Port string The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- Enabled bool
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- Ip
Version int IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- Name string
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- Protocol string
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- Region string
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- Source
Ip stringAddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- Source
Port string The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- Tenant
Id string The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- Value
Specs map[string]interface{} Map of additional options.
- action string
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- description string
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- destination
Ip stringAddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- destination
Port string The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- enabled boolean
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- ip
Version number IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- name string
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- protocol string
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- region string
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- source
Ip stringAddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- source
Port string The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- tenant
Id string The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- value
Specs {[key: string]: any} Map of additional options.
- action str
Action to be taken ( must be “allow” or “deny”) when the firewall rule matches. Changing this updates the
actionof an existing firewall rule.- description str
A description for the firewall rule. Changing this updates the
descriptionof an existing firewall rule.- destination_
ip_ straddress The destination IP address on which the firewall rule operates. Changing this updates the
destination_ip_addressof an existing firewall rule.- destination_
port str The destination port on which the firewall rule operates. Changing this updates the
destination_portof an existing firewall rule.- enabled bool
Enabled status for the firewall rule (must be “true” or “false” if provided - defaults to “true”). Changing this updates the
enabledstatus of an existing firewall rule.- ip_
version float IP version, either 4 (default) or 6. Changing this updates the
ip_versionof an existing firewall rule.- name str
A unique name for the firewall rule. Changing this updates the
nameof an existing firewall rule.- protocol str
The protocol type on which the firewall rule operates. Valid values are:
tcp,udp,icmp, andany. Changing this updates theprotocolof an existing firewall rule.- region str
The region in which to obtain the v1 Compute client. A Compute client is needed to create a firewall rule. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall rule.- source_
ip_ straddress The source IP address on which the firewall rule operates. Changing this updates the
source_ip_addressof an existing firewall rule.- source_
port str The source port on which the firewall rule operates. Changing this updates the
source_portof an existing firewall rule.- tenant_
id str The owner of the firewall rule. Required if admin wants to create a firewall rule for another tenant. Changing this creates a new firewall rule.
- value_
specs Dict[str, Any] Map of additional options.
Package Details
- Repository
- https://github.com/pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstackTerraform Provider.