DNS - Wildcard

Reference for the humanitec/dns-wildcard driver

This driver generates a new subdomain for a domain. It is intended for used with a wildcard DNS record.

Property

Description

Resource Type

​dns​

Account Type

local

Inputs

Values

Name

Type

Description

domain

string

The domain under which to specify the subdomain. E.g. staging.example.com

Secrets

Name

Type

Description

tls

object

A TLS certificate in Kubernetes certificate format. E.g. {"tls.crt": "...", "tls.key": "..."}

The TLS certificate must be a wildcard certificate valid for subdomains of the domain value. E.g. for staging.example.com, the certificate must include *.staging.example.com as an CN or SAN.

Notes

There must be a wildcard DNS Record configured for the domain name specified in domain. The record should point to the appropriate Load Balancer.

Example

In this example, we use the humantec/dns-wildcard driver to provision new subdomains under staging.hosted-domain.com for an app called dns-example-app.

Then following Dynamic Resource Definition should be added:

curl https://api.humanitec.io/orgs/my-org/resources/dynamic \
-X POST \
-H "Authorization: Bearer $HUMANITEC_TOKEN" \
-H "Content-Type: application/json" \
--data-binary '{
"id": "dynamic-dns",
"name": "Dynamic DNS",
"type": "dns",
"criteria": [
{
"app_id": "dns-example-app"
}
],
"account_id": "local",
"driver_type": "humanitec/dns-wildcard",
"driver_params": {
"values": {
"domain": "staging.hosted-domain.com"
},
"secrets": {
"tls": {
"tls.crt": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n",
"tls.key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
}
}
}
}'

​