Orchestrator Function: AWS EC2 Key Pair Info Get

by Simon Sparks · 7 February 2026

To use this function add it to the class library file named OrchestratorPluginAWSService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: OrchestratorPluginAWSService.ts

Description: Orchestrator Function to Get AWS EC2 Key Pair Info

Public Function: EC2KeyPairInfoGet

publicEC2KeyPairInfoGet(objAWSClient:AWSClient,arrEC2Filter?:EC2Filter[]):EC2KeyPairInfo[]{

letobjAmazonEC2Client:AmazonEC2Client=objAWSClient.getAmazonEC2Client();

letobjEC2DescribeKeyPairsRequest:EC2DescribeKeyPairsRequest=newEC2DescribeKeyPairsRequest();
objEC2DescribeKeyPairsRequest.setIncludePublicKey(true);

if (arrEC2Filter){
objEC2DescribeKeyPairsRequest.setFilters(arrEC2Filter);
}

letobjEC2DescribeKeyPairsResult:EC2DescribeKeyPairsResult=objAmazonEC2Client.describeKeyPairs(objEC2DescribeKeyPairsRequest);

letarrEC2KeyPairInfo:EC2KeyPairInfo[]=objEC2DescribeKeyPairsResult.getKeyPairs();

returnarrEC2KeyPairInfo;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like