This OpenTofu/Terraform module provisions and configures Oracle Cloud Infrastructure (OCI) Object Storage resources, including:
-
Object Storage bucket
-
Replication policy
-
Lifecycle policy
Ensure you have the following before using this module:
- OpenTofu or Terraform installed
- An Oracle Cloud Infrastruture(OCI) Account
- Configure OCI CLI with appropriate credentials
- Required IAM policies for user permissions Object Storage and service permissions Lifecycle Management, Auto-tiering and Replication
Creates an Object Storage bucket with optional versioning and auto-tiering.
Enables object versioning to retain previous versions of objects. This helps in retrieving and recovering previous versions, protecting against accidental or malicious overwrites and deletions.
If enabled, helps reduce storage costs by automatically moving objects between the Standard and Infrequent Access storage tiers based on data access patterns.
Applies retention rules at the bucket level to provide immutable object storage for regulatory compliance and legal requirements.
If enabled, configures automatic replication of objects from one Object Storage bucket to another, either in the same region or across different regions.
Defines rules for automatic management of objects, such as archiving or deleting objects after a specified period.
Stores read/write access logs for auditing and tracking.
Note: Before enabling these features, check their interaction with other Object Storage features. Not all features can be enabled simultaneously, and some may have dependencies or limitations when used together.
This module is compatible with OpenTofu. To use Terraform instead of OpenTofu, ensure you have Terraform installed and use the following provider configuration:
terraform {
required_providers {
oci = {
source = "oracle/oci"
version = ">= 6.31.0"
}
}
}
-
Use
terraform.tfvars
FileThe repository includes a terraform.tfvars.example file. Edit it and replace the placeholder values with your actual OCI credentials, to create your own terraform.tfvars file.
-
To deploy the resources, initialize and apply the configuration:
tofu init # or terraform init
tofu plan # or terraform plan
tofu apply # or terraform apply
To destroy the created resources, use:
tofu destroy # or terraform destroy
This project is licensed under the MIT License - see the LICENSE file for details.