-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdmt_log_router.py
30 lines (27 loc) · 1.1 KB
/
dmt_log_router.py
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
from dm_helper import GaFlattenerDeploymentConfiguration
def generate_config(ctx):
config = GaFlattenerDeploymentConfiguration(ctx.env)
resources = {
'resources': [{
'name': 'sink-name',
'type': 'gcp-types/logging-v2:projects.sinks',
'properties': {
'sink': config.get_sink_name(),
'destination': f"pubsub.googleapis.com/projects/{config.get_project()}/topics/{config.get_topic_id()}",
'filter': config.get_filter(),
'outputVersionFormat': 'V2'
}
}#,
# {
# 'name': 'sink-name-intraday',
# 'type': 'gcp-types/logging-v2:projects.sinks',
# 'properties': {
# 'sink': f"{config.get_sink_name(intraday=True)}",
# 'destination': f"pubsub.googleapis.com/projects/{config.get_project()}/topics/{config.get_topic_id(intraday=True)}",
# 'filter': config.get_filter(intraday=True),
# 'outputVersionFormat': 'V2'
# }
# }
]
}
return resources