feat(dns): add dnsimple to terraform configuration

This commit is contained in:
Maxine Aubrey 2024-09-23 19:24:30 +02:00
parent 94d1881e10
commit e3b6cb72b4
Signed by untrusted user: amaxine
GPG key ID: F6FE033DFCB899F7
3 changed files with 51 additions and 0 deletions

View file

@ -63,6 +63,7 @@
modules = [
./terraform
{
bagel.dnsimple.enable = true;
bagel.gandi.enable = true;
bagel.hydra.enable = true;
}

View file

@ -2,6 +2,7 @@
imports = [
./common.nix
./gandi.nix
./dnsimple.nix
./hydra.nix
./state.nix
];

49
terraform/dnsimple.nix Normal file
View file

@ -0,0 +1,49 @@
{ lib, config, ... }:
let
inherit (lib) mkEnableOption mkIf tf genList;
cfg = config.bagel.dnsimple;
in
{
options.bagel.dnsimple = {
enable = mkEnableOption "the DNSimple configuration";
};
config = mkIf cfg.enable {
terraform.required_providers.dnsimple = {
version = "~> 1.7.0";
source = "dnsimple/dnsimple";
};
resource.secret_resource.dnsimple_token.lifecycle.prevent_destroy = true;
resource.secret_resource.dnsimple_account.lifecycle.prevent_destroy = true;
provider.dnsimple = {
token = tf.ref "resource.secret_resource.dnsimple_token.value";
account = tf.ref "resource.secret_resource.dnsimple_account.value";
};
resource.dnsimple_zone.forkos_org = {
name = "forkos.org";
};
resource.dnsimple_zone.fleurixos_org = {
name = "fleurixos.org";
};
resource.dnsimple_zone.floral_systems = {
name = "floral.systems";
};
resource.dnsimple_zone.flowery_systems = {
name = "flowery.systems";
};
resource.dnsimple_zone.petalpkgs_org = {
name = "petalpkgs.org";
};
resource.dnsimple_zone.vzfdfp_de = {
name = "vzfdfp.de";
};
};
}