Function: AWS EC2 Snapshot Delete

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 Delete an AWS EC2 Snapshot

Public Function: EC2SnapshotDelete

public EC2SnapshotDelete(objAWSClient: AWSClient, strSnapshotId: string): string {

    let objAmazonEC2Client: AmazonEC2Client = objAWSClient.getAmazonEC2Client();

    let objEC2DeleteSnapshotRequest: EC2DeleteSnapshotRequest = new EC2DeleteSnapshotRequest();
    objEC2DeleteSnapshotRequest.setSnapshotId(strSnapshotId);

    let objEC2DeleteSnapshotResult: EC2DeleteSnapshotResult = objAmazonEC2Client.deleteSnapshot(objEC2DeleteSnapshotRequest);

    let strEC2DeleteSnapshotResult: string = objEC2DeleteSnapshotResult.toString();

    return strEC2DeleteSnapshotResult;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like