TERRANIX-MODULES(5)

πŸ“¦
version 2.9.0 Β· 2 versions
, in nixpkgs unstable

🌸 terranix-modules(5) 🌸

okay so this page is from the terranix reference pages, and honestly? it's the whole entire menu of modules terranix gives you out of the box. πŸ’…


✨ NAME ✨

terranix-modules β€” terranix configuration options πŸŽ€


πŸ’– DESCRIPTION πŸ’–

These are the modules you can literally use in your config.nix β€” terranix ships them by default, no cap. 🫢


🌈 OPTIONS 🌈

bestie, here's everything you can drop into config.nix:

  • _module.args β€” extra arguments passed to every module, on top of the usual suspects like lib, config, pkgs and modulesPath. This option is also available to all submodules. ✨ But heads up: submodules do not inherit args from their parent module, and they don't hand args up to their parent module or over to sibling submodules. The one sole exception? The argument name, which parent modules give to a submodule β€” it holds the attribute name the submodule is bound to, or a unique generated name if it's not bound to an attribute at all. Some arguments are already passed by default, and the following ones cannot be changed with this option:
    • lib: the nixpkgs library πŸ“š
    • config: the results of all options after merging the values from all modules together
    • options: the options declared in all modules
    • specialArgs: the specialArgs argument passed to evalModules
    • all attributes of specialArgs

So like, option values can generally depend on other option values thanks to laziness β€” but that does not apply to imports, which must be computed statically before anything else. Because of that, callers of the module system can provide specialArgs which are available during import resolution. πŸ¦‹ For NixOS, specialArgs includes modulesPath, which lets you import extra modules from the nixpkgs package tree without having to somehow make the module aware of where the nixpkgs or NixOS directories live. Obsessed:

{ modulesPath, ... }: {
  imports = [ (modulesPath + "/profiles/minimal.nix") ];
}

And for NixOS, the default value for this option includes at least this argument:

  • pkgs: the nixpkgs package set according to the nixpkgs.pkgs option.
  • Type: lazy attribute set of raw value
  • Default: { }
  • Declared by: <terranix/lib/modules.nix>
  • backend.etcd β€” the etcd backend, periodt. https://www.terraform.io/docs/backends/types/etcd.html
    • Type: null or (submodule)
    • Default: null
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.etcd.endpoints β€” a space-separated list of the etcd endpoints 🌸
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.etcd.password β€” the password πŸ”
    • Type: null or string
    • Default: null
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.etcd.path β€” the path where to store the state πŸ—‚οΈ
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.etcd.username β€” the username
    • Type: null or string
    • Default: null
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.local β€” the local backend, right there on your machine. https://www.terraform.io/docs/backends/types/local.html
    • Type: null or (submodule)
    • Default: null
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.local.path β€” path to the state file πŸ’Ύ
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.s3 β€” the s3 backend, cloud girlie behaviour. https://www.terraform.io/docs/backends/types/s3.html
    • Type: null or (submodule)
    • Default: null
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.s3.bucket β€” bucket name πŸͺ£
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.s3.key β€” path to the state file in the bucket
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • backend.s3.region β€” region of the bucket 🌍
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • data β€” Data objects! These are queries you use on resources that already exist, as if they were created by the resource option. More deets here: https://www.terraform.io/docs/configuration/data-sources.html πŸ”
    • Type: bool, int, float or str
    • Default: { }
    • Example: { }
  • ephemeral β€” Ephemeral objects are a temporary resource β€” they are not stored, so don't get attached lol. More deets: https://developer.hashicorp.com/terraform/language/resources/ephemeral πŸ’€
    • Type: bool, int, float or str
    • Default: { }
    • Example: { }
  • import β€” define a terraform import, iconic. More deets: https://developer.hashicorp.com/terraform/language/import πŸ“₯
    • Type: bool, int, float or str
    • Default: { }
    • Example:
{
  import = [
    {
      id = "i-abcd1234";
      to = "aws_instance.example";
    }
  ];
}
{
  locals = {
    owner = "Community Team";
    service_name = "forum";
  };
}
  • module β€” a terraform module, for defining multiple resources so you can share or duplicate them. This is the terraform module system and it has nothing to do with the module system of terranix or nixos, okay bestie don't mix them up 😭. More deets: https://www.terraform.io/docs/configuration/modules.html
    • Type: bool, int, float or str
    • Default: { }
    • Example:
{
  module = {
    consul = {
      source = "github.com/hashicorp/example";
    };
  };
}
{
  moved = [
    {
      from = "aws_instance.example";
      to = "aws_instance.other_example";
    }
  ];
}
{
  output = {
    instance_ip_addr = {
      value = "aws_instance.server.private_ip";
    };
  };
}
{
  provider = {
    google = {
      project = "acme-app";
      region = "us-central1";
    };
  };
}
  • provisioner.privateKeyFile β€” the PrivateKey for provisioning via ssh access, see https://www.terraform.io/docs/provisioners/connection.html. This one's an agnostic option β€” option-authors should use it to implement server provisioning. πŸ”‘
    • Type: string
    • Example: "~/.ssh/id_rsa"
    • Declared by: <terranix/modules/provisioner.nix>
  • remote_state.etcd β€” etcd remote state, slay. https://www.terraform.io/docs/backends/types/etcd.html
    • Type: attribute set of (submodule)
    • Default: { }
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.etcd.<name>.endpoints β€” a space-separated list of the etcd endpoints 🌸
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.etcd.<name>.password β€” the password πŸ”
    • Type: null or string
    • Default: null
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.etcd.<name>.path β€” the path where to store the state πŸ—‚οΈ
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.etcd.<name>.username β€” the username
    • Type: null or string
    • Default: null
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.local β€” local remote state (yes, the naming is a vibe, just go with it). https://www.terraform.io/docs/backends/types/local.html
    • Type: attribute set of (submodule)
    • Default: { }
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.local.<name>.path β€” path to the state file πŸ’Ύ
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.s3 β€” s3 remote state, cloud storage bestie. https://www.terraform.io/docs/backends/types/s3.html
    • Type: attribute set of (submodule)
    • Default: { }
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.s3.<name>.bucket β€” bucket name πŸͺ£
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.s3.<name>.key β€” path to the state file in the bucket
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • remote_state.s3.<name>.region β€” region of the bucket 🌍
    • Type: string
    • Declared by: <terranix/modules/terraform/backends.nix>
  • removed β€” bestie, this is how you define a removed resource. More deets right here: https://developer.hashicorp.com/terraform/language/state/remove

