ServiceArgs

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const project = new gcp.projects.Service("project", {
project: "your-project-id",
service: "iam.googleapis.com",
disableOnDestroy: false,
});
import pulumi
import pulumi_gcp as gcp
project = gcp.projects.Service("project",
project="your-project-id",
service="iam.googleapis.com",
disable_on_destroy=False)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var project = new Gcp.Projects.Service("project", new()
{
Project = "your-project-id",
ServiceName = "iam.googleapis.com",
DisableOnDestroy = false,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := projects.NewService(ctx, "project", &projects.ServiceArgs{
Project: pulumi.String("your-project-id"),
Service: pulumi.String("iam.googleapis.com"),
DisableOnDestroy: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
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()
.project("your-project-id")
.service("iam.googleapis.com")
.disableOnDestroy(false)
.build());
}
}
resources:
project:
type: gcp:projects:Service
properties:
project: your-project-id
service: iam.googleapis.com
disableOnDestroy: false

Import

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

  • {{project_id}}/{{service}} When using the pulumi import command, project services can be imported using one of the formats above. For example:

$ pulumi import gcp:projects/service:Service default {{project_id}}/{{service}}

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(checkIfServiceHasUsageOnDestroy: Output<Boolean>? = null, disableDependentServices: Output<Boolean>? = null, disableOnDestroy: Output<Boolean>? = null, project: Output<String>? = null, service: Output<String>? = null)

Properties

Link copied to clipboard

Beta If true, the usage of the service to be disabled will be checked and an error will be returned if the service to be disabled has usage in last 30 days. Defaults to false.

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
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