Class OrganizationSecurityPolicyRule


  • public class OrganizationSecurityPolicyRule
    extends com.pulumi.resources.CustomResource
    A rule for the OrganizationSecurityPolicy. To get more information about OrganizationSecurityPolicyRule, see: * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/organizationSecurityPolicies/addRule) * How-to Guides * [Creating firewall rules](https://cloud.google.com/vpc/docs/using-firewall-policies#create-rules) ## Example Usage ### Organization Security Policy Rule Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.compute.OrganizationSecurityPolicy; import com.pulumi.gcp.compute.OrganizationSecurityPolicyArgs; import com.pulumi.gcp.compute.OrganizationSecurityPolicyRule; import com.pulumi.gcp.compute.OrganizationSecurityPolicyRuleArgs; import com.pulumi.gcp.compute.inputs.OrganizationSecurityPolicyRuleMatchArgs; import com.pulumi.gcp.compute.inputs.OrganizationSecurityPolicyRuleMatchConfigArgs; import com.pulumi.resources.CustomResourceOptions; 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 policyOrganizationSecurityPolicy = new OrganizationSecurityPolicy("policyOrganizationSecurityPolicy", OrganizationSecurityPolicyArgs.builder() .displayName("tf-test") .parent("organizations/123456789") .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var policyOrganizationSecurityPolicyRule = new OrganizationSecurityPolicyRule("policyOrganizationSecurityPolicyRule", OrganizationSecurityPolicyRuleArgs.builder() .policyId(policyOrganizationSecurityPolicy.id()) .action("allow") .direction("INGRESS") .enableLogging(true) .match(OrganizationSecurityPolicyRuleMatchArgs.builder() .config(OrganizationSecurityPolicyRuleMatchConfigArgs.builder() .srcIpRanges( "192.168.0.0/16", "10.0.0.0/8") .layer4Configs( OrganizationSecurityPolicyRuleMatchConfigLayer4ConfigArgs.builder() .ipProtocol("tcp") .ports("22") .build(), OrganizationSecurityPolicyRuleMatchConfigLayer4ConfigArgs.builder() .ipProtocol("icmp") .build()) .build()) .build()) .priority(100) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); } } ``` ## Import OrganizationSecurityPolicyRule can be imported using any of these accepted formats: ```sh $ pulumi import gcp:compute/organizationSecurityPolicyRule:OrganizationSecurityPolicyRule default {{policy_id}}/priority/{{priority}} ```
    • 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> action()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> direction()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableLogging()  
      static OrganizationSecurityPolicyRule get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, OrganizationSecurityPolicyRuleState 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<OrganizationSecurityPolicyRuleMatch> match()  
      com.pulumi.core.Output<java.lang.String> policyId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> preview()  
      com.pulumi.core.Output<java.lang.Integer> priority()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> targetResources()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> targetServiceAccounts()  
      • 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

      • OrganizationSecurityPolicyRule

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

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

        public OrganizationSecurityPolicyRule​(java.lang.String name,
                                              OrganizationSecurityPolicyRuleArgs 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

      • action

        public com.pulumi.core.Output<java.lang.String> action()
        Returns:
        The Action to perform when the client connection triggers the rule. Can currently be either "allow", "deny" or "goto_next".
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        A description of the rule.
      • direction

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> direction()
        Returns:
        The direction in which this rule applies. If unspecified an INGRESS rule is created. Possible values are: `INGRESS`, `EGRESS`.
      • enableLogging

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableLogging()
        Returns:
        Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver.
      • match

        public com.pulumi.core.Output<OrganizationSecurityPolicyRuleMatch> match()
        Returns:
        A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
      • policyId

        public com.pulumi.core.Output<java.lang.String> policyId()
        Returns:
        The ID of the OrganizationSecurityPolicy this rule applies to.
      • preview

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> preview()
        Returns:
        If set to true, the specified action is not enforced.
      • priority

        public com.pulumi.core.Output<java.lang.Integer> priority()
        Returns:
        An integer indicating the priority of a rule in the list. The priority must be a value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
      • targetResources

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> targetResources()
        Returns:
        A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
      • targetServiceAccounts

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> targetServiceAccounts()
        Returns:
        A list of service accounts indicating the sets of instances that are applied with this rule.
      • get

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