-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprometheus.yml
64 lines (60 loc) · 1.57 KB
/
prometheus.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
Description: >
Prometheus Server.
Resources:
InstanceSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: Prometheus-SG
GroupDescription: Allow ports 22, 9090, 9093, and 9100.
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 9090
ToPort: 9090
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 9093
ToPort: 9093
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 9100
ToPort: 9100
CidrIp: 0.0.0.0/0
EC2ReadOnlyRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: ec2.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess
RoleName: Prometheus-Role
ProfileWithRolesForOurApp:
Type: AWS::IAM::InstanceProfile
Properties:
Path: /
Roles:
- !Ref EC2ReadOnlyRole
EC2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
SecurityGroups:
- Ref: InstanceSecurityGroup
KeyName: prometheus
ImageId: ami-0cb4e786f15603b0d
IamInstanceProfile: !Ref ProfileWithRolesForOurApp
Tags:
- Key: Name
Value: Prometheus Server
- Key: Project
Value: Udapeople
- Key: Monitoring
Value: Prometheus