HUAWEI CLOUD KMS + CSMS → STACKIT · TUTORIAL

Huawei KMS and CSMS to STACKIT KMS and Secrets Manager

Keys and secrets are the part of an estate that does not simply copy across and must not be lost. A Huawei Cloud KMS key becomes a STACKIT KMS key without its key material, so the data it protects is re-encrypted. A CSMS secret becomes a secret in STACKIT Secrets Manager, whose values an operator writes and whose clients read through a Vault-style interface. This tutorial assesses two keys and two secrets and follows them through.

Two keys and a secret, assessed

A small Huawei Cloud estate written for this page and assessed by StackToIT on 4 November 2026. Left: a symmetric key, a signing key and a secret that names the first key. Right: the result recorded for the key and for the secret, excerpts of assessment.json with the values as the run wrote them.

Example inputmain.tf
resource "huaweicloud_kms_key" "data" {
  key_alias        = "payments-data"
  key_algorithm    = "AES_256"
  key_description  = "Encrypts payment exports"
  pending_days     = "30"
  rotation_enabled = true
}

resource "huaweicloud_kms_key" "signing" {
  key_alias     = "payments-signing"
  key_algorithm = "RSA_2048"
  key_usage     = "SIGN_VERIFY"
  pending_days  = "30"
}

resource "huaweicloud_csms_secret" "db" {
  name        = "payments-db"
  secret_text = jsonencode({ username = "app", password = var.db_password })
  kms_key_id  = huaweicloud_kms_key.data.id
}
StackToIT assessmentassessment.json
{
  "id": "huaweicloud_kms_key.data",
  "result": {
    "class": "RECONFIGURE",
    "confidence": "MEDIUM",
    "target": {
      "service": "STACKIT KMS"
    },
    "reason": "A KMS key becomes a STACKIT KMS key. Key material of the source does not move, so data encrypted with it is re-encrypted."
  }
}

{
  "id": "huaweicloud_csms_secret.db",
  "result": {
    "class": "RECONFIGURE",
    "confidence": "MEDIUM",
    "target": {
      "service": "STACKIT Secrets Manager"
    },
    "reason": "A CSMS secret becomes a secret in STACKIT Secrets Manager. Values are moved by an operator, and applications change how they read them."
  }
}
  • Key material stays behind

    The key is classified RECONFIGURE with MEDIUM confidence. The run states that the key material of the source does not move, so data encrypted with it is re-encrypted on the target.

  • Values are moved by a person

    The secret is also RECONFIGURE. Its value is written by an operator, and applications change how they read it. The assessment never asks for a secret value and never carries one.

  • Named, not decided

    For the first key the run lists key_algorithm, key_alias, key_description, pending_days and rotation_enabled as settings your architects carry across. For the secret it lists kms_key_id, name and secret_text.

The order the run proposes, and who owns it

Because the database secret names the data key, it waits for it. The other three units start together. The second pane shows a gap worth closing early.

Wavesmigration/technical-sequencing.md
## Wave 1 — 3 unit(s)

| Unit | Class | Target |
|---|---|---|
| `huaweicloud_csms_secret.api` | RECONFIGURE / MEDIUM | STACKIT Secrets Manager |
| `huaweicloud_kms_key.data` | RECONFIGURE / MEDIUM | STACKIT KMS |
| `huaweicloud_kms_key.signing` | RECONFIGURE / MEDIUM | STACKIT KMS |

## Wave 2 — 1 unit(s)

| Unit | Class | Target |
|---|---|---|
| `huaweicloud_csms_secret.db` | RECONFIGURE / MEDIUM | STACKIT Secrets Manager |
Ownerexecution/manual/actions.md
4 manual steps have no owner role: no role follows from the plan for it, so nobody is named to carry it out. Assign an owner to each; until then the migration is not ready (each shows "Owner assignment required" under Who below).

- the owner table has no role for the category "security" of the unit (4 manual steps): the manual migration of huaweicloud_csms_secret.api, the manual migration of huaweicloud_csms_secret.db, the manual migration of huaweicloud_kms_key.data, the manual migration of huaweicloud_kms_key.signing

## Manual steps
  • Wave 1 and wave 2

    Both keys and the standalone secret are in wave 1. The secret that references huaweicloud_kms_key.data is in wave 2. Waves are a starting point for your schedule, not a schedule.

  • Nobody is named for security

    The owner table of this build has no role for the category security, so all four manual steps read Owner assignment required. Name an accountable person for keys and secrets before the first step starts.

The migration in eight steps

  1. 1. Inventory what each key protects

    The Terraform shows the keys and the secrets that reference them. It does not show every service that encrypts with a key. List those consumers from the source account; each one is a re-encryption task.

  2. 2. Map every key to a STACKIT algorithm

    STACKIT’s KMS concepts page lists AES 256 GCM for symmetric encryption, RSA OAEP with 2048, 3072 and 4096 bits (and 4096 bits with SHA-512) for asymmetric encryption, HMAC SHA256, SHA384 and SHA512 for message authentication codes, and ECDSA on P-256, P-384 and P-521 for signatures. The demo’s signing key is RSA_2048 with SIGN_VERIFY: STACKIT lists no RSA signing algorithm, so it becomes an ECDSA key and every verifier changes with it. SM4 and SM2 keys have no entry at all; decide the replacement before you build anything.

  3. 3. Create the key ring and keys

    On STACKIT a key version is either created by the system or imported through a wrapping key. Generate new keys by default. Import only key material you created yourself outside Huawei Cloud: Huawei’s FAQ states that a CMK cannot be exported from its KMS, and the run likewise assumes the material does not move.

  4. 4. Re-encrypt the data

    Switch each consumer to the new key and re-encrypt what it holds. This is the long step, and it is why the old key must outlive the cutover.

  5. 5. Create the Secrets Manager instance and a user

    Clients authenticate with the userpass method against the regional endpoint. Plan one user per application, not one shared user.

  6. 6. Write the secrets in wave order

    Write each value yourself, from the source of truth and not from the Terraform. A JSON secret such as the database credentials maps naturally to the key-value pairs of a Secrets Manager secret.

  7. 7. Change how applications read

    Secrets Manager is compatible with Vault KV version 2. Applications swap the Huawei SDK call for a Vault client call and renew their token, which lives 15 minutes by default.

  8. 8. Retire the old keys last

    Huawei schedules key deletion after a waiting period of 7 to 1096 days. Set it once the last consumer is re-encrypted and verified, and treat a deleted key as unrecoverable.

