1.69KiB; Python | 2019-04-22 06:00:20+02 | SLOC 44
1
from core.terraform.resources.aws.load_balancer import ALBTargetGroupResource
2 1
from resources.vpc.security_group import InfraSecurityGroupResource
unused-import Unused InfraSecurityGroupResource imported from resources.vpc.security_group (kritika/Pylint) Filter like this
3 1
from core.config import Settings
4
5
6
PATH_PREFIX = '/api/'
7
HEALTH_CHECK_MATCHING_LIST = "200,302,401"
8
HEALTH_CHECK_TIMEOUT = 60
9
HEALTH_CHECK_INTERVAL = 300
10
11
12
class BaseTG:
13
    # port = 80 if Settings.get('ALB_PROTOCOL', "HTTP") != "HTTPS" else 443
14
    # protocol = Settings.get('ALB_PROTOCOL', "HTTP")
15
    port = 80
16
    protocol = "HTTP"
17
18
    target_type = "ip"
19
    create_before_destroy = True
20
    vpc_id = Settings.get('VPC')['ID']
21
    interval = HEALTH_CHECK_INTERVAL
22
    timeout = HEALTH_CHECK_TIMEOUT
23
    matcher = HEALTH_CHECK_MATCHING_LIST
24
25
26
class ConfigALBTargetGroup(ALBTargetGroupResource, BaseTG):
27
    name = "config"
28
    path = PATH_PREFIX + "config"
29
30
31
class AdminALBTargetGroup(ALBTargetGroupResource, BaseTG):
32
    name = "admin"
33
    path = PATH_PREFIX + "admin/api.html"
34
35
36
class ComplianceALBTargetGroup(ALBTargetGroupResource, BaseTG):
37
    name = "compliance"
38
    path = PATH_PREFIX + "compliance/api.html"
39
40
41
class NotificationsALBTargetGroup(ALBTargetGroupResource, BaseTG):
42
    name = "notifications"
43
    path = PATH_PREFIX + "notifications/api.html"
44
45
46
class StatisticsALBTargetGroup(ALBTargetGroupResource, BaseTG):
47
    name = "statistics"
48
    path = PATH_PREFIX + "statistics/api.html"
49
50
51
class AssetALBTargetGroup(ALBTargetGroupResource, BaseTG):
52
    name = "asset"
53
    path = PATH_PREFIX + "asset/api.html"
54
55
56
class AuthALBTargetGroup(ALBTargetGroupResource, BaseTG):
57
    name = "auth"
58
    path = PATH_PREFIX + "auth/api.html"
59
60
61
class NginxALBTargetGroup(ALBTargetGroupResource, BaseTG):
62
    name = "ngnix"
63
    path = "/nginx"
64
    interval = 120
65
    matcher = "200"