---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.14.0
  name: vpcpeerings.dedicated.regionalserver.tidbcloud.com
spec:
  group: dedicated.regionalserver.tidbcloud.com
  names:
    categories:
    - regionserver
    kind: VPCPeering
    listKind: VPCPeeringList
    plural: vpcpeerings
    singular: vpcpeering
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .metadata.labels.cloud\.pingcap\.com/tenantId
      name: TENANT
      type: string
    - jsonPath: .spec.sourceVPCRef.name
      name: SOURCE-VPC-REF
      type: string
    - jsonPath: .status.externalName
      name: EXTERNAL-NAME
      type: string
    - jsonPath: .metadata.annotations.dedicated\.regionalserver\.tidbcloud\.com/paused
      name: PAUSED
      type: string
    - jsonPath: .status.phase
      name: PHASE
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: AGE
      type: date
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: VPC is the Schema for the VPCPeering API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            properties:
              accountRef:
                description: |-
                  AccountReference is a reference to an Account CR.
                  It can be extended to use other types of references, like label selector.
                properties:
                  accountId:
                    description: aws account id or gcp project id
                    type: string
                  providerConfigName:
                    type: string
                  role:
                    type: string
                required:
                - accountId
                - providerConfigName
                type: object
              provider:
                description: since regional-server support logic region, we need to
                  define `Porvider` and `Region` in Spec.
                type: string
              region:
                type: string
              sourceVPCRef:
                description: Source porints to the dedicated.regionalserver.tidbcloud.com/vpc
                  CR's name
                properties:
                  name:
                    type: string
                  namespace:
                    type: string
                required:
                - name
                - namespace
                type: object
              tags:
                additionalProperties:
                  type: string
                type: object
              target:
                properties:
                  aws:
                    description: parameters for AWS
                    properties:
                      accountId:
                        description: 'TODO(shenjun): the name PeerCIDR and PeerRegion
                          doesn''t look good.'
                        type: string
                      peerCIDR:
                        type: string
                      peerRegion:
                        type: string
                      vpcId:
                        type: string
                    required:
                    - accountId
                    - peerRegion
                    - vpcId
                    type: object
                  gcp:
                    description: parameters for GCP
                    properties:
                      peerCIDR:
                        type: string
                      peerNetwork:
                        type: string
                      projectId:
                        description: 'TODO(shenjun): the name PeerNetwork and PeerCIDR
                          doesn''t look good.'
                        type: string
                    required:
                    - peerNetwork
                    - projectId
                    type: object
                  targetVPC:
                    properties:
                      name:
                        type: string
                    required:
                    - name
                    type: object
                type: object
            required:
            - provider
            - region
            - sourceVPCRef
            - target
            type: object
          status:
            properties:
              crossplaneResourceName:
                type: string
              externalName:
                description: the resource name in provider, same as corssplane external
                  name
                type: string
              hostedZoneId:
                type: string
              phase:
                description: the VPCPeering struct is borrowed from infra-api/api/networkpeer_types.go
                type: string
              reason:
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
