# Copyright 2020 Google LLC
#
# 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.
#########
# Enable DNS logging on External VPC
apiVersion: dns.cnrm.cloud.google.com/v1beta1
kind: DNSPolicy
metadata:
  name: hub-external-logging-dnspolicy
  namespace: networking
  annotations:
    cnrm.cloud.google.com/project-id: hub-project-id # kpt-set: ${hub-project-id}
    config.kubernetes.io/depends-on: compute.cnrm.cloud.google.com/namespaces/networking/ComputeNetwork/hub-global-external-vpc
spec:
  resourceID: external-logging-dnspolicy
  description: "DNS policy to enable logging on External VPC"
  enableLogging: true
  networks:
    - networkRef:
        name: hub-global-external-vpc
---
# Enable DNS logging on Internal VPC
apiVersion: dns.cnrm.cloud.google.com/v1beta1
kind: DNSPolicy
metadata:
  name: hub-internal-logging-dnspolicy
  namespace: networking
  annotations:
    cnrm.cloud.google.com/project-id: hub-project-id # kpt-set: ${hub-project-id}
    config.kubernetes.io/depends-on: compute.cnrm.cloud.google.com/namespaces/networking/ComputeNetwork/hub-global-internal-vpc
spec:
  resourceID: internal-logging-dnspolicy
  description: "DNS policy to enable logging on Internal VPC"
  enableLogging: true
  networks:
    - networkRef:
        name: hub-global-internal-vpc
---
# Enable DNS logging on Management VPC
apiVersion: dns.cnrm.cloud.google.com/v1beta1
kind: DNSPolicy
metadata:
  name: hub-mgmt-logging-dnspolicy
  namespace: networking
  annotations:
    cnrm.cloud.google.com/project-id: hub-project-id # kpt-set: ${hub-project-id}
    config.kubernetes.io/depends-on: compute.cnrm.cloud.google.com/namespaces/networking/ComputeNetwork/hub-global-mgmt-vpc
spec:
  resourceID: mgmt-logging-dnspolicy
  description: "DNS policy to enable logging on Management VPC"
  enableLogging: true
  networks:
    - networkRef:
        name: hub-global-mgmt-vpc
---
# Enable DNS logging on Transit VPC
apiVersion: dns.cnrm.cloud.google.com/v1beta1
kind: DNSPolicy
metadata:
  name: hub-transit-logging-dnspolicy
  namespace: networking
  annotations:
    cnrm.cloud.google.com/project-id: hub-project-id # kpt-set: ${hub-project-id}
    config.kubernetes.io/depends-on: compute.cnrm.cloud.google.com/namespaces/networking/ComputeNetwork/hub-global-transit-vpc
spec:
  resourceID: transit-logging-dnspolicy
  description: "DNS policy to enable logging on Transit VPC"
  enableLogging: true
  networks:
    - networkRef:
        name: hub-global-transit-vpc
