forked from udacity/cdond-c3-projectstarter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prometheus.yml
54 lines (41 loc) · 1.48 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
AWSTemplateFormatVersion: 2010-09-09
Description: Create EC2Instance
Parameters:
EnvironmentName:
Description: An environment name that will be prefixed to resource names
Type: String
Resources:
EC2Instance:
Type: 'AWS::EC2::Instance'
Properties:
SecurityGroups:
- !Ref InstanceSecurityGroup
KeyName: udacity
ImageId: 'ami-09d56f8956ab235b3' # you may need to find out what instance types are available in your region - use https://cloud-images.ubuntu.com/locator/ec2/
InstanceType: t2.micro
Tags:
- Key: "Name"
Value: "Prometheus instance"
# The below code is the run in terminal to pass the instance PublicIPAddress to the the inventory file for ansible to retrieve later
# """aws ec2 describe-instances --query 'Reservations[*].Instances[*].PublicIpAddress' --filters "Name=tag:Name,Values=ansible-instance" --output text >> inventory"""
InstanceSecurityGroup:
Type: 'AWS::EC2::SecurityGroup'
Properties:
GroupDescription: Enable SSH access via port 22
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