-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added organisation datasource & resource
- Loading branch information
1 parent
84c6476
commit b63b696
Showing
27 changed files
with
1,761 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Visit https://golangci-lint.run/ for usage documentation | ||
# and information on other useful linters | ||
issues: | ||
max-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- durationcheck | ||
- errcheck | ||
- exportloopref | ||
- forcetypeassert | ||
- godot | ||
- gofmt | ||
- gosimple | ||
- ineffassign | ||
- makezero | ||
- misspell | ||
- nilerr | ||
- predeclared | ||
- staticcheck | ||
- tenv | ||
- unconvert | ||
- unparam | ||
- unused | ||
- vet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Visit https://goreleaser.com for documentation on how to customize this | ||
# behavior. | ||
version: 2 | ||
|
||
before: | ||
hooks: | ||
# this is just an example and not a requirement for provider building/publishing | ||
- go mod tidy | ||
builds: | ||
- env: | ||
# goreleaser does not work with CGO, it could also complicate | ||
# usage by users in CI/CD systems like Terraform Cloud where | ||
# they are unable to install libraries. | ||
- CGO_ENABLED=0 | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' | ||
goos: | ||
- freebsd | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- '386' | ||
- arm | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: '386' | ||
binary: '{{ .ProjectName }}_v{{ .Version }}' | ||
archives: | ||
- format: zip | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
checksum: | ||
extra_files: | ||
- glob: 'terraform-registry-manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' | ||
algorithm: sha256 | ||
signs: | ||
- artifacts: checksum | ||
args: | ||
# if you are using this in a GitHub action or some other automated pipeline, you | ||
# need to pass the batch flag to indicate its not interactive. | ||
- "--batch" | ||
- "--local-user" | ||
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key | ||
- "--output" | ||
- "${signature}" | ||
- "--detach-sign" | ||
- "${artifact}" | ||
release: | ||
extra_files: | ||
- glob: 'terraform-registry-manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' | ||
# If you want to manually examine the release before its live, uncomment this line: | ||
# draft: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
default: testacc | ||
|
||
# Run acceptance tests | ||
.PHONY: testacc | ||
testacc: | ||
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m | ||
|
||
.PHONY: lint | ||
lint: | ||
golangci-lint run | ||
|
||
.PHONY: docs | ||
docs: | ||
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs | ||
tfplugindocs generate | ||
@echo "Use this site to preview markdown rendering: https://registry.terraform.io/tools/doc-preview" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,81 @@ | ||
# terraform-provider-cratedb | ||
Terraform provider to manage CrateDB | ||
|
||
## Requirements | ||
|
||
- [Terraform](https://developer.hashicorp.com/terraform/downloads) >= 1.0 | ||
- [Go](https://golang.org/doc/install) >= 1.20 | ||
|
||
## Building The Provider | ||
|
||
1. Clone the repository | ||
1. Enter the repository directory | ||
1. Build the provider using the Go `install` command: | ||
|
||
```shell | ||
go install | ||
``` | ||
|
||
## Adding Dependencies | ||
|
||
This provider uses [Go modules](https://github.com/golang/go/wiki/Modules). | ||
Please see the Go documentation for the most up to date information about using Go modules. | ||
|
||
To add a new dependency `github.com/author/dependency` to your Terraform provider: | ||
|
||
```shell | ||
go get github.com/author/dependency | ||
go mod tidy | ||
``` | ||
|
||
Then commit the changes to `go.mod` and `go.sum`. | ||
|
||
## Using the provider | ||
|
||
Add the below code to your configuration. | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
cratedb = { | ||
source = "komminarlabs/cratedb" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Initialize the provider | ||
|
||
```terraform | ||
provider "cratedb" { | ||
api_key = "*******" | ||
api_secret = "*******" | ||
url = "https://console.cratedb.cloud/" | ||
} | ||
``` | ||
|
||
## Available functionalities | ||
|
||
### Data Sources | ||
|
||
* | ||
|
||
### Resources | ||
|
||
* | ||
|
||
## Developing the Provider | ||
|
||
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#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 `make docs`. | ||
|
||
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. | ||
|
||
```shell | ||
make testacc | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cratedb_organization Data Source - terraform-provider-cratedb" | ||
subcategory: "" | ||
description: |- | ||
To retrieve an organization. | ||
--- | ||
|
||
# cratedb_organization (Data Source) | ||
|
||
To retrieve an organization. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `id` (String) The id of the organization. | ||
|
||
### Read-Only | ||
|
||
- `dc` (Attributes) The DublinCore of the organization. (see [below for nested schema](#nestedatt--dc)) | ||
- `email` (String) The notification email used in the organization. | ||
- `name` (String) The name of the organization. | ||
- `notifications_enabled` (Boolean) Whether notifications enabled for the organization. | ||
- `plan_type` (Number) The support plan type used in the organization. | ||
- `project_count` (Number) The project count in the organization. | ||
- `role_fqn` (String) The role FQN. | ||
|
||
<a id="nestedatt--dc"></a> | ||
### Nested Schema for `dc` | ||
|
||
Read-Only: | ||
|
||
- `created` (String) The created time. | ||
- `modified` (String) The modified time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cratedb_organizations Data Source - terraform-provider-cratedb" | ||
subcategory: "" | ||
description: |- | ||
To retrieve all organizations. | ||
--- | ||
|
||
# cratedb_organizations (Data Source) | ||
|
||
To retrieve all organizations. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Read-Only | ||
|
||
- `organizations` (Attributes List) (see [below for nested schema](#nestedatt--organizations)) | ||
|
||
<a id="nestedatt--organizations"></a> | ||
### Nested Schema for `organizations` | ||
|
||
Read-Only: | ||
|
||
- `dc` (Attributes) The DublinCore of the organization. (see [below for nested schema](#nestedatt--organizations--dc)) | ||
- `email` (String) The notification email used in the organization. | ||
- `id` (String) The id of the organization. | ||
- `name` (String) The name of the organization. | ||
- `notifications_enabled` (Boolean) Whether notifications enabled for the organization. | ||
- `plan_type` (Number) The support plan type used in the organization. | ||
- `project_count` (Number) The project count in the organization. | ||
- `role_fqn` (String) The role FQN. | ||
|
||
<a id="nestedatt--organizations--dc"></a> | ||
### Nested Schema for `organizations.dc` | ||
|
||
Read-Only: | ||
|
||
- `created` (String) The created time. | ||
- `modified` (String) The modified time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "CrateDB Provider" | ||
subcategory: "" | ||
description: |- | ||
Use the CrateDB provider to deploy and manage resources supported by CrateDB. You must configure the provider with the proper credentials before you can use it. | ||
--- | ||
|
||
# CrateDB Provider | ||
|
||
Use the CrateDB provider to deploy and manage resources supported by CrateDB. You must configure the provider with the proper credentials before you can use it. | ||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
cratedb = { | ||
source = "komminarlabs/cratedb" | ||
} | ||
} | ||
} | ||
provider "cratedb" {} | ||
``` | ||
|
||
## Environment Variables | ||
|
||
Credentials can be provided by using the `CRATEDB_API_KEY` and `CRATEDB_API_SECRET` and `CRATEDB_URL`. | ||
|
||
### Example | ||
|
||
```terraform | ||
export CRATEDB_API_KEY="*******" | ||
export CRATEDB_API_SECRET="*******" | ||
export CRATEDB_URL="https://console.cratedb.cloud/" | ||
provider "cratedb" {} | ||
terraform plan | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `api_key` (String, Sensitive) The API key | ||
- `api_secret` (String, Sensitive) The API secret | ||
- `url` (String) The CrateDB Cloud URL |
Oops, something went wrong.