I have configured a resource for instances list:
resource "aws_instance" "masters" {
count = "${var.masters_count}"
ami = "${var.aws_centos_ami}"
instance_type = "t2.micro"
key_name = "${var.aws_key_name}"
vpc_security_group_ids = ["${aws_security_group.bastion.id}"]
associate_public_ip_address = true
source_dest_check = false
subnet_id = "${aws_subnet.eu-west-1b-public.id}"
availability_zone = "eu-west-1b"
tags {
Name = "master-${count.index}"
}
}
Then I attach volumes to that instances:
data "aws_ebs_volume" "masters_ebs_volume" { count ="${var.masters_count}"filter { name = "attachment.instance-id" values = ["${element(aws_instance.masters.*.id, count.index)}"] } }
Now I am trying to import the volumes to terraform. I just try using:
terraform import aws_ebs_volume.data[0] vol-1153438514541
terraform import aws_ebs_volume.masters_ebs_volume[0] vol-1153438514541
terraform import aws_ebs_volume.masters[0] vol-1153438514541
terraform import aws_ebs_volume.data vol-1153438514541
terraform import aws_ebs_volume.masters vol-1153438514541
But nothing works.. how can I import that volumes?
data "aws_ebs_volume" "masters_ebs_volume" { count ="${var.masters_count}"filter { name = "attachment.instance-id" values = ["${element(aws_instance.masters.*.id, count.index)}"] } }
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/59a8cda0-bab4-405e-900b-131eec7743f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
count = "${var.masters_count}"?
Thanks!To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/896ead40-c5f3-4fb5-850f-9bc2f46ed998%40googlegroups.com.