getDomains

Get information on domains for use in other resources, with the ability to filter and sort the results. If no filters are specified, all domains will be returned. This data source is useful if the domains in question are not managed by this provider or you need to utilize any of the domains' data. Note: You can use the digitalocean.Domain data source to obtain metadata about a single domain if you already know the name.

Example Usage

Use the filter block with a key string and values list to filter domains. (This example also uses the regular expression match_by mode in order to match domains by suffix.)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetDomainsArgs;
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) {
final var examples = DigitaloceanFunctions.getDomains(GetDomainsArgs.builder()
.filters(GetDomainsFilterArgs.builder()
.key("name")
.matchBy("re")
.values("example\\.com$")
.build())
.build());
}
}

Return

A collection of values returned by getDomains.

Parameters

argument

A collection of arguments for invoking getDomains.


suspend fun getDomains(filters: List<GetDomainsFilter>? = null, sorts: List<GetDomainsSort>? = null): GetDomainsResult

Return

A collection of values returned by getDomains.

See also

Parameters

filters

Filter the results. The filter block is documented below.

sorts

Sort the results. The sort block is documented below.


suspend fun getDomains(argument: suspend GetDomainsPlainArgsBuilder.() -> Unit): GetDomainsResult

Return

A collection of values returned by getDomains.

See also

Parameters

argument

Builder for com.pulumi.digitalocean.kotlin.inputs.GetDomainsPlainArgs.