Tencent Cloud SSM SDK for Python
raw JSON → 3.1.70 verified Sat May 09 auth: no python
Official Tencent Cloud SDK for Secrets Manager (SSM). Provides programmatic access to create, retrieve, update, and delete secrets via TencentCloud API. Currently at version 3.1.70, released roughly weekly.
pip install tencentcloud-sdk-python-ssm Common errors
error ModuleNotFoundError: No module named 'tencentcloud.ssm' ↓
cause Incorrect import path or missing library installation.
fix
Install both packages: pip install tencentcloud-sdk-python-common tencentcloud-sdk-python-ssm. Then import as 'from tencentcloud.ssm.v20190923 import ssm_client'.
error tencentcloud.common.exception.TencentCloudSDKException: [TencentCloudSDKException] code: UnsupportedOperation, message: the region is not supported ↓
cause The region string passed to client constructor is invalid or not supported by SSM.
fix
Use a valid region: e.g., 'ap-guangzhou', 'ap-singapore', 'na-siliconvalley'.
Warnings
breaking In v3.x, all API calls use the versioned namespace (v20190923). Importing from unversioned path (e.g., tencentcloud.ssm) will raise ImportError. ↓
fix Use 'from tencentcloud.ssm.v20190923 import ssm_client, models'.
gotcha Python SDK does not support async/await natively. All methods are synchronous and block the calling thread. ↓
fix Use threading or multiprocessing for concurrent calls.
gotcha Region parameter is required when creating the client. Incorrect region (e.g., us-east-1 instead of ap-guangzhou) results in authentication or not-found errors. ↓
fix Verify region string matches TencentCloud documentation. Common values: ap-guangzhou, ap-singapore, na-siliconvalley.
Imports
- SsmClient wrong
from tencentcloud.ssm import SsmClientcorrectfrom tencentcloud.ssm.v20190923 import ssm_client - DescribeSecretStatusRequest
from tencentcloud.ssm.v20190923 import models
Quickstart
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.ssm.v20190923 import ssm_client, models
try:
cred = credential.Credential(
os.environ.get('TENCENTCLOUD_SECRET_ID', ''),
os.environ.get('TENCENTCLOUD_SECRET_KEY', '')
)
client = ssm_client.SsmClient(cred, 'ap-guangzhou')
req = models.DescribeSecretStatusRequest()
req.SecretName = 'MySecret'
resp = client.DescribeSecretStatus(req)
print(resp)
except TencentCloudSDKException as e:
print(e)