How each setting travels

Huawei setting in the demoValueOn STACKIT
key_algorithmAES_256 and RSA_2048AES_256 corresponds to aes_256_gcm on STACKIT. RSA_2048 appears on the list only as an OAEP encryption key.
key_usageSIGN_VERIFY on the signing keySTACKIT KMS has a sign-verify purpose, but only with ECDSA (P-256, P-384, P-521). An RSA signing key needs a new ECDSA key and updated verifiers, or a decision to keep signing elsewhere.
rotation_enabledtrue on the data keyThe STACKIT how-to rotates a key by creating a new version (Rotate key in the Portal); neither it nor the concepts page describes an automatic schedule. Plan rotation as an operating task with an owner.
pending_days30A Huawei-side setting for the deletion wait, 7 to 1096 days. It does not exist on the new key; use it on the old key at the end.
secret_textJSON with user name and passwordA secret is a set of key-value pairs with versions. Write each field as a pair.
kms_key_idThe data keyNo per-secret key setting is named in the Secrets Manager FAQ. Treat it as not carried and confirm the encryption behaviour with STACKIT.
namepayments-db and payments-api-tokenA path under the Secrets Manager ID, which acts as the mount.

Rows follow the demo input. Huawei CSMS secrets without a chosen key use the default key csms/default.

Writing and reading a secret on STACKIT

The commands below are copied from STACKIT’s page on the Vault CLI, in the order it lists them. Replace the placeholders, and replace the example path app1/mysecret and the pair foo=bar with your own (for example payments/db with username and password); the Secrets Manager ID takes the place of the usual mount name.

Log interminal
export VAULT_ADDR=https://prod.sm.eu01.stackit.cloud
vault login -method=userpass username=<username> password="<password>"
Write and readterminal
vault kv put -mount=<secrets-manager-id> app1/mysecret foo=bar
vault kv get -mount=<secrets-manager-id> app1/mysecret
  • Versions cost money

    STACKIT charges per secret version, and a secret may have an unlimited number of them. Set a version limit on the instance or the secret.

  • Deleted means gone

    STACKIT states that it cannot restore individual secrets or secrets engines. Keep the source secret until the new one has served real traffic.

Where Huawei and STACKIT differ

  • Rotated secrets

    Huawei distinguishes shared secrets from rotated ones, and rotated ones cover services such as RDS, GaussDB and DCS Redis. The STACKIT Secrets Manager FAQ describes versioned storage and mentions no automatic rotation; if you rely on one today, plan to rebuild it.

  • Size and format

    A CSMS secret can be up to 64 KB. The STACKIT pages read for this tutorial state no size limit, so check yours before you move large values.

  • Key deletion is final

    Huawei’s provider accepts pending_days from 7 to 1,096 days. Treat the deletion as final and do not schedule it before re-encryption is verified.

  • Algorithms narrow

    Huawei’s provider accepts AES_256, SM4, RSA_2048, RSA_3072, RSA_4096, EC_P256, EC_P384 and SM2 keys. STACKIT’s set differs: RSA is for encryption only, EC is for ECDSA signatures, and SM4 and SM2 are absent, so some keys have a design decision rather than a mapping.

What to change before you apply anything

  • Assign owners

    Add an accountable person for the four security steps, as the manual-steps file demands.

  • Answer the region

    The run asks for target.region (eu01 or eu02) and counts it as the request that blocks the draft. Copy it from inputs-template.yaml into your inputs file and pass that with --inputs.

  • Keep secret values out of the repository

    The demo ships placeholders in a variable file only so the assessment can complete. Real values belong in your secret store, never in Terraform files.

  • Pin the provider

    The run warns that no lock file pins the huaweicloud provider. Commit .terraform.lock.hcl.

Questions security teams ask

Can we export a Huawei KMS key and import it into STACKIT?

No. Huawei’s DEW FAQ answers that a CMK cannot be exported from KMS, and the run states that the key material of the source does not move. STACKIT can import key material through a wrapping key, which suits material you generated yourself elsewhere. For a key generated inside Huawei KMS, plan to create a new key and re-encrypt.

Does StackToIT write the STACKIT KMS or Secrets Manager Terraform?

Not for a Huawei Cloud source in this build. The run names the target resources, a key ring and key, and a Secrets Manager instance and user, and records the four units as manual steps.

Will our applications need code changes?

Yes for secrets: they read through a Vault KV version 2 compatible interface instead of the Huawei call, and renew a token. For keys, the call that encrypts or decrypts changes to the STACKIT KMS API.

What does the assessment read from our secrets?

Only the Terraform structure. It never asks for a secret value, and it does not connect to your Huawei Cloud account.

Sources

Your next move: STACKIT.

Tell us about your estate. We show you what StackToIT delivers for it: target architecture, Terraform artifacts and a structured migration plan.