I’m trying to complete the lab that asks me to replace the local-state variable with the remote one. I did that, and then tried to run terraform init and I’m getting invalid token errors. This is a lab so I don’t have control over everything , and in the lab it said we only need the bucket name, key, and region to create a backend so I’m a bit confused. Also I did try to make this a remote_file resource as well even though this is a credential based error, but that didn’t work either. I tried adding the credentials into the terraform file to login to the minio website before this slide , but it’s still saying error 403 . So i’m thinking it might be on the Kode Kloud Side backend.
Please take a look at the solution tab for step 7. You’re doing a bit more than they expect, which is the problem. The solution has you do the much simpler:
main.tf:
resource "local_file" "state" {
filename = "/root/${var.remote-state}"
content = "This configuration uses ${var.remote-state} state"
}
as of step 7, we haven’t hooked up the bucket yet :-). If you continue with the lab, they’ll walk you through the rest of it.
They asked me to configure the backend in one of the previous questions, so I was just showing my code so people can see what I’ve done so far.