I wanted to copy my EBS snapshot from one region to another region. But while filtering the snapshot-id, it will return id named 1411205605 but i expected it to return something like: snap-..... .
Here is my code:
data "aws_ebs_snapshot_ids" "ebs_volumes" {
filter {
name = "tag:Name"
values = ["EBS1_snapshot"]
}
filter {
name = "volume-size"
values = ["2"]
}
}
output "ebs_snapshot_ids"{
value = ["${data.aws_ebs_snapshot_ids.ebs_volumes.ids}"]
}
resource "aws_ebs_snapshot_copy" "example_copy" {
source_snapshot_id = "${data.aws_ebs_snapshot_ids.ebs_volumes.id}"
source_region = "ap-southeast-1"
tags {
Name = "aaa_copy_snap"
}
}
The output while running terraform apply is :
aws_ebs_snapshot_copy.example_copy: InvalidParameterValue: Value (1411205605) for parameter snapshotId is invalid. Expected: 'snap-...'. status code: 400, request id: bd577049-8b4e-45bc-8415-59e22b4d26d5
I don't know where i made mistake. How can i resolve this issue?