Policy
Manages a v1 firewall policy 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",
});
var rule2 = new OpenStack.Firewall.Rule("rule2", new OpenStack.Firewall.RuleArgs
{
Action = "deny",
Description = "drop NTP traffic",
DestinationPort = "123",
Enabled = false,
Protocol = "udp",
});
var policy1 = new OpenStack.Firewall.Policy("policy1", new OpenStack.Firewall.PolicyArgs
{
Rules =
{
rule1.Id,
rule2.Id,
},
});
}
}
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")
rule2 = openstack.firewall.Rule("rule2",
action="deny",
description="drop NTP traffic",
destination_port="123",
enabled="false",
protocol="udp")
policy1 = openstack.firewall.Policy("policy1", rules=[
rule1.id,
rule2.id,
])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",
});
const rule2 = new openstack.firewall.Rule("rule_2", {
action: "deny",
description: "drop NTP traffic",
destinationPort: "123",
enabled: false,
protocol: "udp",
});
const policy1 = new openstack.firewall.Policy("policy_1", {
rules: [
rule1.id,
rule2.id,
],
});Create a Policy Resource
new Policy(name: string, args?: PolicyArgs, opts?: CustomResourceOptions);def Policy(resource_name, opts=None, audited=None, description=None, name=None, region=None, rules=None, shared=None, tenant_id=None, value_specs=None, __props__=None);func NewPolicy(ctx *Context, name string, args *PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args PolicyArgs
- 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 PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Policy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Policy resource accepts the following input properties:
- Audited bool
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- Description string
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- Name string
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- Region string
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- Rules List<string>
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- bool
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- Tenant
Id string - Value
Specs Dictionary<string, object> Map of additional options.
- Audited bool
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- Description string
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- Name string
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- Region string
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- Rules []string
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- bool
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- Tenant
Id string - Value
Specs map[string]interface{} Map of additional options.
- audited boolean
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- description string
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- name string
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- region string
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- rules string[]
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- boolean
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- tenant
Id string - value
Specs {[key: string]: any} Map of additional options.
- audited bool
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- description str
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- name str
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- region str
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- rules List[str]
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- bool
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- tenant_
id str - value_
specs Dict[str, Any] Map of additional options.
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
Look up an Existing Policy Resource
Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policystatic get(resource_name, id, opts=None, audited=None, description=None, name=None, region=None, rules=None, shared=None, tenant_id=None, value_specs=None, __props__=None);func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)public static Policy Get(string name, Input<string> id, PolicyState? 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:
- Audited bool
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- Description string
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- Name string
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- Region string
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- Rules List<string>
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- bool
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- Tenant
Id string - Value
Specs Dictionary<string, object> Map of additional options.
- Audited bool
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- Description string
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- Name string
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- Region string
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- Rules []string
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- bool
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- Tenant
Id string - Value
Specs map[string]interface{} Map of additional options.
- audited boolean
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- description string
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- name string
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- region string
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- rules string[]
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- boolean
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- tenant
Id string - value
Specs {[key: string]: any} Map of additional options.
- audited bool
Audit status of the firewall policy (must be “true” or “false” if provided - defaults to “false”). This status is set to “false” whenever the firewall policy or any of its rules are changed. Changing this updates the
auditedstatus of an existing firewall policy.- description str
A description for the firewall policy. Changing this updates the
descriptionof an existing firewall policy.- name str
A name for the firewall policy. Changing this updates the
nameof an existing firewall policy.- region str
The region in which to obtain the v1 networking client. A networking client is needed to create a firewall policy. If omitted, the
regionargument of the provider is used. Changing this creates a new firewall policy.- rules List[str]
An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
- bool
Sharing status of the firewall policy (must be “true” or “false” if provided). If this is “true” the policy is visible to, and can be used in, firewalls in other tenants. Changing this updates the
sharedstatus of an existing firewall policy. Only administrative users can specify if the policy should be shared.- tenant_
id str - 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.