Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.projects.getProjectService
Explore with Pulumi AI
Verify the API service for the Google Cloud Platform project to see if it is enabled or not.
For a list of services available, visit the API library page
or run gcloud services list --available
.
This datasource requires the Service Usage API to use.
To get more information about gcp.projects.Service
, see:
- API documentation
- How-to Guides
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const my-project-service = gcp.projects.getProjectService({
service: "my-project-service",
});
import pulumi
import pulumi_gcp as gcp
my_project_service = gcp.projects.get_project_service(service="my-project-service")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := projects.GetProjectService(ctx, &projects.GetProjectServiceArgs{
Service: "my-project-service",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var my_project_service = Gcp.Projects.GetProjectService.Invoke(new()
{
Service = "my-project-service",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.ProjectsFunctions;
import com.pulumi.gcp.projects.inputs.GetProjectServiceArgs;
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 my-project-service = ProjectsFunctions.getProjectService(GetProjectServiceArgs.builder()
.service("my-project-service")
.build());
}
}
variables:
my-project-service:
fn::invoke:
Function: gcp:projects:getProjectService
Arguments:
service: my-project-service
Using getProjectService
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getProjectService(args: GetProjectServiceArgs, opts?: InvokeOptions): Promise<GetProjectServiceResult>
function getProjectServiceOutput(args: GetProjectServiceOutputArgs, opts?: InvokeOptions): Output<GetProjectServiceResult>
def get_project_service(project: Optional[str] = None,
service: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectServiceResult
def get_project_service_output(project: Optional[pulumi.Input[str]] = None,
service: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectServiceResult]
func GetProjectService(ctx *Context, args *GetProjectServiceArgs, opts ...InvokeOption) (*GetProjectServiceResult, error)
func GetProjectServiceOutput(ctx *Context, args *GetProjectServiceOutputArgs, opts ...InvokeOption) GetProjectServiceResultOutput
> Note: This function is named GetProjectService
in the Go SDK.
public static class GetProjectService
{
public static Task<GetProjectServiceResult> InvokeAsync(GetProjectServiceArgs args, InvokeOptions? opts = null)
public static Output<GetProjectServiceResult> Invoke(GetProjectServiceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetProjectServiceResult> getProjectService(GetProjectServiceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:projects/getProjectService:getProjectService
arguments:
# arguments dictionary
The following arguments are supported:
getProjectService Result
The following output properties are available:
- Check
If boolService Has Usage On Destroy - Disable
Dependent boolServices - Disable
On boolDestroy - Id string
- The provider-assigned unique ID for this managed resource.
- Service string
- Project string
- Check
If boolService Has Usage On Destroy - Disable
Dependent boolServices - Disable
On boolDestroy - Id string
- The provider-assigned unique ID for this managed resource.
- Service string
- Project string
- check
If BooleanService Has Usage On Destroy - disable
Dependent BooleanServices - disable
On BooleanDestroy - id String
- The provider-assigned unique ID for this managed resource.
- service String
- project String
- check
If booleanService Has Usage On Destroy - disable
Dependent booleanServices - disable
On booleanDestroy - id string
- The provider-assigned unique ID for this managed resource.
- service string
- project string
- check_
if_ boolservice_ has_ usage_ on_ destroy - disable_
dependent_ boolservices - disable_
on_ booldestroy - id str
- The provider-assigned unique ID for this managed resource.
- service str
- project str
- check
If BooleanService Has Usage On Destroy - disable
Dependent BooleanServices - disable
On BooleanDestroy - id String
- The provider-assigned unique ID for this managed resource.
- service String
- project String
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.