-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1302: Refactor EC2 LaunchTemplate to use data model #1312
Conversation
|
||
# Reformat some fields | ||
current['Id'] = f"{version['LaunchTemplateId']}-{version['VersionNumber']}" | ||
current['CreateTime'] = str(int(version['CreateTime'].timestamp())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above comment about the expected value of CreateTime
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always available.
Side note: neo4j datetime support has improved a lot since this module was first written so we don't even need this str(int())
thing anymore, but for the sake of not breaking any interfaces and keeping the existing behavior I will defer that change to a future PR.
result: list[dict[str, Any]] = [] | ||
for template in templates: | ||
current = template.copy() | ||
current['CreateTime'] = str(int(current['CreateTime'].timestamp())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to consider CreateTime
a always present ISO 8601 format date or is it safer to use a .get
and return a null value in case it's missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left a nit comment, no rush to apply it.
…artography-cncf#1312) Fixes cartography-cncf#1302: refactors EC2 launch template sync to use data model. This way, writes to the graph are automatically batched and write failures are retried.
…cartography-cncf#1314) Forgot to remove some manual index creations in cartography-cncf#1312.
…artography-cncf#1312) Fixes cartography-cncf#1302: refactors EC2 launch template sync to use data model. This way, writes to the graph are automatically batched and write failures are retried.
…cartography-cncf#1314) Forgot to remove some manual index creations in cartography-cncf#1312.
…artography-cncf#1312) Fixes cartography-cncf#1302: refactors EC2 launch template sync to use data model. This way, writes to the graph are automatically batched and write failures are retried. Signed-off-by: chandanchowdhury <[email protected]>
…cartography-cncf#1314) Forgot to remove some manual index creations in cartography-cncf#1312. Signed-off-by: chandanchowdhury <[email protected]>
Fixes #1302: refactors EC2 launch template sync to use data model. This way, writes to the graph are automatically batched and write failures are retried.