Skip to content

This repository contains Terraform modules to provision and configures OCI Object Storage resources, including buckets, replication, lifecycle policies, and access logs.

License

Notifications You must be signed in to change notification settings

angeline-hilda/OCI-Terraform-ObjectStorage

Repository files navigation

Oracle Cloud Infrastructure Terraform Module for Object Storage

This OpenTofu/Terraform module provisions and configures Oracle Cloud Infrastructure (OCI) Object Storage resources, including:

Pre-requisites

Ensure you have the following before using this module:

Features and Resources

Object Storage Bucket

Creates an Object Storage bucket with optional versioning and auto-tiering.

Object Versioning

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.

Auto-tiering

If enabled, helps reduce storage costs by automatically moving objects between the Standard and Infrequent Access storage tiers based on data access patterns.

Retention Rules

Applies retention rules at the bucket level to provide immutable object storage for regulatory compliance and legal requirements.

Replication Policy

If enabled, configures automatic replication of objects from one Object Storage bucket to another, either in the same region or across different regions.

Lifecycle Policy

Defines rules for automatic management of objects, such as archiving or deleting objects after a specified period.

Bucket Access Logs

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.

Using with Terraform

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"
    }
  }
}

Deploy using OpenTofu or Terraform

  1. Use terraform.tfvars File

    The 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.

  2. To deploy the resources, initialize and apply the configuration:

tofu init  # or terraform init
tofu plan  # or terraform plan
tofu apply # or terraform apply

Cleanup

To destroy the created resources, use:

tofu destroy # or terraform destroy

Documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This repository contains Terraform modules to provision and configures OCI Object Storage resources, including buckets, replication, lifecycle policies, and access logs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages