# Copyright 2022 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. apiVersion: cloudfunctions.cnrm.cloud.google.com/v1beta1 kind: CloudFunctionsFunction metadata: name: cloudfunctionsfunction-sample-pubsubtopic spec: projectRef: # Replace ${PROJECT_ID?} with your project ID external: "projects/${PROJECT_ID?}" description: "A sample cloud function with an event trigger from PubSubTopic and a VPCAccessConnector" region: "us-west2" runtime: "nodejs8" availableMemoryMb: 128 # Replace ${PROJECT_ID?} with your project ID serviceAccountEmail: "${PROJECT_ID?}@appspot.gserviceaccount.com" # Replace ${REPO_URL?} with your cloud source repository url # Example: https://source.developers.google.com/projects/config-connector-samples/repos/config-connnector-samples/moveable-aliases/main/paths/cloudfunctionsfunction sourceRepository: url: "${REPO_URL?}" timeout: "60s" entryPoint: "helloGET" ingressSettings: "ALLOW_INTERNAL_ONLY" environmentVariables: TEST_ENV_VARIABLE: "test-env-variable-value" maxInstances: 10 vpcConnectorRef: name: "function-dep-trigger" vpcConnectorEgressSettings: "PRIVATE_RANGES_ONLY" eventTrigger: eventType: "providers/cloud.pubsub/eventTypes/topic.publish" resourceRef: name: "cloudfunctionsfunction-dep-pubsubtopic" kind: "PubSubTopic" failurePolicy: true service: "pubsub.googleapis.com"