Service Args
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>
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,
});Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
project = gcp.projects.Service("project",
project="your-project-id",
service="iam.googleapis.com",
disable_on_destroy=False)Content copied to clipboard
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,
});
});Content copied to clipboard
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
})
}Content copied to clipboard
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());
}
}Content copied to clipboard
resources:
project:
type: gcp:projects:Service
properties:
project: your-project-id
service: iam.googleapis.com
disableOnDestroy: falseContent copied to clipboard
Import
Project services can be imported using the project_id and service, e.g.
{{project_id}}/{{service}}When using thepulumi importcommand, project services can be imported using one of the formats above. For example:
$ pulumi import gcp:projects/service:Service default {{project_id}}/{{service}}Content copied to clipboard
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.