Orchestrator Function: AWS EC2 Key Pair Import

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 Import an AWS EC2 Key Pair

Public Function: EC2KeyPairImport

publicEC2KeyPairImport(objAWSClient:AWSClient,strPublicKeyMaterial:string,strKeyName:string):EC2ImportKeyPairResult{

letobjAmazonEC2Client:AmazonEC2Client=objAWSClient.getAmazonEC2Client();

letobjEC2ImportKeyPairRequest:EC2ImportKeyPairRequest=newEC2ImportKeyPairRequest();
objEC2ImportKeyPairRequest.setKeyName(strKeyName);
objEC2ImportKeyPairRequest.setPublicKeyMaterial(strPublicKeyMaterial);

letobjEC2ImportKeyPairResult:EC2ImportKeyPairResult=objAmazonEC2Client.importKeyPair(objEC2ImportKeyPairRequest);

returnobjEC2ImportKeyPairResult;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like