Skip to content
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

fix :#1218, #1152 - refactor EC2 network interface, private ip #1219

Merged
merged 10 commits into from
Sep 20, 2023

Conversation

achantavy
Copy link
Contributor

@achantavy achantavy commented Jul 17, 2023

Refactors EC2 Network Interfaces and Private IPs to the cartography data model. Fixes #1152 since the data model includes automatic cleanup jobs.

@achantavy achantavy changed the title refactor: #1218, fix: #1152 fix :#1218, fix: #1152 - refactor EC2 network interface, private ip Jul 17, 2023
@achantavy achantavy changed the title fix :#1218, fix: #1152 - refactor EC2 network interface, private ip fix :#1218, #1152 - refactor EC2 network interface, private ip Jul 17, 2023
@achantavy achantavy linked an issue Jul 17, 2023 that may be closed by this pull request
@achantavy achantavy force-pushed the refactornetworkinterfaces branch from bac1e91 to 5875244 Compare July 17, 2023 19:38
@achantavy achantavy force-pushed the refactornetworkinterfaces branch from 4accca8 to 1426cff Compare September 11, 2023 17:35
Comment on lines +84 to +85
if network_interface.get('PrivateIpAddresses'):
for private_ip_address in network_interface['PrivateIpAddresses']:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocker: chane this to

Suggested change
if network_interface.get('PrivateIpAddresses'):
for private_ip_address in network_interface['PrivateIpAddresses']:
for private_ip_address in network_interface.get('PrivateIpAddresses', []):

cartography/models/aws/ec2/networkinterfaces.py Outdated Show resolved Hide resolved
Comment on lines 33 to 38
interface_type: PropertyRef = PropertyRef('InterfaceType')
public_ip: PropertyRef = PropertyRef('PublicIp')
requester_id: PropertyRef = PropertyRef('RequesterId')
requester_managed: PropertyRef = PropertyRef('RequesterManaged')
source_dest_check: PropertyRef = PropertyRef('SourceDestCheck')
subnetid: PropertyRef = PropertyRef('SubnetId')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra indexes for public_ip, subnet_id, and maybe requester_id

@achantavy achantavy merged commit 1d81839 into master Sep 20, 2023
4 checks passed
@achantavy achantavy deleted the refactornetworkinterfaces branch September 20, 2023 17:41
chandanchowdhury pushed a commit to juju4/cartography that referenced this pull request Jun 26, 2024
…ork interface, private ip (cartography-cncf#1219)

Refactors EC2 Network Interfaces and Private IPs to the cartography data
model. Fixes cartography-cncf#1152 since the data model includes automatic cleanup jobs.

- Uses same technique as cartography-cncf#1214 to represent Network Interfaces as known
by EC2 instances vs Network Interfaces known by
describe-network-interfaces.
- Also clearly marks that the Private IPs ingested here are known by
Network Interfaces and not another source.
mac_address: PropertyRef = PropertyRef('MacAddress', extra_index=True)
description: PropertyRef = PropertyRef('Description')
private_dns_name: PropertyRef = PropertyRef('PrivateDnsName', extra_index=True)
private_ip_address: PropertyRef = PropertyRef('PrivateIpAddress', extra_index=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@serge-wq - [comment 1 of 2] here's an example of what we were talking about earlier: a network interface as known by an EC2 instance has a private_ip_address...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually never mind, wait let me find a better example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants