Archived
Require provider api_key and remove env var fallback
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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,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,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
|
||||
|
||||
Reference in New Issue
Block a user