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 Snapshot of all Volumes on an EC2 Instance
Public Function: EC2InstanceSnapshotAllVolumes
publicEC2InstanceSnapshotAllVolumes(objAWSClient:AWSClient,objEC2Instance:EC2Instance,strDescription:string):EC2Snapshot[]{
letarrEC2InstanceBlockDeviceMapping:EC2InstanceBlockDeviceMapping[]=objEC2Instance.getBlockDeviceMappings();
letarrEC2Snapshot:EC2Snapshot[]=arrEC2InstanceBlockDeviceMapping.map((objEC2InstanceBlockDeviceMapping:EC2InstanceBlockDeviceMapping):EC2Snapshot=>{
letobjEC2EbsInstanceBlockDevice:EC2EbsInstanceBlockDevice=objEC2InstanceBlockDeviceMapping.getEbs();
letstrVolumeId:string=objEC2EbsInstanceBlockDevice.getVolumeId();
letobjEC2Snapshot:EC2Snapshot=this.EC2SnapshotCreate(objAWSClient,strVolumeId,strDescription);
returnobjEC2Snapshot;
});
returnarrEC2Snapshot;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
