Skip to content

Commit

Permalink
feat(entry_certificate): add entry_certificate resource and data source
Browse files Browse the repository at this point in the history
  • Loading branch information
dion-gionet committed Jun 6, 2024
1 parent 9d3655e commit 4115a3d
Show file tree
Hide file tree
Showing 13 changed files with 996 additions and 5 deletions.
55 changes: 55 additions & 0 deletions docs/data-sources/entry_certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dvls_entry_certificate Data Source - terraform-provider-dvls"
subcategory: ""
description: |-
Certificate data source
---

# dvls_entry_certificate (Data Source)

Certificate data source

## Example Usage

```terraform
data "dvls_entry_certificate" "example" {
id = "00000000-0000-0000-0000-000000000000"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) Certificate ID

### Read-Only

- `description` (String) Certificate description
- `expiration` (String) Certificate expiration date, in RFC3339 format (e.g. 2022-12-31T23:59:59-05:00)
- `file` (Attributes, Sensitive) Certificate file. Either file or url must be specified. (see [below for nested schema](#nestedatt--file))
- `folder` (String) Certificate folder path
- `name` (String) Certificate name
- `password` (String, Sensitive) Certificate password
- `tags` (List of String) Certificate tags
- `url` (Attributes) Certificate url. Either file or url must be specified. (see [below for nested schema](#nestedatt--url))
- `vault_id` (String) Vault ID

<a id="nestedatt--file"></a>
### Nested Schema for `file`

Read-Only:

- `content_b64` (String, Sensitive) Certificate base 64 encoded string
- `name` (String) Certificate file name


<a id="nestedatt--url"></a>
### Nested Schema for `url`

Read-Only:

- `url` (String) Certificate url
- `use_default_credentials` (Boolean) Use default credentials
97 changes: 97 additions & 0 deletions docs/resources/entry_certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dvls_entry_certificate Resource - terraform-provider-dvls"
subcategory: ""
description: |-
A DVLS Certificate
---

# dvls_entry_certificate (Resource)

A DVLS Certificate

## Example Usage

```terraform
# Example with URL
resource "dvls_entry_certificate" "url" {
vault_id = "00000000-0000-0000-0000-000000000000"
name = "foo"
description = "bar"
password = "bar"
folder = "foo\\bar"
expiration = "2022-12-31T23:59:59-05:00"
tags = ["foo", "bar"]
url = {
url = "http://foo.bar"
use_default_credentials = false
}
}
# Example with file content
resource "dvls_entry_certificate" "file" {
vault_id = "00000000-0000-0000-0000-000000000000"
name = "foo"
description = "bar"
password = "bar"
folder = "foo\\bar"
expiration = "2022-12-31T23:59:59-05:00"
tags = ["foo", "bar"]
file = {
name = "test.p12"
content_b64 = filebase64("test.p12")
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `expiration` (String) Certificate expiration date, in RFC3339 format (e.g. 2022-12-31T23:59:59-05:00)
- `name` (String) Certificate name
- `vault_id` (String) Vault ID

### Optional

- `description` (String) Certificate description
- `file` (Attributes, Sensitive) Certificate file. Either file or url must be specified. (see [below for nested schema](#nestedatt--file))
- `folder` (String) Certificate folder path
- `password` (String, Sensitive) Certificate password
- `tags` (List of String) Certificate tags
- `url` (Attributes) Certificate url. Either file or url must be specified. (see [below for nested schema](#nestedatt--url))

### Read-Only

- `id` (String) Certificate ID

<a id="nestedatt--file"></a>
### Nested Schema for `file`

Required:

- `content_b64` (String, Sensitive) Certificate base 64 encoded string
- `name` (String) Certificate file name


<a id="nestedatt--url"></a>
### Nested Schema for `url`

Required:

- `url` (String) Certificate url

Optional:

- `use_default_credentials` (Boolean) Use default credentials

## Import

Import is supported using the following syntax:

```shell
terraform import dvls_entry_certificate.example 00000000-0000-0000-0000-000000000000
```
4 changes: 2 additions & 2 deletions docs/resources/vault.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ resource "dvls_vault" "example" {

- `description` (String) Vault description
- `master_password` (String, Sensitive) Vault master password
- `security_level` (String) Vault security level. Must be one of the following: [high, standard]
- `visibility` (String) Vault visibility. Must be one of the following: [default, public, private]
- `security_level` (String) Vault security level. Must be one of the following: [standard, high]
- `visibility` (String) Vault visibility. Must be one of the following: [private, default, public]

### Read-Only

Expand Down
3 changes: 3 additions & 0 deletions examples/data-sources/dvls_entry_certificate/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "dvls_entry_certificate" "example" {
id = "00000000-0000-0000-0000-000000000000"
}
1 change: 1 addition & 0 deletions examples/resources/dvls_entry_certificate/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import dvls_entry_certificate.example 00000000-0000-0000-0000-000000000000
31 changes: 31 additions & 0 deletions examples/resources/dvls_entry_certificate/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Example with URL
resource "dvls_entry_certificate" "url" {
vault_id = "00000000-0000-0000-0000-000000000000"
name = "foo"
description = "bar"
password = "bar"
folder = "foo\\bar"
expiration = "2022-12-31T23:59:59-05:00"
tags = ["foo", "bar"]

url = {
url = "http://foo.bar"
use_default_credentials = false
}
}

# Example with file content
resource "dvls_entry_certificate" "file" {
vault_id = "00000000-0000-0000-0000-000000000000"
name = "foo"
description = "bar"
password = "bar"
folder = "foo\\bar"
expiration = "2022-12-31T23:59:59-05:00"
tags = ["foo", "bar"]

file = {
name = "test.p12"
content_b64 = filebase64("test.p12")
}
}
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ go 1.21
toolchain go1.22.1

require (
github.com/Devolutions/go-dvls v0.7.0
github.com/Devolutions/go-dvls v0.8.0
github.com/google/uuid v1.6.0
github.com/hashicorp/terraform-plugin-docs v0.19.2
github.com/hashicorp/terraform-plugin-framework v1.8.0
github.com/hashicorp/terraform-plugin-framework-timetypes v0.4.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.23.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
)
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/Devolutions/go-dvls v0.7.0 h1:GGA2x6THjiovSlm3vILTTO1shAJe/Dhx+MfXcyLBX+8=
github.com/Devolutions/go-dvls v0.7.0/go.mod h1:4O3lb/RK1P1cDwU5auVi7CM4gRER7EuwyLwMVuEZjgg=
github.com/Devolutions/go-dvls v0.8.0 h1:rok82K0nWhDwBGiPM/s7F84Tg8NUDihrnP9YmEvJ/wo=
github.com/Devolutions/go-dvls v0.8.0/go.mod h1:4O3lb/RK1P1cDwU5auVi7CM4gRER7EuwyLwMVuEZjgg=
github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0=
github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down Expand Up @@ -103,6 +103,10 @@ github.com/hashicorp/terraform-plugin-docs v0.19.2 h1:YjdKa1vuqt9EnPYkkrv9HnGZz1
github.com/hashicorp/terraform-plugin-docs v0.19.2/go.mod h1:gad2aP6uObFKhgNE8DR9nsEuEQnibp7il0jZYYOunWY=
github.com/hashicorp/terraform-plugin-framework v1.8.0 h1:P07qy8RKLcoBkCrY2RHJer5AEvJnDuXomBgou6fD8kI=
github.com/hashicorp/terraform-plugin-framework v1.8.0/go.mod h1:/CpTukO88PcL/62noU7cuyaSJ4Rsim+A/pa+3rUVufY=
github.com/hashicorp/terraform-plugin-framework-timetypes v0.4.0 h1:XLI93Oqw2/KTzYjgCXrUnm8LBkGAiHC/mDQg5g5Vob4=
github.com/hashicorp/terraform-plugin-framework-timetypes v0.4.0/go.mod h1:mGuieb3bqKFYwEYB4lCMt302Z3siyv4PFYk/41wAUps=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg=
github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/125t+AAurhqphJ2Co=
github.com/hashicorp/terraform-plugin-go v0.23.0/go.mod h1:1E3Cr9h2vMlahWMbsSEcNrOCxovCZhOOIXjFHbjc/lQ=
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
Expand Down
Loading

0 comments on commit 4115a3d

Please sign in to comment.