gpt4 book ai didi

google-cloud-platform - 谷歌CP : How to completely delete a custom role

转载 作者:行者123 更新时间:2023-12-02 02:37:13 27 4
gpt4 key购买 nike

我一直在使用 GCP IAM,在编写按需创建和删除自定义角色的脚本期间,我(意外)创建了 300 个角色,这是 GCP 中允许的角色最大配额,现在我无法创建新角色.

我尝试删除它们,但它只是将它们的状态更改为已删除,并没有真正删除角色。

有没有办法完全删除我创建的角色,以便我能够释放配额?

我正在寻找的最佳解决方案是在 python 中使用 GCP API,因为我仍然需要创建一个脚本来按需创建和删除自定义角色。

最佳答案

如果您要删除的自定义角色的状态已为“已删除”,则其消耗的配额将在7天后释放。它仍然显示的原因是因为有一个取消删除的选项。以下是 GCP 官方文档中显示的内容:

When a role is deleted, its bindings remain, but are inactive. You can undelete a role within 7 days. During this 7-day period, the role will show as Deleted in the Cloud Console, and will not appear in programmatic list commands (unless showDeleted is set in the request).

After 7 days, the role is scheduled for permanent deletion. At this point, the role no longer counts towards the limit of 300 custom roles per organization or 300 custom roles per project.

您可以查看这个link有关该主题及其所需代码的更好解释。

关于google-cloud-platform - 谷歌CP : How to completely delete a custom role,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64133990/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com