forked from cloudfoundry/loggregator-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lamb-properties.rb
113 lines (99 loc) · 2 KB
/
lamb-properties.rb
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
class LambProperties
def initialize(infrastructure)
@infrastructure = infrastructure
end
def loggregator_z1_properties
result = <<-EOF
metron_agent:
zone: z1
doppler:
zone: z1
EOF
result.chomp
end
def loggregator_z2_properties
result = <<-EOF
metron_agent:
zone: z2
doppler:
zone: z2
EOF
result.chomp
end
def loggregator_trafficcontroller_z1_properties
result = <<-EOF
metron_agent:
zone: z1
traffic_controller:
zone: z1
EOF
result.chomp
end
def loggregator_trafficcontroller_z2_properties
result = <<-EOF
metron_agent:
zone: z2
traffic_controller:
zone: z2
EOF
result.chomp
end
def loggregator_templates
result = <<-EOF
- name: doppler
release: cf
- name: syslog_drain_binder
release: cf
- name: metron_agent
release: cf
EOF
result.chomp
end
def loggregator_trafficcontroller_templates
result = <<-EOF
- name: loggregator_trafficcontroller
release: cf
- name: metron_agent
release: cf
EOF
result.chomp
end
def aws_lamb_properties(deployment_name)
result = <<-EOF
loggregator:
maxRetainedLogMessages: 100
debug: false
blacklisted_syslog_ranges:
- start: 10.10.0.0
end: 10.10.255.255
doppler:
maxRetainedLogMessages: 100
debug: false
blacklisted_syslog_ranges: null
unmarshaller_count: 5
metron_agent:
deployment: #{deployment_name}
EOF
result.chomp
end
def lamb_properties(deployment_name)
return aws_lamb_properties(deployment_name) if @infrastructure == 'aws'
result = <<-EOF
loggregator:
maxRetainedLogMessages: 100
debug: false
blacklisted_syslog_ranges: null
doppler:
maxRetainedLogMessages: 100
debug: false
blacklisted_syslog_ranges: null
unmarshaller_count: 5
metron_agent:
deployment: #{deployment_name}
EOF
result.chomp
end
def get_binding
binding
end
end