Function: AWS EC2 Snapshot 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 AWS EC2 Snapshot

Public Function: EC2SnapshotCreate

public EC2SnapshotCreate(objAWSClient: AWSClient, strVolumeId: string, strDescription: string): EC2Snapshot {

    let objAmazonEC2Client: AmazonEC2Client = objAWSClient.getAmazonEC2Client();

    let objEC2CreateSnapshotRequest: EC2CreateSnapshotRequest = new EC2CreateSnapshotRequest();
    objEC2CreateSnapshotRequest.setDescription(strDescription);
    objEC2CreateSnapshotRequest.setVolumeId(strVolumeId);

    let objEC2CreateSnapshotResult: EC2CreateSnapshotResult = objAmazonEC2Client.createSnapshot(objEC2CreateSnapshotRequest);

    let objEC2Snapshot: EC2Snapshot = objEC2CreateSnapshotResult.getSnapshot();

    return objEC2Snapshot;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like