Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.



Get Started Now!

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
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x