Skip to content

This is an experimental Terraform provider that allows users to create a storage bucket in any of the cloud platforms - AWS, GCP and Azure

License

Notifications You must be signed in to change notification settings

rrajesh1979/terraform-provider-ublob

Repository files navigation

UBLOB - Universal blob storage

GitHub GitHub release (latest by date) Go Report Card Codecov branch GitHub commits GitHub contributors

Experimental Terraform provider (custom)

---

One provider to rule them all! Create an AWS S3 bucket, Azure Storage container, GCP cloud storage bucket all using this provider.

Menu

Gitpod

  • Environment with dependencies pre-installed and ready for you to develop
  • Visual Studio Code with required extensions preloaded

Open in Gitpod

Pre-requisites to build your own environment

  1. Terraform
  2. Go SDK
  3. AWS CLI
  4. GCP CLI
  5. AZURE CLI
brew install hashicorp/tap/terraform
brew install go
brew install awscli
brew install --cask google-cloud-sdk
brew update && brew install azure-cli

Example configurations

AWS

resource "ublob_blob" "aws_blob" {
  bucket = "rrajesh1979-007"
  cloud = "AWS"
  region = "us-east-2"
}

output "ublob_aws_out" {
  value = ublob_blob.aws_blob
}

GCP

resource "ublob_blob" "gcp_blob" {
  bucket = "rrajesh1979-001"
  cloud = "GCP"
  region = "asia"
  project_id = "peer-poc"
  storage_class = "Standard"
}

output "ublob_gcp_out" {
  value = ublob_blob.gcp_blob
}

AZURE

variable "storage_account_key" {
  type = string
}

resource "ublob_blob" "az_blob" {
  bucket = "tf-blob-2"
  cloud = "AZURE"
  region = "us"
  storage_account = "rrajesh1979"
  storage_account_key = var.storage_account_key
}

output "ublob_az_out" {
  value = ublob_blob.az_blob
}

Usage

Cloud provider specific configuration

  • AWS
aws configure
  • GCP
gcloud auth application-default login
  • AZURE
az login
az account set --subscription ""
##Setup environment variables
export TF_VAR_storage_account_key="<<Your storage account key>>"
#usage
make install
cd examples
terraform init && terraform apply --auto-approve

Future enhancements

  • This is an experimental Terraform provider that allows users to create a storage bucket in any of the cloud platforms - AWS, GCP and Azure
  • This Alpha release is to build a working version of the provider.
  • The current release is a basic version that only supports
    • Create resource
    • Destroy resource
  • ###ToDo
    • Functional
    • Enhanced Read
    • Implement Update, Import
    • Support for fine-grained attributes for storage bucket - ex. permissions, versioning etc.
    • Non-Functional
    • Add test cases
    • Code refactoring
    • Improve exception handling
    • Better logging and error handling
    • Idiomatic go code

About

This is an experimental Terraform provider that allows users to create a storage bucket in any of the cloud platforms - AWS, GCP and Azure

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published