diff --git a/content/docs/2.5/scalers/gcp-pub-sub.md b/content/docs/2.5/scalers/gcp-pub-sub.md index 55d6e330be2..60b39f7ccc2 100644 --- a/content/docs/2.5/scalers/gcp-pub-sub.md +++ b/content/docs/2.5/scalers/gcp-pub-sub.md @@ -82,3 +82,33 @@ spec: metadata: subscriptionName: "input" # Required ``` + +**Identity based authentication:** + +You can also use `TriggerAuthentication` CRD to configure the authentication using the associated service account of the running machine in Google Cloud. You only need to create a `TriggerAuthentication` as this example, and reference it in the `ScaledObject`. `ClusterTriggerAuthentication` can also be used if you pretend to use it globally in your cluster. + +### Example using TriggerAuthentication with GCP Identity + +```yaml +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: keda-trigger-auth-gcp-credentials +spec: + podIdentity: + provider: gcp +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: pubsub-scaledobject +spec: + scaleTargetRef: + name: keda-pubsub-go + triggers: + - type: gcp-pubsub + authenticationRef: + name: keda-trigger-auth-gcp-credentials + metadata: + subscriptionName: "input" # Required +``` \ No newline at end of file