Code Monkey home page Code Monkey logo

terraform-provider-s3's Introduction

terraform-provider-s3

Description

A more generic S3 provider for Terraform. The objective is to have an independent S3 provider that is compatible with AWS, RGW, GCE, etc.

Requirements

Installation

The installation process assumes a properly installed and configured Go environment.

go get github.com/negronjl/terraform-provider-s3
go install github.com/negronjl/terraform-provider-s3

The provider will be available in $GOPATH/bin

Usage

Provider Configuration

The provider requires some variables to be configured in order to gain access to the S3 compatible server:

  • s3_server: S3 Server
  • s3_region: S3 Server region (default: us-east-1)
  • s3_access_key: S3 Server Access Key
  • s3_secret_key: S3 Server Secret Key
  • s3_api_signature: S3 Server API Signature (type: string, options: v2 or v4, default: v4)
  • Supported cloud storage providers:
    • AWS Signature Version 4
      • Amazon S3
      • Minio
    • AWS Signature Version 2
      • Google Cloud Storage (Compatibility Mode)
      • Openstack Swift + Swift3 middleware
      • Ceph Object Gateway
      • Riak CS
  • s3_ssl: Connect using SSL
  • s3_debug: Enable Debug messages

s3

provider "s3" {
    s3_server        = "http://localhost:9000"
    s3_region        = "custom-region-1"
    s3_access_key    = "Access Key here"
    s3_secret_key    = "Secret Key here"
    s3_api_signature = "v2"
    s3_ssl           = false
    s3_debug         = true
}

Resource Configuration (s3_bucket)

s3_bucket resources represent a bucket in the S3 server. It requires a bucket name to operate:

  • bucket: Name of the bucket to use
resource "s3_bucket" "resource_name" {
	bucket = "my_bucket_name"
}

Resource Configuration (s3_file)

s3_file resources represent a file to be uploaded to the S3 server or downloaded from it. It currently takes the following arguments:

  • bucket: Bucket in the S3 server
  • name: S3 Object name
  • file_path: Local file path where to read or save the object
  • content_type: The content type of the object. Defaults to: application/octet-stream
  • debug: Print debug messages
resource "s3_file" "resource_name" {
    bucket       = "my_bucket_name"
    name         = "my_object_name"
    file_path    = /tmp/my_file.bin
    content_type = "application/octet-stream"
    debug        = true
}

terraform-provider-s3's People

Contributors

negronjl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

terraform-provider-s3's Issues

Issue with getting the binary

I have been trying to compile the code but getting error.

root@local# go get -u github.com/negronjl/terraform-provider-s3                                                                                          
# github.com/negronjl/terraform-provider-s3
./files.go:58:32: cannot use content_type (type string) as type minio.PutObjectOptions in argument to s3_client.FPutObject
./files.go:83:29: not enough arguments in call to s3_client.FGetObject
        have (string, string, string)
        want (string, string, string, minio.GetObjectOptions)

Version Details:
Go version :

go version go1.9.1 linux/amd64

Add LICENSE to project

Please add a license of your choice to make it easier to use your project in corporate settings.

Update Provider to use Terraform 0.12 SDK.

Hello,

I have made a fork of this repository and updated it to use the new Terraform 0.12 SDk.

I have also added the following enhancements:

  • Enable providing credentials via AWS Shared credentials file and profile.
  • Enable ignoring Self-Signed Certificate Validation errors.
  • Enable trusting Self-Signed Certificate Authorities.
  • Enable upload of string content.

I am opening this issue to inform you and link the Pull Request I am about open.

Thanks,
Esten

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.