Class Policy


  • public class Policy
    extends com.pulumi.resources.CustomResource
    Manages a v1 firewall policy resource within OpenStack. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.firewall.Rule; import com.pulumi.openstack.firewall.RuleArgs; import com.pulumi.openstack.firewall.Policy; import com.pulumi.openstack.firewall.PolicyArgs; 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 Rule("rule1", RuleArgs.builder() .description("drop TELNET traffic") .action("deny") .protocol("tcp") .destinationPort("23") .enabled("true") .build()); var rule2 = new Rule("rule2", RuleArgs.builder() .description("drop NTP traffic") .action("deny") .protocol("udp") .destinationPort("123") .enabled("false") .build()); var policy1 = new Policy("policy1", PolicyArgs.builder() .rules( rule1.id(), rule2.id()) .build()); } } ``` ## Import Firewall Policies can be imported using the `id`, e.g. ```sh $ pulumi import openstack:firewall/policy:Policy policy_1 07f422e6-c596-474b-8b94-fe2c12506ce0 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Policy​(java.lang.String name)  
      Policy​(java.lang.String name, PolicyArgs args)  
      Policy​(java.lang.String name, PolicyArgs 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 Policy get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PolicyState 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> 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()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> valueSpecs()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Policy

        public Policy​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Policy

        public Policy​(java.lang.String name,
                      @Nullable
                      PolicyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Policy

        public Policy​(java.lang.String name,
                      @Nullable
                      PolicyArgs 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.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        The region in which to obtain the v1 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()
      • valueSpecs

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> valueSpecs()
        Returns:
        Map of additional options.
      • get

        public static Policy get​(java.lang.String name,
                                 com.pulumi.core.Output<java.lang.String> id,
                                 @Nullable
                                 PolicyState 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.