MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

Terraform Error: Each argument may be set only once

Uncategorized

Error


output "instance_public_ip" {
  value = aws_instance.web.public_ip
  value = aws_instance.web.private_ip
}
C:\Users\Rajesh Kumar\Desktop\Terarform\proj1>terraform validate
╷
│ Error: Attribute redefined
│
│   on aws.tf line 13, in output "instance_public_ip":
│   13:   value = aws_instance.web.private_ip
│
│ The argument "value" was already set at aws.tf:12,3-8. Each argument may be set only once.
╵


Solution

output "instance_public_ip" {
  value = aws_instance.web.public_ip
  value = aws_instance.web.private_ip
}

INTO

output "instance_public_ip" {
  value = aws_instance.web.public_ip
}

output "instance_public_ip" {
  value = aws_instance.web.private_ip
}
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x