Skip to content

Commit 25034cb

Browse files
chodono-awsiakov-aws
authored andcommitted
minor change to Lambda code to import time module
Also fix field name of athena table and fix formating of lastconnection field
1 parent 04c4dfd commit 25034cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

data-collection/deploy/module-inventory.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ Mappings:
10551055
Type: string
10561056
- Name: runningmode
10571057
Type: string
1058-
- Name: operatingsystemname
1058+
- Name: operatingsystem
10591059
Type: string
10601060
- Name: protocol
10611061
Type: string
@@ -1144,6 +1144,7 @@ Resources:
11441144
import os
11451145
import json
11461146
import logging
1147+
import time
11471148
from functools import partial, lru_cache
11481149
from datetime import datetime, date, timezone
11491150
@@ -1305,7 +1306,7 @@ Resources:
13051306
'DirectoryId': dir_id,
13061307
'State': workspace['State'],
13071308
'ConnectionStatus': connection_info.get('ConnectionState', 'N/A'),
1308-
'LastConnected': connection_info.get('LastKnownUserConnectionTimestamp', 'Never').isoformat() if isinstance(connection_info.get('LastKnownUserConnectionTimestamp'), datetime) else "01/01/01 00:00:00",
1309+
'LastConnected': connection_info.get('LastKnownUserConnectionTimestamp', 'Never').strftime('%x %X') if isinstance(connection_info.get('LastKnownUserConnectionTimestamp'), datetime) else "01/01/01 00:00:00",
13091310
'LastInventoryRun': time.strftime('%x %X'),
13101311
'RunningMode': workspace.get("WorkspaceProperties", {}).get("RunningMode", "N/A"),
13111312
'ComputeType': workspace.get("WorkspaceProperties", {}).get("ComputeTypeName", "N/A"),
@@ -1954,7 +1955,7 @@ Resources:
19541955
, CAST(parse_datetime(lastconnected, 'MM/dd/yy HH:mm:ss') AS timestamp) lastconnected
19551956
, "lastinventoryrun"
19561957
, "runningmode"
1957-
, "operatingsystemname"
1958+
, "operatingsystem"
19581959
, "protocol"
19591960
, "computername"
19601961
, "ipaddress"

0 commit comments

Comments
 (0)