Class RegionNetworkFirewallPolicyRule


  • public class RegionNetworkFirewallPolicyRule
    extends com.pulumi.resources.CustomResource
    The Compute NetworkFirewallPolicyRule resource ## Example Usage ### Regional ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.networksecurity.AddressGroup; import com.pulumi.gcp.networksecurity.AddressGroupArgs; import com.pulumi.gcp.compute.RegionNetworkFirewallPolicy; import com.pulumi.gcp.compute.RegionNetworkFirewallPolicyArgs; import com.pulumi.gcp.compute.Network; import com.pulumi.gcp.tags.TagKey; import com.pulumi.gcp.tags.TagKeyArgs; import com.pulumi.gcp.tags.TagValue; import com.pulumi.gcp.tags.TagValueArgs; import com.pulumi.gcp.compute.RegionNetworkFirewallPolicyRule; import com.pulumi.gcp.compute.RegionNetworkFirewallPolicyRuleArgs; import com.pulumi.gcp.compute.inputs.RegionNetworkFirewallPolicyRuleMatchArgs; 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 basicRegionalNetworksecurityAddressGroup = new AddressGroup("basicRegionalNetworksecurityAddressGroup", AddressGroupArgs.builder() .parent("projects/my-project-name") .description("Sample regional networksecurity_address_group") .location("us-west1") .items("208.80.154.224/32") .type("IPV4") .capacity(100) .build()); var basicRegionalNetworkFirewallPolicy = new RegionNetworkFirewallPolicy("basicRegionalNetworkFirewallPolicy", RegionNetworkFirewallPolicyArgs.builder() .description("Sample regional network firewall policy") .project("my-project-name") .region("us-west1") .build()); var basicNetwork = new Network("basicNetwork"); var basicKey = new TagKey("basicKey", TagKeyArgs.builder() .description("For keyname resources.") .parent("organizations/123456789") .purpose("GCE_FIREWALL") .shortName("tagkey") .purposeData(Map.of("network", basicNetwork.name().applyValue(name -> String.format("my-project-name/%s", name)))) .build()); var basicValue = new TagValue("basicValue", TagValueArgs.builder() .description("For valuename resources.") .parent(basicKey.name().applyValue(name -> String.format("tagKeys/%s", name))) .shortName("tagvalue") .build()); var primary = new RegionNetworkFirewallPolicyRule("primary", RegionNetworkFirewallPolicyRuleArgs.builder() .action("allow") .description("This is a simple rule description") .direction("INGRESS") .disabled(false) .enableLogging(true) .firewallPolicy(basicRegionalNetworkFirewallPolicy.name()) .priority(1000) .region("us-west1") .ruleName("test-rule") .targetServiceAccounts("[email protected]") .match(RegionNetworkFirewallPolicyRuleMatchArgs.builder() .srcIpRanges("10.100.0.1/32") .srcFqdns("example.com") .srcRegionCodes("US") .srcThreatIntelligences("iplist-known-malicious-ips") .layer4Configs(RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs.builder() .ipProtocol("all") .build()) .srcSecureTags(RegionNetworkFirewallPolicyRuleMatchSrcSecureTagArgs.builder() .name(basicValue.name().applyValue(name -> String.format("tagValues/%s", name))) .build()) .srcAddressGroups(basicRegionalNetworksecurityAddressGroup.id()) .build()) .build()); } } ``` ## Import NetworkFirewallPolicyRule can be imported using any of these accepted formats ```sh $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/{{priority}} ``` ```sh $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{project}}/{{region}}/{{firewall_policy}}/{{priority}} ``` ```sh $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{region}}/{{firewall_policy}}/{{priority}} ``` ```sh $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{firewall_policy}}/{{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.lang.String> direction()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disabled()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableLogging()  
      com.pulumi.core.Output<java.lang.String> firewallPolicy()  
      static RegionNetworkFirewallPolicyRule get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RegionNetworkFirewallPolicyRuleState 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> kind()  
      com.pulumi.core.Output<RegionNetworkFirewallPolicyRuleMatch> match()  
      com.pulumi.core.Output<java.lang.Integer> priority()  
      com.pulumi.core.Output<java.lang.String> project()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> ruleName()  
      com.pulumi.core.Output<java.lang.Integer> ruleTupleCount()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<RegionNetworkFirewallPolicyRuleTargetSecureTag>>> targetSecureTags()  
      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

      • RegionNetworkFirewallPolicyRule

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

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

        public RegionNetworkFirewallPolicyRule​(java.lang.String name,
                                               RegionNetworkFirewallPolicyRuleArgs 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. Valid actions are "allow", "deny" and "goto_next".
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        An optional description for this resource.
      • direction

        public com.pulumi.core.Output<java.lang.String> direction()
        Returns:
        The direction in which this rule applies. Possible values: INGRESS, EGRESS
      • disabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disabled()
        Returns:
        Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
      • 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. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
      • firewallPolicy

        public com.pulumi.core.Output<java.lang.String> firewallPolicy()
        Returns:
        The firewall policy of the resource.
      • kind

        public com.pulumi.core.Output<java.lang.String> kind()
        Returns:
        Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
      • match

        public com.pulumi.core.Output<RegionNetworkFirewallPolicyRuleMatch> match()
        Returns:
        A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is 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 positive 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.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The project for the resource
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        The location of this resource.
      • ruleName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> ruleName()
        Returns:
        An optional name for the rule. This field is not a unique identifier and can be updated.
      • ruleTupleCount

        public com.pulumi.core.Output<java.lang.Integer> ruleTupleCount()
        Returns:
        Calculation of the complexity of a single firewall policy rule.
      • targetSecureTags

        public com.pulumi.core.Output<java.util.Optional<java.util.List<RegionNetworkFirewallPolicyRuleTargetSecureTag>>> targetSecureTags()
        Returns:
        A list of secure tags that controls which instances the firewall rule applies to. If <code>targetSecureTag</code> are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored. <code>targetSecureTag</code> may not be set at the same time as <code>targetServiceAccounts</code>. If neither <code>targetServiceAccounts</code> nor <code>targetSecureTag</code> are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256.
      • 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 RegionNetworkFirewallPolicyRule get​(java.lang.String name,
                                                          com.pulumi.core.Output<java.lang.String> id,
                                                          @Nullable
                                                          RegionNetworkFirewallPolicyRuleState 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.