Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
axon-droe committed Jul 11, 2024
1 parent 3387dfa commit d9079e6
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 105 deletions.
34 changes: 11 additions & 23 deletions docs/resources/create.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "azurekvca_create Resource - terraform-provider-azurekvca"
page_title: "azurekvca_create Resource - azurekvca"
subcategory: ""
description: |-
Create a new certificate version and if needed cert ready for signing
---

# azurekvca_create (Resource)
Expand All @@ -17,36 +17,24 @@ Create a new certificate version and if needed cert ready for signing

### Required

- `key` (Attributes) (see [below for nested schema](#nestedatt--key))
Private key settings
- `name` (String)
Name of cert to create
- `vault_url` (String)
URL of Azure Key Vault
- `key` (Attributes) Private key attributes (see [below for nested schema](#nestedatt--key))
- `name` (String) Name of cert to create
- `vault_url` (String) URL of Azure Key Vault

### Read-Only

- `csr_pem` (String)
Resulting CSR in PEM format
- `csr_pem` (String) Resulting CSR in PEM format

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

Required:

- `exportable` (Boolean)
Is key able to be exported
Not supported if -HSM key type is used
- `key_type` (String)
Type of key to create (RSA, RSA-HSM, EC, EC-HSM)
- `reuse_key` (Boolean)
Should private key be reused on subsequent versions
- `exportable` (Boolean) Is key able to be exported. Not supported if -HSM key type is used
- `key_type` (String) Type of key to create (RSA, RSA-HSM, EC, EC-HSM)
- `reuse_key` (Boolean) Should private key be reused on subsequent versions

Optional:

- `curve` (String)
One of (P-256, P-384, P-521)
Required if key type is EC or EC-HSM
- `key_size` (Number)
Size of key in bits
Required if key type is RSA or RSA-HSM
- `curve` (String) One of (P-256, P-384, P-521) Required if key type is EC or EC-HSM
- `key_size` (Number) Size of key in bits. Required if key type is RSA or RSA-HSM
14 changes: 5 additions & 9 deletions docs/resources/merge.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "azurekvca_merge Resource - terraform-provider-azurekvca"
page_title: "azurekvca_merge Resource - azurekvca"
subcategory: ""
description: |-
Complete a certificate operation by merging the signed certificate with pending version
---

# azurekvca_merge (Resource)
Expand All @@ -12,15 +12,11 @@ Complete a certificate operation by merging the signed certificate with pending




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

### Required

- `cert_pem` (String)
Cert to merge in PEM format
- `name` (String)
Name of pending cert
- `vault_url` (String)
URL of Azure Key Vault
- `cert_pem` (String) Cert to merge in PEM format
- `name` (String) Name of pending cert
- `vault_url` (String) URL of Azure Key Vault
28 changes: 10 additions & 18 deletions docs/resources/request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "azurekvca_request Resource - terraform-provider-azurekvca"
page_title: "azurekvca_request Resource - azurekvca"
subcategory: ""
description: |-
Mangle a CSR to add fields that aren't supported by Azure (URI SANs)
---

# azurekvca_request (Resource)
Expand All @@ -17,28 +17,20 @@ Mangle a CSR to add fields that aren't supported by Azure (URI SANs)

### Required

- `csr_pem_in` (String)
Input CSR in PEM format
- `names` (Attributes) (see [below for nested schema](#nestedatt--names))
SAN values to add
- `vault_url` (String)
URL of Azure Key Vault
- `csr_pem_in` (String) Input CSR in PEM format
- `names` (Attributes) SAN values to set (see [below for nested schema](#nestedatt--names))
- `vault_url` (String) URL of Azure Key Vault

### Read-Only

- `csr_pem_out` (String)
Resulting CSR ready for signing (Will be missing a signature)
- `csr_pem_out` (String) Resulting CSR ready for signing (Will be missing a signature)

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

Optional:

- `dns` (List of String)
List of DNS names to add to SAN
- `email` (List of String)
List of email address to add to SAN
- `ip` (List of String)
List of IPs to add to SAN
- `uri` (List of String)
List of URIs to add to SAN
- `dns` (List of String) List of DNS names to add to SAN
- `email` (List of String) List of email address to add to SAN
- `ip` (List of String) List of IPs to add to SAN
- `uri` (List of String) List of URIs to add to SAN
25 changes: 8 additions & 17 deletions docs/resources/sign.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "azurekvca_sign Resource - terraform-provider-azurekvca"
page_title: "azurekvca_sign Resource - azurekvca"
subcategory: ""
description: |-
Sign a CSR using a CA certificate in Key Vault. This can be done with CAs with non exportable keys
---

# azurekvca_sign (Resource)
Expand All @@ -17,21 +17,12 @@ Sign a CSR using a CA certificate in Key Vault. This can be done with CAs with n

### Required

- `ca_name` (String)
Name of cert to use as the CA
- `csr_pem` (String)
Input CSR in PEM format
- `signature_algorithm` (String)
Algorithm to use when signing the cert
If the CA cert has a RSA key use one of
RS256, RS384, RS512
If the CA cert has an EC key use one of
ES256, ES384, ES512
- `validity_days` (Number)
Number of days to make cert valid for
- `vault_url` (String)
URL of Azure Key Vault
- `ca_name` (String) Name of cert to use as the CA
- `csr_pem` (String) Input CSR in PEM format
- `signature_algorithm` (String) Algorithm to use when signing the certIf the CA cert has a RSA key use one ofRS256, RS384, RS512If the CA cert has an EC key use one ofES256, ES384, ES512
- `validity_days` (Number) Number of days to make cert valid for
- `vault_url` (String) URL of Azure Key Vault

### Read-Only

- `signed_cert_pem` (String)
- `signed_cert_pem` (String) Resulting signed cert in PEM format
28 changes: 19 additions & 9 deletions internal/provider/create_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,41 +52,51 @@ func (r *createResource) Metadata(_ context.Context, req resource.MetadataReques
// Schema defines the schema for the resource.
func (r *createResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "Create a new certificate version and if needed cert ready for signing",
Attributes: map[string]schema.Attribute{
"csr_pem": schema.StringAttribute{
Computed: true,
MarkdownDescription: "Resulting CSR in PEM format",
Computed: true,
},
"key": schema.SingleNestedAttribute{
Required: true,
MarkdownDescription: "Private key attributes",
Required: true,
Attributes: map[string]schema.Attribute{
"curve": schema.StringAttribute{
Optional: true,
MarkdownDescription: "One of (P-256, P-384, P-521) Required if key type is EC or EC-HSM",
Optional: true,
},
"exportable": schema.BoolAttribute{
Required: true,
MarkdownDescription: "Is key able to be exported. Not supported if -HSM key type is used",
Required: true,
},
"key_size": schema.Int64Attribute{
Optional: true,
MarkdownDescription: "Size of key in bits. Required if key type is RSA or RSA-HSM",
Optional: true,
},
"key_type": schema.StringAttribute{
Required: true,
MarkdownDescription: "Type of key to create (RSA, RSA-HSM, EC, EC-HSM)",
Required: true,
},
"reuse_key": schema.BoolAttribute{
Required: true,
MarkdownDescription: "Should private key be reused on subsequent versions",
Required: true,
},
},
PlanModifiers: []planmodifier.Object{
objectplanmodifier.RequiresReplace(),
},
},
"name": schema.StringAttribute{
Required: true,
MarkdownDescription: "Name of cert to create",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
"vault_url": schema.StringAttribute{
Required: true,
MarkdownDescription: "URL of Azure Key Vault",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
Expand Down
10 changes: 7 additions & 3 deletions internal/provider/merge_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,25 @@ func (r *mergeResource) Metadata(_ context.Context, req resource.MetadataRequest
// Schema defines the schema for the resource.
func (r *mergeResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "Complete a certificate operation by merging the signed certificate with pending version",
Attributes: map[string]schema.Attribute{
"cert_pem": schema.StringAttribute{
Required: true,
MarkdownDescription: "Cert to merge in PEM format",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
"name": schema.StringAttribute{
Required: true,
MarkdownDescription: "Name of pending cert",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
"vault_url": schema.StringAttribute{
Required: true,
MarkdownDescription: "URL of Azure Key Vault",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
Expand Down
39 changes: 24 additions & 15 deletions internal/provider/request_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type requestResource struct {
}

type requestNames struct {
Email []types.String `tfsdk:"email"`
DNS []types.String `tfsdk:"dns"`
Email []types.String `tfsdk:"email"`
IP []types.String `tfsdk:"ip"`
URI []types.String `tfsdk:"uri"`
}
Expand All @@ -54,42 +54,51 @@ func (r *requestResource) Metadata(_ context.Context, req resource.MetadataReque
// Schema defines the schema for the resource.
func (r *requestResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "Mangle a CSR to add fields that aren't supported by Azure (URI SANs)",
Attributes: map[string]schema.Attribute{
"csr_pem_in": schema.StringAttribute{
Required: true,
MarkdownDescription: "Input CSR in PEM format",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
"csr_pem_out": schema.StringAttribute{
Computed: true,
MarkdownDescription: "Resulting CSR ready for signing (Will be missing a signature)",
Computed: true,
},
"names": schema.SingleNestedAttribute{
Required: true,
MarkdownDescription: "SAN values to set",
Required: true,
Attributes: map[string]schema.Attribute{
"email": schema.ListAttribute{
ElementType: types.StringType,
Optional: true,
},
"dns": schema.ListAttribute{
ElementType: types.StringType,
Optional: true,
MarkdownDescription: "List of DNS names to add to SAN",
ElementType: types.StringType,
Optional: true,
},
"email": schema.ListAttribute{
MarkdownDescription: "List of email address to add to SAN",
ElementType: types.StringType,
Optional: true,
},
"ip": schema.ListAttribute{
ElementType: types.StringType,
Optional: true,
MarkdownDescription: "List of IPs to add to SAN",
ElementType: types.StringType,
Optional: true,
},
"uri": schema.ListAttribute{
ElementType: types.StringType,
Optional: true,
MarkdownDescription: "List of URIs to add to SAN",
ElementType: types.StringType,
Optional: true,
},
},
PlanModifiers: []planmodifier.Object{
objectplanmodifier.RequiresReplace(),
},
},
"vault_url": schema.StringAttribute{
Required: true,
MarkdownDescription: "URL of Azure Key Vault",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
Expand Down
Loading

0 comments on commit d9079e6

Please sign in to comment.