Skip to content

Commit

Permalink
tailwarden#1089 added nil check on associated KeyPair
Browse files Browse the repository at this point in the history
  • Loading branch information
Kavibritto Chalaman committed Oct 16, 2023
1 parent e9cdfd6 commit 96dba3a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions providers/aws/ec2/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,14 @@ func getEC2Relations(inst *etype.Instance, resourceArn string) (rel []models.Lin
})

// Get associated Keypair
rel = append(rel, models.Link{
ResourceID: *inst.KeyName,
Name: *inst.KeyName,
Type: "Key Pair",
Relation: "USES",
})
if inst.KeyName != nil {
rel = append(rel, models.Link{
ResourceID: *inst.KeyName,
Name: *inst.KeyName,
Type: "Key Pair",
Relation: "USES",
})
}

// Get associated IAM roles
if inst.IamInstanceProfile != nil {
Expand Down

0 comments on commit 96dba3a

Please sign in to comment.