Skip to content

Support for EBS Volume Clones #44740

@mattmoyer

Description

@mattmoyer

Description

AWS has recently introduced the ability to copy an EBS volume using the CopyVolumes API. I would like to be able to use this API to create EBS volume clones using Terraform.

Affected Resource(s) or Data Source(s)

  • aws_ebs_volume

Potential Terraform Configuration

One potential design would be to work this into a new field on the aws_ebs_volume resource:

# Look up the source volume
data "aws_ebs_volume" "source" {
  most_recent = true

  filter {
    name   = "tag:Name"
    values = ["Example"]
  }
}

# Create a clone
resource "aws_ebs_volume" "clone" {
  availability_zone = data.aws_ebs_volume.source.availability_zone // must match AZ of source
  source_volume_id   = data.aws_ebs_volume.source.id
  tags = {
    Name = "ExampleClone"
  }
}

In this example, source_volume_id is the new argument that triggers calling the CopyVolumes API instead of CreateVolume.

References

AWS announcement posts:

SDK support:

Would you like to implement the enhancement?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequests to existing resources that expand the functionality or scope.needs-triageWaiting for first response or review from a maintainer.service/ebsIssues and PRs that pertain to the ebs service.service/ec2ebsIssues and PRs that pertain to the ec2ebs service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions