forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
global-view-and-search-of-cross-account-resources.yml
143 lines (143 loc) · 3.81 KB
/
global-view-and-search-of-cross-account-resources.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
ZoneId:
Type: String
Label:
en: VSwitch Available Zone
zh-cn: 可用区
AssociationProperty: ALIYUN::VPC::Zone::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
FolderName:
Type: String
Label:
zh-cn: 资源目录名称
en: Resource directory folder name
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 5
Prefix: ros-folder-
CharacterClasses:
- Class: lowercase
AccountDisplayName:
Type: String
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 5
Prefix: account-for-search-
CharacterClasses:
- Class: lowercase
Resources:
RDFolder:
Type: ALIYUN::ResourceManager::Folder
Properties:
FolderName:
Ref: FolderName
RDAccount1:
Type: ALIYUN::ResourceManager::Account
Properties:
DeleteAccount: true
DisplayName:
'Fn::Sub': '${AccountDisplayName}-1'
FolderId:
Fn::GetAtt:
- RDFolder
- FolderId
RDAccount2:
Type: ALIYUN::ResourceManager::Account
Properties:
DeleteAccount: true
DisplayName:
'Fn::Sub': '${AccountDisplayName}-2'
FolderId:
Fn::GetAtt:
- RDFolder
- FolderId
AutoEnableTrustedRos:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: 'TrustedService/ROS'
StackGroup:
Type: ALIYUN::ROS::StackGroup
DependsOn: AutoEnableTrustedRos
Properties:
StackGroupName: ros-test-stack-group
PermissionModel: SERVICE_MANAGED
AutoDeployment:
Enabled: false
Parameters:
ZoneId:
Ref: ZoneId
TemplateBody:
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
CommonName:
Type: String
Default: for-search
ZoneId:
Type: String
Resources:
EcsVpc:
Type: 'ALIYUN::ECS::VPC'
Properties:
VpcName:
'Fn::Sub': 'vpc-${CommonName}-${ALIYUN::TenantId}'
CidrBlock: 192.168.0.0/16
EcsVSwitch:
Type: 'ALIYUN::ECS::VSwitch'
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: EcsVpc
VSwitchName:
'Fn::Sub': 'vsw-${CommonName}-${ALIYUN::TenantId}'
CidrBlock: 192.168.0.0/24
EcsSecurityGroup:
Type: 'ALIYUN::ECS::SecurityGroup'
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupName:
'Fn::Sub': 'sg-${CommonName}-${ALIYUN::TenantId}'
SecurityGroupIngress:
- PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
- PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
StackGroupInstances:
Type: ALIYUN::ROS::StackInstances
DependsOn:
- RDAccount1
- RDAccount2
Properties:
StackGroupName:
Ref: StackGroup
RegionIds:
- Ref: ALIYUN::Region
DeploymentTargets:
RdFolderIds:
- Ref: RDFolder
ParameterOverrides:
ZoneId:
Ref: ZoneId
RetainStacks: false
OperationPreferences:
MaxConcurrentCount: 2
Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- FolderName
- AccountDisplayName
- ZoneId
TemplateTags:
- 'acs:technical-solution:ops-on-cloud:跨账号资源全局视图及搜索-tech_solu_70'
Hidden:
- CommonName