Type: bool, int, float or str

Default: { }

Example:

{
  removed = [
    {
      from = "aws_instance.example";
      lifecycle = {
        destroy = false;
      };
    }
  ];
}

Type: bool, int, float or str

Default: { }

Example:

{
  resource = {
    aws_instance = {
      web = {
        ami = "ami-a1b2c3d4";
        instance_type = "t2.micro";
      };
    };
  };
}

Type: bool, int, float or str

Default: { }

Example:

{
  terraform = {
    backend = {
      s3 = {
        bucket = "mybucket";
        key = "path/to/my/key";
        region = "us-east-1";
      };
    };
  };
}
  • users β€” user management central. The path is users.group.username. All members in the admins group should be able to ssh to servers. This is an agnostic option, so option-authors should use this options to implement server provisioning. πŸ‘‘

Type: attribute set of attribute set of (submodule)

Default: { }

Example:

{
  admins = {
    lassuls = {
      publicKey = "ssh-rsa ABKAB3NzaC1yc2EAAAA..";
    };
    mrVanDalo = {
      publicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAA..";
    };
  };
}

Declared by: <terranix/modules/users.nix>

  • users.<name>.<name>.publicKey β€” the ssh public key of the user, no cap. πŸ”‘

Type: null or string

Default: null

Example: "\${ file( ~/.ssh/id_rsa.pub ) }"

Declared by: <terranix/modules/users.nix>

Type: bool, int, float or str

Default: { }

Example:

{
  variable = {
    image_id = {
      description = "The id of the machine image (AMI) to use for the server.";
      type = "string";
    };
  };
}

πŸ”­ SEE ALSO

✍️ AUTHOR

  • Ingolf Wagner β€” Author.

Copyright Β© 2019–2022 Ingolf Wagner


and that's the page, bestie πŸ’…βœ¨ β€” source/version terranix module documentation, date 01/01/1980, section TERRANIX-MODULES(5). periodt 🫢

πŸ“¦ where this page comes from