Terraform Error: Unsuitable value for left operand: number required

│ Error: Invalid operand
│
│   on main.tf line 31, in output "Administrator_Password1":
│   31:    value = "${aws_instance.example.*.public_ip}" - [
│   32:      for g in aws_instance.example : rsadecrypt(g.password_data,file("aws-hl-training.pem"))
│   33:    ]
│     ├────────────────
│     │ aws_instance.example is tuple with 18 elements
│
│ Unsuitable value for left operand: number required.
╵
╷
│ Error: Invalid operand
│
│   on main.tf line 31, in output "Administrator_Password1":
│   31:    value = "${aws_instance.example.*.public_ip}" - [
│   32:      for g in aws_instance.example : rsadecrypt(g.password_data,file("aws-hl-training.pem"))
│   33:    ]
│     ├────────────────
│     │ aws_instance.example is tuple with 18 elements
│
│ Unsuitable value for right operand: number required.
╵

C:\Users\Rajesh Kumar\Desktop\Lab-Prep\windows-lab>terraform init

│ Error: reading EC2 Instance (i-0505e57672f7efd4f): Password data is blank for instance ID: i-0505e57672f7efd4f
│
│   with aws_instance.example[16],
│   on main.tf line 7, in resource "aws_instance" "example":
│    7: resource "aws_instance" "example" {
│
╵
╷
│ Error: reading EC2 Instance (i-0c724c424aa85637a): Password data is blank for instance ID: i-0c724c424aa85637a
│
│   with aws_instance.example[13],
│   on main.tf line 7, in resource "aws_instance" "example":
│    7: resource "aws_instance" "example" {
│
╵