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

chore: remove zone relationship #1264

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions scrapers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -1156,12 +1156,6 @@ func (aws Scraper) instances(ctx *AWSContext, config v1.AWS, results *v1.ScrapeR
Relationship: "RegionInstance",
})

relationships = append(relationships, v1.RelationshipResult{
ConfigExternalID: v1.ExternalID{ExternalID: ctx.Subnets[lo.FromPtr(i.SubnetId)].Zone, ConfigType: v1.AWSAvailabilityZone},
RelatedExternalID: selfExternalID,
Relationship: "ZoneInstance",
})

instance := NewInstance(i)
labels := instance.Tags
if labels == nil {
Expand Down Expand Up @@ -1634,20 +1628,6 @@ func (aws Scraper) subnets(ctx *AWSContext, config v1.AWS, results *v1.ScrapeRes
Relationship: "RegionSubnet",
})

// Subnet to availability zone relationship
Copy link
Member

Choose a reason for hiding this comment

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

We just need to ensure they have both the zone (us-east-1a) and id (us-east-az7) as tags

Copy link
Member Author

@yashmehrotra yashmehrotra Dec 17, 2024

Choose a reason for hiding this comment

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

Added zone-id as tag wherever they were available, some only report zone (Volumes and LB), should I map zone -> zoneIds to populate those or is it fine ?

relationships = append(relationships, v1.RelationshipResult{
RelatedExternalID: selfExternalID,
ConfigExternalID: v1.ExternalID{ExternalID: lo.FromPtr(subnet.AvailabilityZone), ConfigType: v1.AWSAvailabilityZone},
Relationship: "AvailabilityZoneSubnet",
})

// Subnet to availability zone relationship
relationships = append(relationships, v1.RelationshipResult{
RelatedExternalID: selfExternalID,
ConfigExternalID: v1.ExternalID{ExternalID: lo.FromPtr(subnet.AvailabilityZoneId), ConfigType: v1.AWSAvailabilityZoneID},
Relationship: "AvailabilityZoneIDSubnet",
})

result := v1.ScrapeResult{
Type: v1.AWSEC2Subnet,
Status: string(subnet.State),
Expand Down
Loading