# Copyright 2023 Google LLC. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
  title: Compute/NetworkFirewallPolicyRule
  description: The Compute NetworkFirewallPolicyRule resource
  x-dcl-struct-name: NetworkFirewallPolicyRule
  x-dcl-has-iam: false
paths:
  get:
    description: The function used to get information about a NetworkFirewallPolicyRule
    parameters:
    - name: networkFirewallPolicyRule
      required: true
      description: A full instance of a NetworkFirewallPolicyRule
  apply:
    description: The function used to apply information about a NetworkFirewallPolicyRule
    parameters:
    - name: networkFirewallPolicyRule
      required: true
      description: A full instance of a NetworkFirewallPolicyRule
  delete:
    description: The function used to delete a NetworkFirewallPolicyRule
    parameters:
    - name: networkFirewallPolicyRule
      required: true
      description: A full instance of a NetworkFirewallPolicyRule
  deleteAll:
    description: The function used to delete all NetworkFirewallPolicyRule
    parameters:
    - name: project
      required: true
      schema:
        type: string
    - name: location
      required: true
      schema:
        type: string
    - name: firewallPolicy
      required: true
      schema:
        type: string
  list:
    description: The function used to list information about many NetworkFirewallPolicyRule
    parameters:
    - name: project
      required: true
      schema:
        type: string
    - name: location
      required: true
      schema:
        type: string
    - name: firewallPolicy
      required: true
      schema:
        type: string
components:
  schemas:
    NetworkFirewallPolicyRule:
      title: NetworkFirewallPolicyRule
      x-dcl-id: projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}
      x-dcl-locations:
      - global
      - region
      x-dcl-parent-container: project
      x-dcl-has-create: true
      x-dcl-has-iam: false
      x-dcl-read-timeout: 0
      x-dcl-apply-timeout: 0
      x-dcl-delete-timeout: 0
      type: object
      required:
      - priority
      - match
      - action
      - direction
      - firewallPolicy
      - project
      properties:
        action:
          type: string
          x-dcl-go-name: Action
          description: The Action to perform when the client connection triggers the
            rule. Valid actions are "allow", "deny" and "goto_next".
        description:
          type: string
          x-dcl-go-name: Description
          description: An optional description for this resource.
        direction:
          type: string
          x-dcl-go-name: Direction
          x-dcl-go-type: NetworkFirewallPolicyRuleDirectionEnum
          description: 'The direction in which this rule applies. Possible values:
            INGRESS, EGRESS'
          enum:
          - INGRESS
          - EGRESS
        disabled:
          type: boolean
          x-dcl-go-name: Disabled
          description: 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:
          type: boolean
          x-dcl-go-name: EnableLogging
          description: '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:
          type: string
          x-dcl-go-name: FirewallPolicy
          description: The firewall policy of the resource.
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Compute/NetworkFirewallPolicy
            field: name
            parent: true
        kind:
          type: string
          x-dcl-go-name: Kind
          readOnly: true
          description: Type of the resource. Always `compute#firewallPolicyRule` for
            firewall policy rules
          x-kubernetes-immutable: true
        location:
          type: string
          x-dcl-go-name: Location
          description: The location of this resource.
          x-kubernetes-immutable: true
        match:
          type: object
          x-dcl-go-name: Match
          x-dcl-go-type: NetworkFirewallPolicyRuleMatch
          description: A match condition that incoming traffic is evaluated against.
            If it evaluates to true, the corresponding 'action' is enforced.
          required:
          - layer4Configs
          properties:
            destAddressGroups:
              type: array
              x-dcl-go-name: DestAddressGroups
              description: Address groups which should be matched against the traffic
                destination. Maximum number of destination address groups is 10. Destination
                address groups is only supported in Egress rules.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            destFqdns:
              type: array
              x-dcl-go-name: DestFqdns
              description: Domain names that will be used to match against the resolved
                domain name of destination of traffic. Can only be specified if DIRECTION
                is egress.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            destIPRanges:
              type: array
              x-dcl-go-name: DestIPRanges
              description: CIDR IP address range. Maximum number of destination CIDR
                IP ranges allowed is 5000.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            destRegionCodes:
              type: array
              x-dcl-go-name: DestRegionCodes
              description: The Unicode country codes whose IP addresses will be used
                to match against the source of traffic. Can only be specified if DIRECTION
                is egress.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            destThreatIntelligences:
              type: array
              x-dcl-go-name: DestThreatIntelligences
              description: Name of the Google Cloud Threat Intelligence list.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            layer4Configs:
              type: array
              x-dcl-go-name: Layer4Configs
              description: Pairs of IP protocols and ports that the rule should match.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: object
                x-dcl-go-type: NetworkFirewallPolicyRuleMatchLayer4Configs
                required:
                - ipProtocol
                properties:
                  ipProtocol:
                    type: string
                    x-dcl-go-name: IPProtocol
                    description: The IP protocol to which this rule applies. The protocol
                      type is required when creating a firewall rule. This value can
                      either be one of the following well known protocol strings (`tcp`,
                      `udp`, `icmp`, `esp`, `ah`, `ipip`, `sctp`), or the IP protocol
                      number.
                  ports:
                    type: array
                    x-dcl-go-name: Ports
                    description: 'An optional list of ports to which this rule applies.
                      This field is only applicable for UDP or TCP protocol. Each
                      entry must be either an integer or a range. If not specified,
                      this rule applies to connections through any port. Example inputs
                      include: ``.'
                    x-dcl-send-empty: true
                    x-dcl-list-type: list
                    items:
                      type: string
                      x-dcl-go-type: string
            srcAddressGroups:
              type: array
              x-dcl-go-name: SrcAddressGroups
              description: Address groups which should be matched against the traffic
                source. Maximum number of source address groups is 10. Source address
                groups is only supported in Ingress rules.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            srcFqdns:
              type: array
              x-dcl-go-name: SrcFqdns
              description: Domain names that will be used to match against the resolved
                domain name of source of traffic. Can only be specified if DIRECTION
                is ingress.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            srcIPRanges:
              type: array
              x-dcl-go-name: SrcIPRanges
              description: CIDR IP address range. Maximum number of source CIDR IP
                ranges allowed is 5000.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            srcRegionCodes:
              type: array
              x-dcl-go-name: SrcRegionCodes
              description: The Unicode country codes whose IP addresses will be used
                to match against the source of traffic. Can only be specified if DIRECTION
                is ingress.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            srcSecureTags:
              type: array
              x-dcl-go-name: SrcSecureTags
              description: List of secure tag values, which should be matched at the
                source of the traffic. For INGRESS rule, if all the <code>srcSecureTag</code>
                are INEFFECTIVE, and there is no <code>srcIpRange</code>, this rule
                will be ignored. Maximum number of source tag values allowed is 256.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: object
                x-dcl-go-type: NetworkFirewallPolicyRuleMatchSrcSecureTags
                required:
                - name
                properties:
                  name:
                    type: string
                    x-dcl-go-name: Name
                    description: Name of the secure tag, created with TagManager's
                      TagValue API. @pattern tagValues/[0-9]+
                    x-dcl-references:
                    - resource: Cloudresourcemanager/TagValue
                      field: namespacedName
                  state:
                    type: string
                    x-dcl-go-name: State
                    x-dcl-go-type: NetworkFirewallPolicyRuleMatchSrcSecureTagsStateEnum
                    readOnly: true
                    description: '[Output Only] State of the secure tag, either `EFFECTIVE`
                      or `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted
                      or its network is deleted.'
                    enum:
                    - EFFECTIVE
                    - INEFFECTIVE
            srcThreatIntelligences:
              type: array
              x-dcl-go-name: SrcThreatIntelligences
              description: Name of the Google Cloud Threat Intelligence list.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
        priority:
          type: integer
          format: int64
          x-dcl-go-name: Priority
          description: 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.
          x-kubernetes-immutable: true
        project:
          type: string
          x-dcl-go-name: Project
          description: The project for the resource
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Cloudresourcemanager/Project
            field: name
            parent: true
        ruleName:
          type: string
          x-dcl-go-name: RuleName
          description: An optional name for the rule. This field is not a unique identifier
            and can be updated.
        ruleTupleCount:
          type: integer
          format: int64
          x-dcl-go-name: RuleTupleCount
          readOnly: true
          description: Calculation of the complexity of a single firewall policy rule.
          x-kubernetes-immutable: true
        targetSecureTags:
          type: array
          x-dcl-go-name: TargetSecureTags
          description: 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.
          x-dcl-send-empty: true
          x-dcl-list-type: list
          items:
            type: object
            x-dcl-go-type: NetworkFirewallPolicyRuleTargetSecureTags
            required:
            - name
            properties:
              name:
                type: string
                x-dcl-go-name: Name
                description: Name of the secure tag, created with TagManager's TagValue
                  API. @pattern tagValues/[0-9]+
                x-dcl-references:
                - resource: Cloudresourcemanager/TagValue
                  field: namespacedName
              state:
                type: string
                x-dcl-go-name: State
                x-dcl-go-type: NetworkFirewallPolicyRuleTargetSecureTagsStateEnum
                readOnly: true
                description: '[Output Only] State of the secure tag, either `EFFECTIVE`
                  or `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted
                  or its network is deleted.'
                enum:
                - EFFECTIVE
                - INEFFECTIVE
        targetServiceAccounts:
          type: array
          x-dcl-go-name: TargetServiceAccounts
          description: A list of service accounts indicating the sets of instances
            that are applied with this rule.
          x-dcl-send-empty: true
          x-dcl-list-type: list
          items:
            type: string
            x-dcl-go-type: string
            x-dcl-references:
            - resource: Iam/ServiceAccount
              field: name
