I have attached two EBS Volumes to a EC2 instance. Using terraform, I want to output the ID's of the attached volumes. 1. I used the Data Source "aws_instance" but it only shows One attached volume. 2. Also tried using Data Source "aws_ebs_volume", but still get only one volume.
Please advice.
Code:
*data "aws_instance" "foo" {
instance_id = "i-kljo......b0e"
}*
*output "ebs_block_device" {
value = "${data.aws_instance.foo.ebs_block_device}"
}*
-------------------------------------------------------
*data "aws_ebs_volume" "ebs_volume" {
most_recent = true
filter {
name = "tag:Name"
values = ["Test_001"]
}
}*
*output "ebs_all_volumnes" {
value = ["${data.aws_ebs_volume.ebs_volume.id}"]
}*