google-cloud-parametermanager is the Python client library for the Google Cloud Parametermanager API. This service, an extension to Secret Manager, provides a centralized and secure store for application configuration parameters such as environment variables, feature flags, and API keys. It offers features like data encryption, versioning, support for structured formats (YAML, JSON), and fine-grained Identity and Access Management (IAM) controls. The current version is 0.4.0, and as part of the `google-cloud-python` monorepo, its sub-libraries receive frequent updates.
pip install google-cloud-parametermanagerVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the Parameter Manager client and lists all parameters configured within a specified Google Cloud project and the 'global' location. It demonstrates basic client instantiation and interaction, highlighting the importance of setting the project ID and having appropriate IAM permissions. Ensure Application Default Credentials (ADC) are configured for authentication.
Always pin the exact version (`pip install google-cloud-parametermanager==X.Y.Z`) in production. Regularly review release notes and test against new versions before deploying.
Ensure the principal has the necessary roles (e.g., `roles/parametermanager.viewer` for reading, `roles/parametermanager.editor` for creating/updating, `roles/parametermanager.admin` for full control) on the project or specific parameter resources. For referencing Secret Manager secrets, the Parameter Manager service identity must also have `Secret Manager Secret Accessor` permission on the referenced secrets.
For local development, use `gcloud auth application-default login` or set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of a service account key file. For deployed applications, leverage managed identities like service accounts on Compute Engine, Cloud Run, GKE, etc., with appropriate IAM roles.