Require provider api_key and remove env var fallback

This commit is contained in:
beatz174-bit
2026-05-04 01:21:53 +10:00
parent 2b0c058664
commit a317b5f0ce
13 changed files with 22 additions and 30 deletions
+2 -4
View File
@@ -20,9 +20,7 @@ This example performs full live validation of the Dynu provider lifecycle by cre
## Prerequisites
- A local build of this provider with Terraform `dev_overrides` for `dynu/dynu`.
- Dynu API key provided either by:
- environment variable `DYNU_API_KEY`, or
- Terraform variable `dynu_api_key`.
- Dynu API key provided as Terraform variable `dynu_api_key` (for example via `terraform.tfvars`).
- A disposable domain value for `test_domain`.
## Required variables
@@ -31,7 +29,7 @@ Create `terraform.tfvars` in this folder:
```hcl
test_domain = "my-disposable-test-domain.example"
# dynu_api_key = "..." # optional if DYNU_API_KEY is exported
dynu_api_key = "..."
```
## Commands
@@ -1,5 +1,5 @@
variable "dynu_api_key" {
description = "Dynu API key. Leave null to use DYNU_API_KEY from environment."
description = "Dynu API key used by the provider. Set in terraform.tfvars."
type = string
default = null
sensitive = true
+1 -1
View File
@@ -18,7 +18,7 @@ Using a single suffix (`test_suffix`), this example creates five DNS record scen
## Prerequisites
- Local provider binary + Terraform `dev_overrides` for `dynu/dynu`
- `DYNU_API_KEY` exported, or `dynu_api_key` set in `terraform.tfvars`
- `dynu_api_key` set in `terraform.tfvars`
- A Dynu-managed root domain you control
## Configure
@@ -1,5 +1,4 @@
# Optional if DYNU_API_KEY is exported in your shell.
# dynu_api_key = "REPLACE_ME"
dynu_api_key = "REPLACE_ME"
# Required: a Dynu-managed root domain/zone that you control.
# Do NOT put an existing production hostname here.
+1 -1
View File
@@ -1,5 +1,5 @@
variable "dynu_api_key" {
description = "Dynu API key. Leave null to use DYNU_API_KEY from environment."
description = "Dynu API key used by the provider. Set in terraform.tfvars."
type = string
default = null
sensitive = true
+1 -1
View File
@@ -7,7 +7,7 @@ terraform {
}
provider "dynu" {
# api_key can be omitted when DYNU_API_KEY is set.
# Set var.dynu_api_key in terraform.tfvars.
api_key = var.dynu_api_key
}
+1 -2
View File
@@ -12,7 +12,6 @@ terraform {
# This source address stays "dynu/dynu" while using ~/.terraformrc dev_overrides.
# Terraform will load your local terraform-provider-dynu binary instead of the public registry.
provider "dynu" {
# Use DYNU_API_KEY environment variable by default.
# Set var.dynu_api_key in terraform.tfvars to override.
# Set var.dynu_api_key in terraform.tfvars.
api_key = var.dynu_api_key
}
+1 -2
View File
@@ -1,6 +1,5 @@
# Copy to terraform.tfvars and adjust values for your environment.
# dynu_api_key can be omitted when DYNU_API_KEY is exported in your shell.
# dynu_api_key = "replace-with-dynu-api-key"
dynu_api_key = "replace-with-dynu-api-key"
# Use a hostname that exists in your Dynu account.
hostname = "www.example.com"
+1 -1
View File
@@ -1,5 +1,5 @@
variable "dynu_api_key" {
description = "Dynu API key. Leave null to use DYNU_API_KEY from environment."
description = "Dynu API key used by the provider. Set in terraform.tfvars."
type = string
default = null
sensitive = true