Package com.pulumi.openstack.firewall
Class PolicyV2
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.openstack.firewall.PolicyV2
-
public class PolicyV2 extends com.pulumi.resources.CustomResourceManages a v2 firewall policy resource within OpenStack. > **Note:** Firewall v2 has no support for OVN currently. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.firewall.RuleV2; import com.pulumi.openstack.firewall.RuleV2Args; import com.pulumi.openstack.firewall.PolicyV2; import com.pulumi.openstack.firewall.PolicyV2Args; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var rule1 = new RuleV2("rule1", RuleV2Args.builder() .description("drop TELNET traffic") .action("deny") .protocol("tcp") .destinationPort("23") .enabled("true") .build()); var rule2 = new RuleV2("rule2", RuleV2Args.builder() .description("drop NTP traffic") .action("deny") .protocol("udp") .destinationPort("123") .enabled("false") .build()); var policy1 = new PolicyV2("policy1", PolicyV2Args.builder() .rules( rule1.id(), rule2.id()) .build()); } } ``` ## Import Firewall Policies can be imported using the `id`, e.g. ```sh $ pulumi import openstack:firewall/policyV2:PolicyV2 policy_1 07f422e6-c596-474b-8b94-fe2c12506ce0 ```
-
-
Constructor Summary
Constructors Constructor Description PolicyV2(java.lang.String name)PolicyV2(java.lang.String name, PolicyV2Args args)PolicyV2(java.lang.String name, PolicyV2Args args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>audited()com.pulumi.core.Output<java.util.Optional<java.lang.String>>description()static PolicyV2get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PolicyV2State state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>projectId()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>rules()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>shared()com.pulumi.core.Output<java.lang.String>tenantId()
-
-
-
Constructor Detail
-
PolicyV2
public PolicyV2(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
PolicyV2
public PolicyV2(java.lang.String name, @Nullable PolicyV2Args args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
PolicyV2
public PolicyV2(java.lang.String name, @Nullable PolicyV2Args args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
audited
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> audited()
- Returns:
- 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 `audited` status of an existing firewall policy.
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- A description for the firewall policy. Changing this updates the `description` of an existing firewall policy.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- A name for the firewall policy. Changing this updates the `name` of an existing firewall policy.
-
projectId
public com.pulumi.core.Output<java.lang.String> projectId()
- Returns:
- This argument conflicts and is interchangeable with `tenant_id`. The owner of the firewall policy. Required if admin wants to create a firewall policy for another project. Changing this creates a new firewall policy.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- The region in which to obtain the v2 networking client. A networking client is needed to create a firewall policy. If omitted, the `region` argument of the provider is used. Changing this creates a new firewall policy.
-
rules
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> rules()
- Returns:
- An array of one or more firewall rules that comprise the policy. Changing this results in adding/removing rules from the existing firewall policy.
-
shared
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> shared()
- Returns:
- 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 `shared` status of an existing firewall policy. Only administrative users can specify if the policy should be shared.
-
tenantId
public com.pulumi.core.Output<java.lang.String> tenantId()
- Returns:
- This argument conflicts and is interchangeable with `project_id`. The owner of the firewall policy. Required if admin wants to create a firewall policy for another tenant. Changing this creates a new firewall policy.
-
get
public static PolicyV2 get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable PolicyV2State state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-