PRO: Domains #
All features described on this page are part of the Professional Edition.
While in beta, you can enable the Professional Edition by creating an account and downloading a license from https://portal.sqldsc.com.
The PRO edition will become a paid version. Until then, PRO features expire 60 days after the build date. Please see https://www.scalesql.com for updated builds or run
Handling Domains #
SQLDSC supports configuring machines in diffrent domains. This is done by filtering machines based on domain and assiging different defaults based on the domain. These are handled very differently. Pleaes read carefully.
Domain Targets #
The PRO version can use domain specific target files. If you do nothing different, it will continue to use
You can create domain specific target files. For example,
DOMAIN1.targets.hclfor domain1 (it’s not case-sensitive)
By default, the PRO version will run for the domain specified in the
USERDOMAIN environment variable. This variable is automaticallly set by Windows for all domain joined computers. SQLDSC will search for a target file for that domain. If it doesn’t find one it will fall back to
targets.hcl. If you’re using domain specific target files, you should probably delete
targets.hcl or leave it empty.
To run for a differnt domain than the current one, specify a domain using the the
--domain parameter. This parameter only applies to the
apply commands. For example,
sqldsc test --domain other-domain --verbose
This will process the targets listed in
targets.hcl if that file isn’t found). Processing for a separate domain is often used to handle multiple domains where a trust relationship and connectivity are available.
In summary, the domain of the machine where SQLDSC is run detrmines which target file is used by default.
Domain Defaults #
The PRO version also support domain specific defaults. After processing
defaults.hcl, it will look for domain specific defaults.
The order of default files processed is
- All tag files in order (see Tags)
Remember that later processed files override values in earlier files.
Note: The domain of the target itself is used to determine the domain default file and locate the nodes file. This may be different than the domain specified on the command line or the target file used.
- The domain targets aren’t strict. You could put reachable targets in DOMAIN_ONE.defaults.hcl that aren’t actually in the domain. When getting the configuration files, it looks at the server’s domain (using
USER_DOMAIN()) to determine which domain default file to use. Be very careful crossing domain lines.