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 Attach an AWS EC2 Volume to an EC2 Instance
Public Function: EC2VolumeAttach
public EC2VolumeAttach(objAWSClient: AWSClient, strVolumeId: string, strDevice: string, strInstanceId: string): EC2VolumeAttachment {
let objAmazonEC2Client: AmazonEC2Client = objAWSClient.getAmazonEC2Client();
let objEC2AttachVolumeRequest: EC2AttachVolumeRequest = new EC2AttachVolumeRequest();
objEC2AttachVolumeRequest.setVolumeId(strVolumeId);
objEC2AttachVolumeRequest.setInstanceId(strInstanceId);
objEC2AttachVolumeRequest.setDevice(strDevice);
let objEC2AttachVolumeResult: EC2AttachVolumeResult = objAmazonEC2Client.attachVolume(objEC2AttachVolumeRequest);
let objEC2VolumeAttachment: EC2VolumeAttachment = objEC2AttachVolumeResult.getAttachment();
return objEC2VolumeAttachment;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
