gcloud beta emulators pubsub env-init Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta emulators pubsub env-init - print the commands required to export pubsub emulator's env variables
- SYNOPSIS
gcloud beta emulators pubsub env-init[--data-dir=DATA_DIR][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)After starting the emulator, you need to set environmentvariables so that your application connects to the emulator instead of theproduction environment. Environment variables need to be set each time you startthe emulator. The environment variables depend on dynamically assigned portnumbers that could change when you restart the emulator.- EXAMPLES
- To print the env variables exports for a pubsub emulator, run:
gcloudbetaemulatorspubsubenv-init--data-dir=DATA-DIRFor a detailed walkthrough of setting Pub/Sub emulator environment variables,seehttps://cloud.google.com/pubsub/docs/emulator#env.
- FLAGS
--data-dir=DATA_DIR- The directory to be used to store/retrieve data/config for an emulator run. Thedefault value is
<USER_CONFIG_DIR>/emulators/pubsub. Thevalue of USER_CONFIG_DIR can be found by running:gcloudinfo--format='get(config.paths.global_config_dir)'
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in beta and might change without notice. This variantis also available:
gcloudalphaemulatorspubsubenv-init
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.