Simple PubSub job emulator that publishes data to PubSub topic. Reads raw data from json file, encrypts the data, and publishes to pubsub topic.
python3 -m venv venv
source venv/bin/activate # (macOS/Linux)
pip install -r requirements.txt
python simple-pubsub-job.py
Required flags
--cryptoKeyName string
Path to KMS Key as:
projects/<project_id>/locations/<location>/keyRings/<keyrings>/cryptoKeys/<key>
--wrappedKey string
Path to wrappedKey in Secret Manager as:
projects/<project_id>/secrets/<secret>/versions/<version>
--topic_id string
Path to PubSub topic id as:
<topic_id>
--project_id string
Project where the PubSub topic id exists:
<project_id>
--messages_file string
Path to JSON file with raw data:
<path>/<file>.json
- python 3.11