1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
| # 创建运维权限策略 resource "alicloud_ram_policy" "system_admin_policy" { name = "CustomSystemAdminAccess" document = <<EOF { "Statement": [ { "Effect": "Allow", "NotAction": [ "ram:*", "ims:*", "resourcemanager:*", "bss:*", "bssapi:*", "efc:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ram:GetRole", "ram:ListRoles", "ram:CreateServiceLinkedRole", "ram:DeleteServiceLinkedRole", "bss:DescribeOrderList", "bss:DescribeOrderDetail", "bss:PayOrder", "bss:CancelOrder" ], "Resource": "*" } ], "Version": "1" } EOF description = "ops policy" force = true }
# 为超级管理员组授权 resource "alicloud_ram_group_policy_attachment" "cloud_admin_group_policy_attachment" { policy_name = "AdministratorAccess" policy_type = "System" group_name = alicloud_ram_group.cloud_admin_group.name }
# 为财务组授权AliyunBSSFullAccess resource "alicloud_ram_group_policy_attachment" "bss_group_policy_attachment_AliyunBSSFullAccess" { policy_name = "AliyunBSSFullAccess" policy_type = "System" group_name = alicloud_ram_group.billing_admin_group.name }
# 为财务组授权AliyunFinanceConsoleFullAccess resource "alicloud_ram_group_policy_attachment" "cloud_admin_group_policy_attachment_AliyunFinanceConsoleFullAccess" { policy_name = "AliyunFinanceConsoleFullAccess" policy_type = "System" group_name = alicloud_ram_group.billing_admin_group.name }
# 为运维用户组授权 resource "alicloud_ram_group_policy_attachment" "system_admin_group_policy_attachment" { policy_name = alicloud_ram_policy.system_admin_policy.name policy_type = alicloud_ram_policy.system_admin_policy.type group_name = alicloud_ram_group.system_admin_group.name }
# 为开发用户组授权 resource "alicloud_ram_group_policy_attachment" "dev_group_policy_attachment" { policy_name = "AliyunECSFullAccess" policy_type = "System" group_name = alicloud_ram_group.dev_group.name }
# 为DBA用户组授权 resource "alicloud_ram_group_policy_attachment" "dba_group_policy_attachment" { policy_name = "AliyunRDSFullAccess" policy_type = "System" group_name = alicloud_ram_group.dba_group.name }
|