The `ibm-secrets-manager-sdk` is the official Python SDK for interacting with IBM Cloud Secrets Manager. It provides programmatic access to store, manage, and retrieve secrets like API keys, passwords, and certificates. Currently at version 2.1.19, the library maintains a frequent release cadence, often incorporating bug fixes, new secret types, and support for service features, as well as dependency updates.
pip install ibm-secrets-manager-sdkVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `SecretsManagerV2` client using an IAM API key and then list the secrets available in your IBM Cloud Secrets Manager instance. Ensure `IBM_CLOUD_API_KEY` and `IBM_SECRETS_MANAGER_URL` environment variables are set with your credentials and service endpoint.
Upgrade your Python environment to 3.9 or later.
Always configure the `service_url` with the correct region endpoint for your Secrets Manager instance. Refer to IBM Cloud documentation for regional endpoints.
Ensure you are using `v2.1.13` or newer if your application relies on the `retrieved_at` field. Handle potential `AttributeError` gracefully if supporting `v2.1.12`.
Consult the official migration guide for `ibm-cloud-sdk-core` and the `ibm-secrets-manager-sdk` documentation for `v2.x` to adapt your code. Key changes include updated import paths and method parameters.
Run `pip install ibm-secrets-manager-sdk` to install the library.
Verify your `IBM_CLOUD_API_KEY` is correct, active, and has the necessary IAM roles (e.g., Viewer, Manager) for the Secrets Manager instance. Ensure the service URL matches your instance's region.
Ensure you call `secrets_manager_service.set_service_url(YOUR_SECRETS_MANAGER_URL)` with a valid and non-empty service endpoint for your Secrets Manager instance (e.g., from an environment variable).
Upgrade to `ibm-secrets-manager-sdk==2.1.13` or a newer version where the `retrieved_at` field has been re-introduced. Alternatively, add checks to your code to gracefully handle its absence.