-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
504 additions
and
139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Check | ||
|
||
on: | ||
push: {} | ||
pull_request: {} | ||
|
||
jobs: | ||
|
||
go: | ||
name: Go | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.13 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
dep ensure | ||
fi | ||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
|
||
- name: Format check | ||
run: | | ||
fmtdiff="$(gofmt -s -e -d .)" | ||
if [ -n "$fmtdiff" ]; then | ||
>&2 echo "$fmtdiff" | ||
exit 1 | ||
fi | ||
terraform: | ||
name: Terraform | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
|
||
- name: Terraformat | ||
run: terraform fmt -recursive examples | ||
|
||
- name: Check docs updated | ||
run: | | ||
curl -L https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.4.0/tfplugindocs_0.4.0_linux_amd64.zip --output tfplugindocs.zip | ||
unzip tfplugindocs.zip tfplugindocs | ||
./tfplugindocs | ||
change="$(git diff)" | ||
if [ -n "$change" ]; then | ||
>&2 echo "$change" | ||
exit 1 | ||
fi |
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 +1,2 @@ | ||
/dist/ | ||
/terraform-provider-wireguard | ||
*.tfstate |
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,20 @@ | ||
--- | ||
layout: "" | ||
page_title: "Provider: Mullvad" | ||
description: |- | ||
The WireGuard provider is used to handle WireGuard metadata. | ||
--- | ||
|
||
# WireGuard Provider | ||
|
||
The WireGuard provider is used to handle WireGuard metadata. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "wireguard" { | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema |
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,44 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "wireguard_asymmetric_key Resource - terraform-provider-wireguard" | ||
subcategory: "" | ||
description: |- | ||
Provides a WireGuard asymmetric key resource. This can be used to create, read, and delete WireGuard keys in terraform state. | ||
--- | ||
|
||
# wireguard_asymmetric_key (Resource) | ||
|
||
Provides a WireGuard asymmetric key resource. This can be used to create, read, and delete WireGuard keys in terraform state. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "wireguard_asymmetric_key" "example" { | ||
} | ||
output "wg_public_key" { | ||
description = "Example's public WireGuard key" | ||
value = wireguard_asymmetric_key.example.public_key | ||
} | ||
output "wg_private_key" { | ||
description = "Example's private WireGuard key" | ||
value = wireguard_asymmetric_key.example.private_key | ||
sensitive = true | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- **bind** (String) A string to tie the lifecycle to, e.g. the terraform ID of another resource. | ||
- **id** (String) The ID of this resource. | ||
- **private_key** (String, Sensitive) A supplied WireGuard private key. By default one is generated. | ||
|
||
### Read-Only | ||
|
||
- **public_key** (String) The public key corresponding to the (given or generated) private key. | ||
|
||
|
This file was deleted.
Oops, something went wrong.
Empty file.
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,2 @@ | ||
provider "wireguard" { | ||
} |
3 changes: 3 additions & 0 deletions
3
examples/asymmetric_key/outputs.tf → ...rces/wireguard_asymmetric_key/resource.tf
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 |
---|---|---|
|
@@ -4,5 +4,4 @@ terraform { | |
source = "OJFord/wireguard" | ||
} | ||
} | ||
required_version = ">= 0.13" | ||
} |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/OJFord/terraform-provider-wireguard/wireguard" | ||
"github.com/hashicorp/terraform-plugin-sdk/plugin" | ||
"github.com/hashicorp/terraform-plugin-sdk/terraform" | ||
"github.com/OJFord/terraform-provider-wireguard/provider" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin" | ||
) | ||
|
||
func main() { | ||
plugin.Serve(&plugin.ServeOpts{ | ||
ProviderFunc: func() terraform.ResourceProvider { | ||
return wireguard.Provider() | ||
ProviderFunc: func() *schema.Provider { | ||
return provider.Provider() | ||
}, | ||
}) | ||
} |
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
37 changes: 21 additions & 16 deletions
37
...uard/resource_wireguard_asymmetric_key.go → ...ider/resource_wireguard_asymmetric_key.go
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,16 @@ | ||
--- | ||
layout: "" | ||
page_title: "Provider: Mullvad" | ||
description: |- | ||
The WireGuard provider is used to handle WireGuard metadata. | ||
--- | ||
|
||
# WireGuard Provider | ||
|
||
The WireGuard provider is used to handle WireGuard metadata. | ||
|
||
## Example Usage | ||
|
||
{{ tffile "examples/provider/provider.tf" }} | ||
|
||
{{ .SchemaMarkdown | trimspace }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.