Orchestrator Function: AWS EC2 Key Pair Create

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

Public Function: EC2KeyPairInfoCreate

publicEC2KeyPairGet(objAWSClient:AWSClient,strKeyFormat:"pem"|"ppk",strKeyName:string,strKeyType:"rsa"|"ed25519"):EC2KeyPair{

letobjAmazonEC2Client:AmazonEC2Client=objAWSClient.getAmazonEC2Client();

letobjEC2CreateKeyPairRequest:EC2CreateKeyPairRequest=newEC2CreateKeyPairRequest();
objEC2CreateKeyPairRequest.setKeyFormat(strKeyFormat);
objEC2CreateKeyPairRequest.setKeyName(strKeyName);
objEC2CreateKeyPairRequest.setKeyType(strKeyType);

letobjEC2CreateKeyPairResult:EC2CreateKeyPairResult=objAmazonEC2Client.createKeyPair(objEC2CreateKeyPairRequest);

letobjEC2KeyPair:EC2KeyPair=objEC2CreateKeyPairResult.getKeyPair();

returnobjEC2KeyPair;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like