1

I'd like to be able to regularly audit my gcp estate by verifying that no unapproved ALPHA/BETA features are enabled.

I can't seem to find a gcloud command that could identify this.

I recognise that this command;

gcloud services list

would list the enabled APIs of a project however is there any way of filtering on the stage of the API i.e. alpha,beta,GA?

I would then run a script to scan all my projects but of course i first need to identify the right command!

Any ideas?

0

I wrote this bash script in order to check all your services within your projects and know the activated APIs on BETA or ALPHA stage.

#!/bin/bash

for i in $(gcloud projects list --format="get(projectId)"); do
    echo "Project ID: $i"
    gcloud config set project $i > /dev/null 2>&1
    SERVICES="$(gcloud services list | grep -E 'beta-*|alpha-*')"
    if test -z "$SERVICES" 
     then
      echo "No BETA/APLHA services"
     else
      echo "$SERVICES"
    fi
    echo ""
done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.