{"id":20700751,"url":"https://github.com/l2fprod/cos-terraform-backend","last_synced_at":"2025-05-10T19:32:13.691Z","repository":{"id":136481843,"uuid":"358701490","full_name":"l2fprod/cos-terraform-backend","owner":"l2fprod","description":"Use a COS bucket as a terraform backend","archived":true,"fork":false,"pushed_at":"2023-11-17T18:44:04.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T03:53:10.801Z","etag":null,"topics":["cloud-object-storage","ibm-cloud","s3","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l2fprod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-04-16T19:35:18.000Z","updated_at":"2024-02-21T22:35:49.000Z","dependencies_parsed_at":"2023-05-06T10:30:31.813Z","dependency_job_id":null,"html_url":"https://github.com/l2fprod/cos-terraform-backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fcos-terraform-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fcos-terraform-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fcos-terraform-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2fprod%2Fcos-terraform-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l2fprod","download_url":"https://codeload.github.com/l2fprod/cos-terraform-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253471331,"owners_count":21913837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-object-storage","ibm-cloud","s3","terraform"],"created_at":"2024-11-17T00:36:58.120Z","updated_at":"2025-05-10T19:32:13.421Z","avatar_url":"https://github.com/l2fprod.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Cloud Object Storage as a backend\n\nThis repository shows how to use IBM Cloud Object Storage (COS) as a backend to store terraform state through COS [Terraform S3 compatibility](https://www.terraform.io/docs/backends/types/s3.html).\n\n1. Create a COS instance and bucket in IBM Cloud. Terraform is used in this step to create the COS service and the bucket as it is easier than to list all instructions that you would need to perform in the UI or the CLI.\n\n   ```sh\n   cd 010-prepare-backend\n   terraform init\n   terraform apply\n   ```\n\n   \u003e It generates a `backend.tf` file in `020-use-backend` with the COS service instance and bucket information. Later instead of hardcoding the values in `backend.tf`, you can use environment variables to initialize the backend as described in https://www.terraform.io/docs/language/settings/backends/s3.html.\n\n2. Test the backend.\n\n   ```sh\n   cd 020-use-backend\n   terraform init\n   terraform apply\n   ```\n\n3. Look into your COS bucket for a file named `global.state`.\n\n## Enable object versioning\n\nYou can benefit from COS built-in object versioning by changing the definition of the COS bucket in `010-prepare-backend/main.tf` to include the [object_versioning flag](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cos_bucket#object_versioning).\n\n## License\n\nThis project is licensed under the Apache License Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl2fprod%2Fcos-terraform-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl2fprod%2Fcos-terraform-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl2fprod%2Fcos-terraform-backend/lists"}