Skip to content

Instantly share code, notes, and snippets.

@miry
Created March 18, 2018 18:54
Show Gist options
  • Save miry/e2a9d5c3410270b3001b94ba94cc7039 to your computer and use it in GitHub Desktop.
Save miry/e2a9d5c3410270b3001b94ba94cc7039 to your computer and use it in GitHub Desktop.
REsize Amazon EBS volumes without a reboot: Step 2 Detect instance IP base on attached volume
// volumes.tf
// ...
data "aws_instance" "mysql" {
filter {
name = "block-device-mapping.volume-id"
values = ["${aws_ebs_volume.mysql.id}"]
}
}
output "instance_id" {
value = "${data.aws_instance.mysql.id}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment