本页面上的部分或全部信息可能不适用于 Trusted Cloud by S3NS。
资源的内置身份
本页介绍了资源的内置身份,您可以通过这些身份在 IAM 允许政策中向资源授予角色。
内置身份
某些资源具有内置身份。这些身份让资源能够充当主账号。因此,具有内置身份的资源可以执行以下操作:
例如,考虑具有内置标识符的 Parameter Manager 参数。参数有时需要访问 Secret Manager 才能正常运行。如要让参数访问 Secret Manager,您可以使用其标识符向其授予 Secret Manager Secret Accessor 角色 (roles/secretmanager.secretAccessor
)。然后,该参数可以代表您访问 Secret Manager 密文。
如需查看具有内置身份的资源列表,请参阅具有内置身份的资源。
您无法使用资源的内置身份来验证客户管理的工作负载(例如在 Compute Engine 实例上运行的工作负载)的身份。如果您需要验证工作负载的身份,请使用 Google 的身份验证方法中所述的方法之一。
向具有内置身份的资源授予角色
如果资源具有内置身份,您可以通过在允许政策中添加资源的主账号标识符来向该资源授予角色。如需了解每个资源的主账号标识符所使用的格式,请参阅单个资源的主账号标识符。
IAM 还为内置身份共有特定特征(例如类型或祖先)的资源集提供标识符。您可以在允许政策中使用这些标识符,以便向多个资源授予相同的角色。如需了解支持的格式,请参阅资源集的主账号标识符。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-08。"],[[["Built-in identities allow resources to act as principals, enabling them to be granted IAM roles."],["Resources with built-in identities can access other resources without the need for service agents."],["You can grant roles to resources with built-in identities by using the resource's principal identifier in your allow policies."],["IAM provides principal identifiers for both single resources and sets of resources with built-in identities, allowing for flexible role granting."],["You can't use built-in identities for authenticating customer-managed workloads."]]],[]]