forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
stack-group-aliyun-ros-stack-group-execution-role.yml
69 lines (69 loc) · 1.94 KB
/
stack-group-aliyun-ros-stack-group-execution-role.yml
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
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Configure the AliyunROSStackGroupExecutionRole to enable use of your account
as a target account in Alibaba Cloud ROS StackGroup.
zh-cn: 配置AliyunROSStackGroupExecutionRole以启用您的帐户作为阿里云ROS资源栈组中的目标帐户。
Conditions:
CurrentAccount:
Fn::Equals:
- Ref: AdministrationAccountId
- ''
Parameters:
ExecutionRoleName:
Type: String
Description:
en: Execution role name of target account
zh-cn: 为目标账号创建执行角色的名称
Default: AliyunROSStackGroupExecutionRole
AdministrationAccountId:
Type: String
Description:
zh-cn: 管理员主账号ID,不填则授权给当前账号
en: Administration account ID. If not, authorize the current account
Default: ''
Resources:
AliyunROSStackGroupExecutionRole:
Type: ALIYUN::RAM::Role
Properties:
RoleName:
Ref: ExecutionRoleName
AssumeRolePolicyDocument:
Version: 1
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
RAM:
- Fn::Join:
- ''
- - 'acs:ram::'
- Fn::If:
- CurrentAccount
- Ref: ALIYUN::TenantId
- Ref: AdministrationAccountId
- :root
AttachPolicy:
Type: ALIYUN::RAM::AttachPolicyToRole
Properties:
PolicyName: AdministratorAccess
PolicyType: System
RoleName:
Fn::GetAtt:
- AliyunROSStackGroupExecutionRole
- RoleName
Outputs:
ExecutionRoleName:
Value:
Fn::GetAtt:
- AliyunROSStackGroupExecutionRole
- RoleName
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- ExecutionRoleName
- AdministrationAccountId
Label:
default: RAM
TemplateTags:
- acs:example:安全:创建StackGroup目标账号权限