From 80beb2c45458a51a5603f8c18dba8a77987b1d3c Mon Sep 17 00:00:00 2001 From: James Kwon Date: Thu, 10 Aug 2023 21:20:09 -0400 Subject: [PATCH] Fix EC2 keypair nil pointer issue --- aws/aws.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aws/aws.go b/aws/aws.go index b6c4229e..615f0828 100644 --- a/aws/aws.go +++ b/aws/aws.go @@ -1275,7 +1275,10 @@ func GetAllResources(targetRegions []string, excludeAfter time.Time, resourceTyp // End EC2 VPCS // Start EC2 KeyPairs - KeyPairs := EC2KeyPairs{} + KeyPairs := EC2KeyPairs{ + Client: ec2.New(cloudNukeSession), + Region: region, + } if IsNukeable(KeyPairs.ResourceName(), resourceTypes) { start := time.Now() keyPairIds, err := KeyPairs.getAll(configObj)