Skip to content

Terraform Provider for Ceph RadosGW

Notifications You must be signed in to change notification settings

startnext/terraform-provider-rgw

Repository files navigation

Terraform Provider Ceph RGW

Dieser Provider kann S3 User, Buckets und Bucket Policies in Ceph RadosGW anlegen. Er wird hauptsächlich intern bei Startnext verwendet.

Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
go install

Using the provider locally

To distribute the provider locally, download the repository and run the following commands. Change BINARY_ARCH if you are not on apple silicon.

export PROVIDER_VERSION=1.0.0
export BINARY_ARCH=darwin_arm64
CGO_ENABLED=0 go build -o ~/.terraform.d/plugins/terraform.local/local/rgw/${PROVIDER_VERSION}/${BINARY_ARCH}/terraform-provider-rgw_v${PROVIDER_VERSION} -ldflags="-X 'main.Version=${PROVIDER_VERSION}'" main.go

Make sure to use the correct binary architecture

Add the following to your ~/.terraformrc

provider_installation {
  filesystem_mirror {
    path    = "/Users/%Me/.terraform.d/plugins"
  }
  direct {
    exclude = ["terraform.local/*/*"]
  }
}

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).

To compile the provider, run go install. This will build the provider and put the provider binary in the $GOPATH/bin directory.

To generate or update documentation, run go generate.

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources, and often cost money to run.

make testacc