Hi@akhtar,
You won't be able to extract EBS details from aws_instance since it's the AWS side that provides an EBS volume to the resource. But you can define an EBS data source with some filter.
data "aws_ebs_volume" "ebs_volume" {
most_recent = true
filter {
name = "attachment.instance-id"
values = ["${aws_instance.DCOS-master3.id}"]
}
}
output "ebs_volume_id" {
value = "${data.aws_ebs_volume.ebs_volume.id}"
}