Resource: aws_ebs_snapshot

Creates a Snapshot of an EBS Volume.

Example Usage

resource "aws_ebs_volume" "example" {
  availability_zone = "us-west-2a"
  size              = 40

  tags = {
    Name = "HelloWorld"
  }
}

resource "aws_ebs_snapshot" "example_snapshot" {
  volume_id = aws_ebs_volume.example.id

  tags = {
    Name = "HelloWorld_snap"
  }
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import EBS Snapshot using the id. For example:

import {
  to = aws_ebs_snapshot.id
  id = "snap-049df61146c4d7901"
}

Using terraform import, import EBS Snapshot using the id. For example:

% terraform import aws_ebs_snapshot.id snap-049df61146c4d7901