访问控制(RAM)主界面
image.png

创建策略

image.png
image.png
配置模式 -> 脚本配置,然后输入以下内容:([$Group_ID] 更换为需要操作的安全组 ID)

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
{
"Statement": [
{
"Effect": "Allow",
"Action": "ecs:DescribeSecurityGroups",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ecs:ModifySecurityGroupRule",
"ecs:ModifySecurityGroupEgressRule",
"ecs:DescribeSecurityGroup*",
"ecs:AuthorizeSecurityGroup",
"ecs:RevokeSecurityGroup",
"ecs:RevokeSecurityGroupEgress"
],
"Resource": [
"acs:ecs:*:*:securitygroup/[$Group_ID]",
"acs:ecs:*:*:securitygroup/[$Group_ID]",
"acs:ecs:*:*:securitygroup/[$Group_ID]"
]
}
],
"Version": "1"
}

创建用户

添加权限

image.png
image.png