opentofu / opentofu

OpenTofu lets you declaratively manage your cloud infrastructure.
https://opentofu.org
Mozilla Public License 2.0
23.16k stars 894 forks source link

Terraform Backend with OCI Object Storage #1011

Open ravinitp opened 10 months ago

ravinitp commented 10 months ago

OpenTofu Version

OpenTofu v1.6.0-dev
on darwin_amd64

Use Cases

A new Terraform backend utilising Oracle Cloud Infrastructure (OCI) Object Storage as the storage backend. Leveraging OCI Object Storage provides a scalable and cost-effective alternative to traditional backends, offering a robust solution for state file storage and management.

Attempted Solutions

Traditional Terraform backends, such as Amazon S3 and Azure Blob Storage, have been widely used for state file storage. However, for organisations operating within the Oracle Cloud ecosystem, OCI Object Storage presents an attractive option. This custom backend aims to facilitate Terraform deployments within OCI by seamlessly integrating with OCI Object Storage.

Proposal

  1. The Terraform user configures the backend using the custom backend module, specifying the OCI Object Storage details.

    ```hcl ``` terraform { backend "oci" { bucket = "" object = "" namespace = "" # Other OCI authentication details tenancy_ocid = "" user_ocid = "" fingerprint = "" private_key_path = "" region = "" } } -- 2. During Terraform operations, the backend module interacts with OCI IAM to authenticate and obtain the necessary credentials. 3. The state file is read from or written to OCI Object Storage securely. 4. Access control policies ensure that only authorised users and services can interact with the state files. ### References _No response_
    Yantrio commented 10 months ago

    This seems to be supported already here through the s3 or remote backend api:

    https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformUsingObjectStore.htm

    Is there a reason to not use those approaches to achieve this here?

    ravinitp commented 10 months ago

    @Yantrio , Object storage can support state lock without using dynamodb by using its rename API.