One provider to rule them all! Create an AWS S3 bucket, Azure Storage container, GCP cloud storage bucket all using this provider.
- Environment with dependencies pre-installed and ready for you to develop
- Visual Studio Code with required extensions preloaded
- Terraform
- Go SDK
- AWS CLI
- GCP CLI
- 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
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
}
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
- 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