ServiceArgs

data class ServiceArgs(val disableDependentServices: Output<Boolean>? = null, val disableOnDestroy: Output<Boolean>? = null, val project: Output<String>? = null, val service: Output<String>? = null) : ConvertibleToJava<ServiceArgs>

Allows management of a single API service for a Google Cloud Platform project. For a list of services available, visit the API library page or run gcloud services list --available. This resource requires the Service Usage API to use. To get more information about gcp.projects.Service, see:

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
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) {
var project = new Service("project", ServiceArgs.builder()
.disableDependentServices(true)
.project("your-project-id")
.service("iam.googleapis.com")
.build());
}
}

Import

Project services can be imported using the project_id and service, e.g.

$ pulumi import gcp:projects/service:Service my_project your-project-id/iam.googleapis.com

Note that unlike other resources that fail if they already exist, pulumi up can be successfully used to verify already enabled services. This means that when importing existing resources into Terraform, you can either import the google_project_service resources or treat them as new infrastructure and run pulumi up to add them to state.

Constructors

Link copied to clipboard
constructor(disableDependentServices: Output<Boolean>? = null, disableOnDestroy: Output<Boolean>? = null, project: Output<String>? = null, service: Output<String>? = null)

Properties

Link copied to clipboard
val disableDependentServices: Output<Boolean>? = null

If true, services that are enabled and which depend on this service should also be disabled when this service is destroyed. If false or unset, an error will be generated if any enabled services depend on this service when destroying it.

Link copied to clipboard
val disableOnDestroy: Output<Boolean>? = null

If true, disable the service when the resource is destroyed. Defaults to true. May be useful in the event that a project is long-lived but the infrastructure running in that project changes frequently.

Link copied to clipboard
val project: Output<String>? = null

The project ID. If not provided, the provider project is used.

Link copied to clipboard
val service: Output<String>? = null

The service to enable.

Functions

Link copied to clipboard
open override fun toJava(): ServiceArgs