Skip to content

Commit f0f2532

Browse files
committed
feat: initial release
Adds entry resource and data source
1 parent afc6b70 commit f0f2532

24 files changed

+1752
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
terraform-provider-dvls
2+
terraform-provider-dvls.exe

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0 (Unreleased)
2+
3+
FEATURES:

GNUmakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
default: testacc
2+
3+
# Run acceptance tests
4+
.PHONY: testacc
5+
testacc:
6+
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m

LICENSE

Lines changed: 373 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
1-
# terraform-provider-devolutions
2-
Devolutions' Terraform Provider
1+
# Terraform Provider Dvls (Terraform Plugin Framework)
2+
:warning: **This provider is a work in progress, expect breaking changes between releases** :warning:
3+
4+
Terraform Provider for managing your Devolutions Server instance.
5+
6+
## Requirements
7+
8+
- [Terraform](https://www.terraform.io/downloads.html) >= 1.0
9+
- [Go](https://golang.org/doc/install) >= 1.18
10+
11+
## Building The Provider
12+
13+
1. Clone the repository
14+
1. Enter the repository directory
15+
1. Build the provider using the Go `install` command:
16+
17+
```shell
18+
go install
19+
```
20+
21+
## Adding Dependencies
22+
23+
This provider uses [Go modules](https://github.com/golang/go/wiki/Modules).
24+
Please see the Go documentation for the most up to date information about using Go modules.
25+
26+
To add a new dependency `github.com/author/dependency` to your Terraform provider:
27+
28+
```shell
29+
go get github.com/author/dependency
30+
go mod tidy
31+
```
32+
33+
Then commit the changes to `go.mod` and `go.sum`.
34+
35+
## Using the provider
36+
37+
Visit the Terraform Registry at https://registry.terraform.io/providers/Devolutions/dvls/latest for usage information.
38+
39+
## Developing the Provider
40+
41+
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).
42+
43+
To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
44+
45+
To generate or update documentation, run `go generate`.
46+
47+
In order to run the full suite of Acceptance tests, run `make testacc`.
48+
49+
*Note:* Acceptance tests create real resources, and often cost money to run.
50+
51+
```shell
52+
make testacc
53+
```

docs/data-sources/entry.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "dvls_entry Data Source - terraform-provider-dvls"
4+
subcategory: ""
5+
description: |-
6+
Entry data source
7+
---
8+
9+
# dvls_entry (Data Source)
10+
11+
Entry data source
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "dvls_entry" "example" {
17+
id = "00000000-0000-0000-0000-000000000000"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `id` (String) Entry ID
27+
28+
### Read-Only
29+
30+
- `description` (String) Entry description
31+
- `folder` (String) Entry folder path
32+
- `name` (String) Entry name
33+
- `password` (String, Sensitive) Entry password
34+
- `tags` (List of String) Entry tags
35+
- `username` (String) Entry username
36+
- `vault_id` (String) Vault ID
37+
38+

docs/index.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "dvls Provider"
4+
subcategory: ""
5+
description: |-
6+
The provider can be configured using the environment variables DVLSAPPID and DVLSAPPSECRET
7+
---
8+
9+
# dvls Provider
10+
11+
The provider can be configured using the environment variables DVLS_APP_ID and DVLS_APP_SECRET
12+
13+
## Example Usage
14+
15+
```terraform
16+
provider "dvls" {
17+
baseuri = "https://your-dvls-instance.com/"
18+
appid = "00000000-0000-0000-0000-000000000000"
19+
secret = "your-sensitive-secret"
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `base_uri` (String) DVLS base URI
29+
30+
### Optional
31+
32+
- `app_id` (String) DVLS App ID `$DVLS_APP_ID`
33+
- `secret` (String, Sensitive) DVLS App Secret `$DVLS_APP_SECRET`

docs/resources/entry.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "dvls_entry Resource - terraform-provider-dvls"
4+
subcategory: ""
5+
description: |-
6+
A DVLS Entry
7+
---
8+
9+
# dvls_entry (Resource)
10+
11+
A DVLS Entry
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "dvls_entry" "example" {
17+
vault_id = "00000000-0000-0000-0000-000000000000"
18+
name = "foo"
19+
description = "bar"
20+
username = "foo"
21+
password = "bar"
22+
folder = "foo/bar"
23+
tags = ["foo", "bar"]
24+
}
25+
```
26+
27+
<!-- schema generated by tfplugindocs -->
28+
## Schema
29+
30+
### Required
31+
32+
- `name` (String) Entry name
33+
- `vault_id` (String) Vault ID
34+
35+
### Optional
36+
37+
- `description` (String) Entry description
38+
- `folder` (String) Entry folder path
39+
- `password` (String, Sensitive) Entry password
40+
- `tags` (List of String) Entry tags
41+
- `username` (String) Entry username
42+
43+
### Read-Only
44+
45+
- `id` (String) Entry ID
46+
47+

examples/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Examples
2+
3+
This directory contains examples that are mostly used for documentation, but can also be run/tested manually via the Terraform CLI.
4+
5+
The document generation tool looks for files in the following locations by default. All other *.tf files besides the ones mentioned below are ignored by the documentation tool. This is useful for creating examples that can run and/or ar testable even if some parts are not relevant for the documentation.
6+
7+
* **provider/provider.tf** example file for the provider index page
8+
* **data-sources/`full data source name`/data-source.tf** example file for the named data source page
9+
* **resources/`full resource name`/resource.tf** example file for the named data source page
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "dvls_entry" "example" {
2+
id = "00000000-0000-0000-0000-000000000000"
3+
}

examples/provider/provider.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "dvls" {
2+
baseuri = "https://your-dvls-instance.com/"
3+
appid = "00000000-0000-0000-0000-000000000000"
4+
secret = "your-sensitive-secret"
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resource "dvls_entry" "example" {
2+
vault_id = "00000000-0000-0000-0000-000000000000"
3+
name = "foo"
4+
description = "bar"
5+
username = "foo"
6+
password = "bar"
7+
folder = "foo/bar"
8+
tags = ["foo", "bar"]
9+
}

go.mod

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module github.com/Devolutions/terraform-provider-dvls
2+
3+
go 1.18
4+
5+
require (
6+
github.com/Devolutions/go-dvls v0.4.0
7+
github.com/google/uuid v1.3.0
8+
github.com/hashicorp/terraform-plugin-docs v0.13.0
9+
github.com/hashicorp/terraform-plugin-framework v1.1.1
10+
github.com/hashicorp/terraform-plugin-go v0.14.3
11+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0
12+
)
13+
14+
require (
15+
github.com/Masterminds/goutils v1.1.1 // indirect
16+
github.com/Masterminds/semver/v3 v3.1.1 // indirect
17+
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
18+
github.com/agext/levenshtein v1.2.2 // indirect
19+
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
20+
github.com/armon/go-radix v1.0.0 // indirect
21+
github.com/bgentry/speakeasy v0.1.0 // indirect
22+
github.com/fatih/color v1.13.0 // indirect
23+
github.com/golang/protobuf v1.5.2 // indirect
24+
github.com/google/go-cmp v0.5.9 // indirect
25+
github.com/hashicorp/errwrap v1.1.0 // indirect
26+
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
27+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
28+
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
29+
github.com/hashicorp/go-hclog v1.4.0 // indirect
30+
github.com/hashicorp/go-multierror v1.1.1 // indirect
31+
github.com/hashicorp/go-plugin v1.4.8 // indirect
32+
github.com/hashicorp/go-uuid v1.0.3 // indirect
33+
github.com/hashicorp/go-version v1.6.0 // indirect
34+
github.com/hashicorp/hc-install v0.5.0 // indirect
35+
github.com/hashicorp/hcl/v2 v2.16.1 // indirect
36+
github.com/hashicorp/logutils v1.0.0 // indirect
37+
github.com/hashicorp/terraform-exec v0.17.3 // indirect
38+
github.com/hashicorp/terraform-json v0.15.0 // indirect
39+
github.com/hashicorp/terraform-plugin-log v0.8.0 // indirect
40+
github.com/hashicorp/terraform-registry-address v0.1.0 // indirect
41+
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
42+
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
43+
github.com/huandu/xstrings v1.3.2 // indirect
44+
github.com/imdario/mergo v0.3.13 // indirect
45+
github.com/mattn/go-colorable v0.1.12 // indirect
46+
github.com/mattn/go-isatty v0.0.14 // indirect
47+
github.com/mitchellh/cli v1.1.5 // indirect
48+
github.com/mitchellh/copystructure v1.2.0 // indirect
49+
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
50+
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
51+
github.com/mitchellh/mapstructure v1.5.0 // indirect
52+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
53+
github.com/oklog/run v1.0.0 // indirect
54+
github.com/posener/complete v1.2.3 // indirect
55+
github.com/russross/blackfriday v1.6.0 // indirect
56+
github.com/shopspring/decimal v1.3.1 // indirect
57+
github.com/spf13/cast v1.5.0 // indirect
58+
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
59+
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
60+
github.com/vmihailenco/tagparser v0.1.1 // indirect
61+
github.com/zclconf/go-cty v1.12.1 // indirect
62+
golang.org/x/crypto v0.6.0 // indirect
63+
golang.org/x/mod v0.7.0 // indirect
64+
golang.org/x/net v0.6.0 // indirect
65+
golang.org/x/sys v0.5.0 // indirect
66+
golang.org/x/text v0.7.0 // indirect
67+
google.golang.org/appengine v1.6.6 // indirect
68+
google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect
69+
google.golang.org/grpc v1.51.0 // indirect
70+
google.golang.org/protobuf v1.28.1 // indirect
71+
)

0 commit comments

Comments
 (0)