Help Center/ Object Storage Service/ SDK Reference/ Node.js/ Getting Started (SDK for Node.js)/ Setting Up an OBS Environment (SDK for Node.js)
Updated on 2024-11-13 GMT+08:00

Setting Up an OBS Environment (SDK for Node.js)

If you have any questions during development, post them on the Issues page of GitHub.

  1. Sign up for a cloud service account.

    Create an account to use OBS. If you already have one, use it instead.

    1. Open a browser.
    2. Visit the Huawei Cloud official website.
    3. In the upper right corner of the page, click Register.
    4. Enter the registration information and click Register.

  2. Enable OBS.

    Top up your account before you can use OBS.

    1. Log in to the management console.
    2. Click Billing & Costs from the top menu bar. The Billing Center page is displayed.
    3. Choose Funds Management > Top Up. The Top Up page is displayed.
    4. Top up your account.
    5. After the top-up is complete, close the dialog box and go back to the homepage.
    6. Choose Service List > Object Storage Service to access OBS Console.

  3. Create access keys.

    OBS employs access keys (AK and SK) for signature verification to ensure that only authorized accounts can access specified OBS resources. Detailed explanations of access keys are as follows:

    • AK is short for Access Key ID. One AK maps to only one user but one user can have multiple AKs. OBS authenticates users by their AKs.
    • SK is short for Secret Access Key, which is used to access OBS. You can generate authentication information based on SKs and request headers. An SK maps to an AK, and they group into a pair.

    Access keys are permanent. There are also temporary security credentials (consisting of an AK/SK pair and a security token). Each user can create a maximum of two valid AK/SK pairs. Temporary security credentials can only be used to access OBS within the specified validity period. Once they expire, they must be requested again. For security purposes, you are advised to use temporary security credentials to access OBS. If you want to use permanent access keys, periodically update them.

    • To get permanent access keys, do as follows:
      1. Log in to the management console.
      2. In the upper right corner, hover your cursor over the username and choose My Credentials.
      3. On the My Credentials page, click Access Keys in the navigation pane.
      4. On the Access Keys page, click Create Access Key.

        Each user can create a maximum of two valid AK/SK pairs.

      5. In the Create Access Key dialog box, enter a description (recommended), and click OK.

      6. (Optional) In the displayed Identity Verification dialog box, select a verification method, enter the verification code, and click OK.

      7. In the displayed dialog box, click Download to save the access keys to your browser's default download path.

      8. Open the downloaded file credentials.csv to obtain the AK and SK.
      • In the credentials.csv file, the AK is the value in the Access Key ID column, and the SK is the one in the Secret Access Key column.
      • Keep the access keys properly to prevent information leakage. If you click Cancel in the download dialog box, the access keys will not be downloaded and cannot be downloaded later. You can create new access keys if required.
    • To get temporary security credentials, refer to the following:

      Temporary security credentials are issued by the system and are only valid for 15 minutes to 24 hours. They follow the principle of least privilege. When using temporary security credentials, you must use an AK/SK pair and a security token together.

      To obtain them, see Obtaining a Temporary AK/SK and a Security Token.

      OBS is a global service. When obtaining temporary access keys, set the token scope to domain to apply the token to global services. Global services are not differentiated by any project or region.