Skip to content

CreateSnapshot

Source: src/AWS/EC2/CreateSnapshot.ts

Runtime binding for the CreateSnapshot operation scoped to the bound Volume (IAM actions ec2:CreateSnapshot + ec2:CreateTags on the volume ARN and the region-wide snapshot wildcard — snapshot creation authorizes against both the source volume and the new snapshot).

Creates a point-in-time EBS snapshot of the volume — e.g. a Lambda that takes an application-consistent backup before a risky migration. The snapshot is created pending and completes asynchronously. Provide the implementation with Effect.provide(AWS.EC2.CreateSnapshotHttp).

// init — bind the operation to the volume
const createSnapshot = yield* AWS.EC2.CreateSnapshot(volume);
// runtime — take a point-in-time backup
const snapshot = yield* createSnapshot({
Description: "pre-migration backup",
});
console.log(snapshot.SnapshotId, snapshot.State);