terraform-ansible-setup icon indicating copy to clipboard operation
terraform-ansible-setup copied to clipboard

How to define this public_ip variable in output.tf?

Open scheung38 opened this issue 5 years ago • 2 comments

  1. When init:

Error: output 'public_ip': "aws_instance.aws_instance.public_ip" is not a valid output for module "ec2"

  1. also output.tf:

value = "${module.ec2.aws_instance.aws_instance.public_ip}" Unresolved?

  1. thirdly we need to change?:

variable "public_ip" { description = "Public IP" default = "52.62.107.101" }

we need to change this correct? I guess they are one of the same thing. Be useful to know how to setup thanks

scheung38 avatar Mar 24 '19 13:03 scheung38

Hi @scheung38 , Thanks for raising the issue. Will test out the ec2 instance part and get back on the same.

For 3) Yeah, Its a default IP value so it can very well be changed.

ramitsurana avatar Mar 26 '19 17:03 ramitsurana

still doesn't work after creating an aws instance and specifying my private IP address still getting the same error, plus i test the GCP code got the bellow errors.

Error: module.instance.google_compute_instance.sample[0]: "boot_disk": required field is not set

Error: module.instance.google_compute_instance.sample[0]: "disk": [REMOVED] Use boot_disk, scratch_disk, and attached_disk instead

Error: module.instance.google_compute_instance.sample[1]: "boot_disk": required field is not set

Error: module.instance.google_compute_instance.sample[1]: "disk": [REMOVED] Use boot_disk, scratch_disk, and attached_disk instead

Error: module.instance.google_compute_instance.sample[2]: "boot_disk": required field is not set

Error: module.instance.google_compute_instance.sample[2]: "disk": [REMOVED] Use boot_disk, scratch_disk, and attached_disk instead

not sure if am doing something wrong please advise?

thanks in advance

teekay2020 avatar Apr 08 '19 10:04 teekay2020