Powerdns Provider
Generate Provider
The Powerdns provider must be installed as a Local Package by following the instructions for Any Terraform Provider:
pulumi package add terraform-provider pan-net/powerdns
Overview
The PowerDNS provider is used manipulate DNS records supported by PowerDNS server. The provider needs to be configured with the proper credentials before it can be used. It supports both the legacy API and the new version 1 API, however resources may need to be configured differently.
NOTE: if you’re using the sqlite3 PowerDNS backend, you might face a problem (as described in #75) with pulumi’s
default behavior to run mulitple operations in parallel. Using -parallelism=1
can help solve the limitations of
the sqlite3 PowerDNS Backend. The MySQL Backend has been verified to work with parallelism, however.
Use the navigation to the left to read about the available resources.
Example Usage
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: nodejs
config:
powerdns:apiKey:
value: 'TODO: "${var.pdns_api_key}"'
powerdns:serverUrl:
value: 'TODO: "${var.pdns_server_url}"'
import * as pulumi from "@pulumi/pulumi";
import * as powerdns from "@pulumi/powerdns";
// Create a record
const www = new powerdns.Record("www", {});
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: python
config:
powerdns:apiKey:
value: 'TODO: "${var.pdns_api_key}"'
powerdns:serverUrl:
value: 'TODO: "${var.pdns_server_url}"'
import pulumi
import pulumi_powerdns as powerdns
# Create a record
www = powerdns.Record("www")
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: dotnet
config:
powerdns:apiKey:
value: 'TODO: "${var.pdns_api_key}"'
powerdns:serverUrl:
value: 'TODO: "${var.pdns_server_url}"'
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Powerdns = Pulumi.Powerdns;
return await Deployment.RunAsync(() =>
{
// Create a record
var www = new Powerdns.Record("www");
});
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: go
config:
powerdns:apiKey:
value: 'TODO: "${var.pdns_api_key}"'
powerdns:serverUrl:
value: 'TODO: "${var.pdns_server_url}"'
package main
import (
"github.com/pulumi/pulumi-pulumi-provider/sdks/go/powerdns/powerdns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a record
_, err := powerdns.NewRecord(ctx, "www", nil)
if err != nil {
return err
}
return nil
})
}
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: yaml
config:
powerdns:apiKey:
value: 'TODO: "${var.pdns_api_key}"'
powerdns:serverUrl:
value: 'TODO: "${var.pdns_server_url}"'
resources:
# Create a record
www:
type: powerdns:Record
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: java
config:
powerdns:apiKey:
value: 'TODO: "${var.pdns_api_key}"'
powerdns:serverUrl:
value: 'TODO: "${var.pdns_server_url}"'
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.powerdns.Record;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Create a record
var www = new Record("www");
}
}
Configuration Reference
The following configuration inputs are supported:
apiKey
- (Required) The PowerDNS API key. This can also be specified withPDNS_API_KEY
environment variable.serverUrl
- (Required) The address of PowerDNS server. This can also be specified withPDNS_SERVER_URL
environment variable. When no schema is provided, the default ishttps
.caCertificate
- (Optional) A valid path of a Root CA Certificate in PEM format or the content of a Root CA certificate in PEM format. This can also be specified withPDNS_CACERT
environment variable.insecureHttps
- (Optional) Set this totrue
to disable verification of the PowerDNS server’s TLS certificate. This can also be specified with thePDNS_INSECURE_HTTPS
environment variable.cacheRequests
- (Optional) Set this totrue
to enable cache of the PowerDNS REST API requests. This can also be specified with thePDNS_CACHE_REQUESTS
environment variable.WARNING! Enabling this option can lead to the use of stale records when you use other automation to populate the DNS zone records at the same time.
cacheMemSize
- (Optional) Memory size in MB for a cache of the PowerDNS REST API requests. This can also be specified with thePDNS_CACHE_MEM_SIZE
environment variable.cacheTtl
- (Optional) TTL in seconds for a cache of the PowerDNS REST API requests. This can also be specified with thePDNS_CACHE_TTL
environment variable.