Skip to content

Load environment variables from Huawei Cloud Secret Management Service (CSMS)

License

Notifications You must be signed in to change notification settings

C0D1UM/huaweicloud-csms-environ

Repository files navigation

huaweicloud-csms-environ

GitHub GitHub Workflow Status codecov PyPI
PyPI - Python Version

Installation

pip install huaweicloud-csms-environ

Sample Usage

import csms

# basic
csms.load_env('secret-name', region='ap-southeast-2')

# project id instead of region
csms.load_env('secret-name', project_id='project-id')

# using pure environment variables
csms.load_env()

# no environment variables
csms.load_env(
   'secret_name',
   access_key='access-key',
   secret_key='secret-key',
   region='ap-southeast-2',
)

Environment Variables

Key SDK Description
HUAWEICLOUD_SDK_AK Yes Access key of Huawei Cloud IAM
HUAWEICLOUD_SDK_SK Yes Secret key of Huawei Cloud IAM
HUAWEICLOUD_SDK_PROJECT_ID Yes Huawei Cloud project ID
HUAWEICLOUD_REGION No Huawei Cloud region
HUAWEICLOUD_SECRET_NAME No CSMS secret name

For more SDK variables, please see this.

Development

Requirements

  • Docker
  • Python
  • Poetry

Linting

make lint

Testing

make test

Fix Formatting

make yapf