Reputation: 21
Using AWS session token in terraform. The RDS restoration is taking more than an hour and session token get expired in the meantime. Due to this the tf state file is also not getting updated in s3. Is there a way to run tf apply in background so that we can refresh token at regular intervals and the operation does not fail?
11:07:25 status code: 400, request id: PF3V9137RT1HVB3W, host id: SeXwAFlokygO5NjyKppBD/kYvFl/i9nrh81YSf7Szta6y5Wfd20ssxmFYYwhg+XysuPMvb1uuJo=
11:07:25
11:07:25
11:07:25 Error: Failed to persist state to backend.
11:07:25
11:07:25 The error shown above has prevented Terraform from writing the updated state
11:07:25 to the configured backend. To allow for recovery, the state has been written
11:07:25 to the file "errored.tfstate" in the current working directory.
11:07:25
11:07:25 Running "terraform apply" again at this point will create a forked state,
11:07:25 making it harder to recover.
11:07:25
11:07:25 To retry writing this state, use the following command:
11:07:25 terraform state push errored.tfstate
11:07:25
11:07:25
11:07:25
11:07:25 Releasing state lock. This may take a few moments...
11:07:30
11:07:30 Error releasing the state lock!
11:07:30
11:07:30 Error message: failed to retrieve lock info: ExpiredTokenException: The security token included in the request is expired
11:07:30 status code: 400, request id: C7JE11FDGLPTU672G4781LOR73VV4KQNSO5AEMVJF66Q9ASUAAJG
Upvotes: 0
Views: 2843
Reputation: 21
Got a workaround by breaking down the process in two steps. The creation was taking huge time as i was creating a multi-AZ RDS instance. As a solution:
This worked for me.
Upvotes: 1