get Projects
Retrieve information about all DigitalOcean projects associated with an account, with the ability to filter and sort the results. If no filters are specified, all projects will be returned. Note: You can use the digitalocean.Project
data source to obtain metadata about a single project if you already know the id
to retrieve or the unique name
of the project.
Example Usage
Use the filter
block with a key
string and values
list to filter projects. For example to find all staging environment projects:
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.GetProjectsArgs;
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 staging = DigitaloceanFunctions.getProjects(GetProjectsArgs.builder()
.filters(GetProjectsFilterArgs.builder()
.key("environment")
.values("Staging")
.build())
.build());
}
}
Return
A collection of values returned by getProjects.
Parameters
A collection of arguments for invoking getProjects.
Return
A collection of values returned by getProjects.
See also
Parameters
Filter the results. The filter
block is documented below.
Sort the results. The sort
block is documented below.
Return
A collection of values returned by getProjects.
See also
Parameters
Builder for com.pulumi.digitalocean.kotlin.inputs.GetProjectsPlainArgs.