forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrate-prometheus-to-cloud.yml
147 lines (147 loc) · 4.23 KB
/
migrate-prometheus-to-cloud.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
144
145
146
147
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
CommonName:
Type: String
Default: prometheus
InstancePassword:
NoEcho: true
Type: String
Description:
en: >-
Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special
symbol in)
zh-cn: >-
服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
中的特殊符号)
Label:
en: Instance Password
zh-cn: 实例密码
ConstraintDescription:
en: >-
Length 8-30, must contain three(Capital letters, lowercase letters,
numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: '长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ 中的特殊符号)'
AssociationProperty: 'ALIYUN::ECS::Instance::Password'
InstanceType:
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
Type: String
Label:
zh-cn: 实例类型
en: Instance Type
ZoneId:
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
Type: String
Description:
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
en: Availability Zone ID,<br><b>note: <font color='blue'>Before selecting, please confirm that the Availability Zone supports the specification of creating ECS resources</font></b>
Label:
zh-cn: 可用区ID
en: Available Zone ID
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- ZoneId
- InstanceType
- InstancePassword
Label:
default: ECS
TemplateTags:
- acs:technical-solution:cloud-migration:自建Prometheus迁移云上Prometheus托管服务-tech_solu_149
Hidden:
- CommonName
Outputs: {}
Resources:
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
SecurityGroupIngress:
- Priority: 100
PortRange: 22/22
NicType: internet
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- Priority: 100
PortRange: 9100/9100
NicType: internet
SourceCidrIp: 100.64.0.0/10
IpProtocol: tcp
- Priority: 100
PortRange: 9256/9256
NicType: internet
SourceCidrIp: 192.168.0.0/18
IpProtocol: tcp
VpcId:
Ref: EcsVpc
SecurityGroupName:
Fn::Sub: ${CommonName}-sg
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
VpcId:
Ref: EcsVpc
CidrBlock: 192.168.1.0/24
ZoneId:
Ref: ZoneId
VSwitchName:
Fn::Sub: ${CommonName}-vsw
EcsInstance:
Type: ALIYUN::ECS::InstanceGroup
Properties:
InstanceName:
Fn::Sub: ${CommonName}-ecs
MaxAmount: 1
SystemDiskCategory: cloud_essd
VpcId:
Fn::GetAtt:
- EcsVpc
- VpcId
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId: aliyun_3_9_x64_20G_alibase_
VSwitchId:
Ref: EcsVSwitch
Password:
Ref: InstancePassword
InstanceType:
Ref: InstanceType
InternetMaxBandwidthOut: 5
ZoneId:
Ref: ZoneId
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Fn::Sub: ${CommonName}-vpc
CidrBlock: 192.168.0.0/16
AutoEnableARMSService:
Type: ALIYUN::ROS::AutoEnableService
Properties:
ServiceName: ARMS
Environment:
Type: ALIYUN::ARMS::Environment
DependsOn:
- EcsInstance
- AutoEnableARMSService
Properties:
ManagedType: agent-exporter
EnvironmentName:
Fn::Sub: ${CommonName}-environment
EnvironmentSubType: ECS
EnvironmentType: ECS
BindResourceId:
Ref: EcsVpc
EnvironmentFeature:
Type: ALIYUN::ARMS::EnvironmentFeature
Properties:
FeatureVersion: '*'
EnvironmentId:
Fn::GetAtt:
- Environment
- EnvironmentId
FeatureName: metric-agent