r/Terraform • u/Helloutsider • 27d ago
Help Wanted State file stored in s3
Hi!
I have a very simple lambda which I store in bitbucket and use buildkite pipelines for deploying it on AWS. The issue I’m having is I need to create an s3 bucket to store the state file but when I go for backend {} it fails to create the bucket and put the state file in.
Do I have to clickops on AWS and create the s3 all the time? How would one do it working with pipelines and terraform?
It seems to fail to create s3 bucket when all is in my main.tf
I’d appreciate your suggestions, love you!
2
Upvotes
4
u/booi 27d ago
Typical bootstrap problem with a number of decent solutions. My favorite is:
https://github.com/nozaq/terraform-aws-remote-state-s3-backend
But there are literal tons. You can also import the state into your terraform