I am deploying a kube cluster using kops/terraform. My Kube's state store in in S3. However I also want to save my the terraform state file to be in S3:\bucket\something.tf instead of a local filesystem from where I deploy the kube.


If you use Kops with terraform, the result is the usual terraform definition. Simply your own in the same folder to modify/augment what kops generated. To achieve what you need a section like

terraform {
  backend "s3" {
    bucket = "mybucket"
    key    = "path/to/my/key"
    region = "us-east-1"

should be enough. For reference : https://www.terraform.io/docs/backends/types/s3.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.