Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fmachado091/e4e5fced2c9f4406e8929e626a6a91ab to your computer and use it in GitHub Desktop.
Save fmachado091/e4e5fced2c9f4406e8929e626a6a91ab to your computer and use it in GitHub Desktop.
How to create and setup a GCP project with Cloud Pub/Sub topics and subscriptions.
# login with your google credentials
# you will be asked to either use an existing project or create a new one
# for this article, I created the project hello-spring-cloud-gcp
$ gcloud init
# enable the Pub/Sub API
$ gcloud services enable pubsub.googleapis.com
# create a new Pub/Sub topic
$ gcloud pubsub topics create hello-pubsub
# create a subscription for the topic
$ gcloud pubsub subscriptions create --topic hello-pubsub hello-pubsub-subscription
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment