Huawei Cloud Personal Account Tencent Cloud Identity Management Setup
Why You’re Probably Doing CAM Wrong (And How to Fix It)
Let’s be honest: most people set up Tencent Cloud Identity Management (CAM) the way they assemble IKEA furniture—by skipping the manual, squinting at blurry diagrams, and hoping gravity holds it together. Spoiler: it doesn’t. You’ll eventually find yourself staring at a 403 Forbidden error at 2:17 a.m., whispering sweet nothings to your keyboard while your production database silently weeps in Shenzhen.
CAM isn’t just Tencent Cloud’s version of AWS IAM or Azure RBAC—it’s its own charmingly idiosyncratic beast. It speaks fluent Chinese backend logic but wears English labels like a borrowed suit. Policies are JSON, yes—but with Tencent-specific effect keywords (allow vs deny, not Allow/Deny). Roles need trusted entities defined *twice*. And don’t get us started on the console’s ‘Save & Continue’ button that sometimes saves… and sometimes ghosts you into a blank page.
This guide won’t recite the docs. It’ll show you how to actually *use* CAM without summoning the support team as your spirit animal.
The Three Pillars (and One Landmine)
CAM rests on three core constructs: Users, Groups, and Policies. Roles? That’s the landmine—you’ll step on it if you try to use them before grasping the first three.
Users: Not Just Email Addresses
A CAM user isn’t a person—it’s an identity with credentials. You can create sub-users (recommended) or use your root account (strongly discouraged, like using a flamethrower to light birthday candles). Sub-users get their own access keys, MFA options, and login profiles. Root accounts? They bypass all policies. They see everything. They delete everything. They also can’t be audited properly. If your root key leaks, Tencent Cloud doesn’t send a ‘whoopsie’ email—they send a condolence card and a bill for data recovery.
Huawei Cloud Personal Account Pro tip: Always enforce MFA on sub-users *before* assigning permissions. The console lets you skip this. Your future self will send thank-you notes.
Groups: Your Permission Delivery System
Groups aren’t organizational units—they’re policy carriers. Think of them as permission lunchboxes: you pack policies into a group, then assign users to that group. Need your DevOps team to manage CVMs and CLBs but *not* touch billing? Create a devops-prod group, attach two policies, and drop users in. No more copy-pasting JSON across 12 user accounts.
Warning: Groups inherit *all* attached policies—no stacking exceptions. If Policy A says ‘allow CVM restart’ and Policy B says ‘deny CVM delete’, the deny wins. But if both allow? You’re golden. If one allows and the other is silent? Still allowed. CAM follows standard deny-by-default + explicit-allow logic—just like your sensible ex.
Huawei Cloud Personal Account Policies: JSON That Doesn’t Hate You
Tencent’s policy syntax looks familiar—until it isn’t. Here’s a working example granting read-only access to COS buckets:
{
"version": "2.0",
"statement": [
{
"effect": "allow",
"action": [
"cos:GetBucket*",
"cos:GetObject*"
],
"resource": [
"qcs::cos::uid/:-/*"
]
}
]
}
Note: effect is lowercase. resource requires full QCS ARN format—including region, UID, bucket name, *and* AppID. Miss one piece? Permission denied. No hint. Just silence and existential doubt.
Use the Policy Generator—but verify every line. It loves auto-filling * wildcards where you meant Get*.
Roles: When Machines Need IDs (and Why You’ll Trip)
Roles let services (like SCF functions or TKE nodes) assume temporary credentials. Setup has two non-obvious steps:
- Define the trusted entity—e.g.,
tencentcloud.qcloud.comfor SCF—and confirm it matches *exactly* what the service expects (yes, case matters). - Attach a policy—but *also* grant the role itself permission to assume via a separate role trust policy. This second policy lives in the role’s ‘Trust Policy’ tab—not the permissions tab. Miss it? Your function fails with
AccessDenied: Not authorized to assume role, even though the permissions look perfect.
Real-world fix: Paste this minimal trust policy for SCF:
{
"version": "2.0",
"statement": [
{
"effect": "allow",
"principal": {
"service": [
"scf.qcloud.com"
]
},
"action": [
"sts:AssumeRole"
]
}
]
}
CLI & Automation: Because Clicking Is for Tourists
Tencent’s tencentcloud-cli works—but only after you configure it *correctly*. Skip the web-based key download. Instead:
- Create a sub-user with
QcloudCamFullAccess(temporarily). - Generate API keys *in the CAM console*, not the account center.
- Run
tencentcloud configureand paste region, secret ID, secret key—and crucially, setoutputtojson.
Now list users:
tencentcloud cam DescribeUsers --output json | jq '.Users[] | select(.Name | startswith("prod-"))'
No more scrolling through 87 users in the console. Just clean, grep-able truth.
Five Rules That Prevent Midnight Panic
- Rule 1: Never assign policies directly to users. Use groups—even for one person. Tomorrow’s ‘just me’ is next month’s ‘three interns and a contractor’.
- Rule 2: Name policies like you’ll explain them to your boss’s boss:
policy-cos-read-only-prod, notpolicy123. - Rule 3: Test permissions with
tencentcloud cam SimulateCustomPolicy*before* attaching. Yes, it exists. Yes, it’s under-documented. Yes, it saves hours. - Rule 4: Rotate access keys every 90 days. Set calendar reminders. Automate it with SCF + EventBridge if you’re fancy.
- Rule 5: Enable CAM event logging in CloudAudit *immediately*. Without it, ‘Who deleted the VPC?’ becomes ‘We’ll never know.’
When Things Go Sideways (and How to Dig Out)
You’ve revoked your own access. Congratulations. Here’s the triage:
- Don’t panic. Your root account still works—unless you disabled it (don’t do that).
- Log in as root. Go to CAM → Users → Your sub-user → ‘Reset Key’. Done.
- If root is MFA-locked and you lost the device? Contact Tencent Cloud Support *with your business verification documents*. They’ll help—but it takes time. Hence Rule 5 above.
Pro move: Keep *one* emergency sub-user with full CAM permissions, stored offline (yes, printed on paper, in a fireproof box). Call it ‘The Phoenix Account’. It’s dramatic. It’s necessary.
Final Thought: CAM Is a Tool, Not a Trophy
You don’t ‘master’ CAM. You learn its rhythms—where it bends, where it breaks, and where it quietly judges your policy naming. Set it up right once, audit quarterly, automate relentlessly, and treat permissions like oxygen: essential, invisible when working, catastrophic when missing. Now go forth—and may your sts:AssumeRole calls always succeed.

