Closed baquick closed 4 years ago
Can you clarify what you mean by a “terraform node”?
The bucket is created by terraform in this module. You should not create the bucket by any other means.
Please note this module uses a bit of terraform “inception” to manage terraforms state bucket with terraform. Thus it’s a 2-phase process.
I think the problem you are having is that you define a s3 backend before creating the s3 backend. You’ll note that in the first backend section there is no reference to s3. That is deliberate. Then after applying, the bucket is created. Now we can update the backend section to add s3. After doing that, we need to rerun terraform init which will import the state.
This is a coldstart problem. Just needs to happen once.
Nope, this causes a whole bunch of problems.
then I try and use the state in another folder, with no previous state, and I get this:
I tried skipping steps 4 and 5, thinking that worked, but then no state is saved....so since this change was made, I have now stuck. Been using this module for years with no problem...now I can't use it.
$ terraform --version Terraform v0.12.18
On Dec 2, 2019, I was able to use this module just fine. Had not had to create any infrastructure since then. Started yesterday....and this is what I ran into. was on v0.12.10 then as well..
If I skip steps 4 and 5, I do not get the above errors, but my state doesn't get stored either....
So I got thru that error, but now state is not being maintained between my folders...it says it is initializing the backend state, but it is not...
The state is not being saved...tried numerous efforts...whatever update was made to this module has rendered it un-useful...will have to find another way to maintain remote state
in your steps 1 - 5, you state that you need to add the backend section.
You fail to indicate that it needs to be in a terraform node.
In addition, you fail to mention that the bucket referenced must already exist. I get this error:
Error: Error inspecting states in the "s3" backend: S3 bucket does not exist