Google Cloud (GCP) Classic

v6.44.0 published on Tuesday, Nov 29, 2022 by Pulumi

getService

Get information about a Google Cloud Run Service. For more information see the official documentation and API.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var run_service = Gcp.CloudRun.GetService.Invoke(new()
    {
        Location = "us-central1",
        Name = "my-service",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/cloudrun"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err = cloudrun.LookupService(ctx, &cloudrun.LookupServiceArgs{
			Location: "us-central1",
			Name:     "my-service",
		}, nil)
		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.cloudrun.CloudrunFunctions;
import com.pulumi.gcp.cloudrun.inputs.GetServiceArgs;
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 run-service = CloudrunFunctions.getService(GetServiceArgs.builder()
            .location("us-central1")
            .name("my-service")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

run_service = gcp.cloudrun.get_service(location="us-central1",
    name="my-service")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const run_service = pulumi.output(gcp.cloudrun.getService({
    location: "us-central1",
    name: "my-service",
}));
variables:
  run-service:
    fn::invoke:
      Function: gcp:cloudrun:getService
      Arguments:
        location: us-central1
        name: my-service

Using getService

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 getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
def get_service(location: Optional[str] = None,
                name: Optional[str] = None,
                project: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetServiceResult
def get_service_output(location: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                project: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)
func LookupServiceOutput(ctx *Context, args *LookupServiceOutputArgs, opts ...InvokeOption) LookupServiceResultOutput

> Note: This function is named LookupService in the Go SDK.

public static class GetService 
{
    public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceResult> Invoke(GetServiceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gcp:cloudrun/getService:getService
  arguments:
    # arguments dictionary

The following arguments are supported:

Location string

The location of the cloud run instance. eg us-central1

Name string

The name of the Cloud Run Service.

Project string

The project in which the resource belongs. If it is not provided, the provider project is used.

Location string

The location of the cloud run instance. eg us-central1

Name string

The name of the Cloud Run Service.

Project string

The project in which the resource belongs. If it is not provided, the provider project is used.

location String

The location of the cloud run instance. eg us-central1

name String

The name of the Cloud Run Service.

project String

The project in which the resource belongs. If it is not provided, the provider project is used.

location string

The location of the cloud run instance. eg us-central1

name string

The name of the Cloud Run Service.

project string

The project in which the resource belongs. If it is not provided, the provider project is used.

location str

The location of the cloud run instance. eg us-central1

name str

The name of the Cloud Run Service.

project str

The project in which the resource belongs. If it is not provided, the provider project is used.

location String

The location of the cloud run instance. eg us-central1

name String

The name of the Cloud Run Service.

project String

The project in which the resource belongs. If it is not provided, the provider project is used.

getService Result

The following output properties are available:

Supporting Types

GetServiceMetadata

Annotations Dictionary<string, string>
Generation int
Labels Dictionary<string, string>
Namespace string
ResourceVersion string
SelfLink string
Uid string
Annotations map[string]string
Generation int
Labels map[string]string
Namespace string
ResourceVersion string
SelfLink string
Uid string
annotations Map<String,String>
generation Integer
labels Map<String,String>
namespace String
resourceVersion String
selfLink String
uid String
annotations {[key: string]: string}
generation number
labels {[key: string]: string}
namespace string
resourceVersion string
selfLink string
uid string
annotations Mapping[str, str]
generation int
labels Mapping[str, str]
namespace str
resource_version str
self_link str
uid str
annotations Map<String>
generation Number
labels Map<String>
namespace String
resourceVersion String
selfLink String
uid String

GetServiceStatus

GetServiceStatusCondition

Message string
Reason string
Status string
Type string
Message string
Reason string
Status string
Type string
message String
reason String
status String
type String
message string
reason string
status string
type string
message str
reason str
status str
type str
message String
reason String
status String
type String

GetServiceTemplate

GetServiceTemplateMetadata

Annotations Dictionary<string, string>
Generation int
Labels Dictionary<string, string>
Name string

The name of the Cloud Run Service.

Namespace string
ResourceVersion string
SelfLink string
Uid string
Annotations map[string]string
Generation int
Labels map[string]string
Name string

The name of the Cloud Run Service.

Namespace string
ResourceVersion string
SelfLink string
Uid string
annotations Map<String,String>
generation Integer
labels Map<String,String>
name String

The name of the Cloud Run Service.

namespace String
resourceVersion String
selfLink String
uid String
annotations {[key: string]: string}
generation number
labels {[key: string]: string}
name string

The name of the Cloud Run Service.

namespace string
resourceVersion string
selfLink string
uid string
annotations Mapping[str, str]
generation int
labels Mapping[str, str]
name str

The name of the Cloud Run Service.

namespace str
resource_version str
self_link str
uid str
annotations Map<String>
generation Number
labels Map<String>
name String

The name of the Cloud Run Service.

namespace String
resourceVersion String
selfLink String
uid String

GetServiceTemplateSpec

GetServiceTemplateSpecContainer

GetServiceTemplateSpecContainerEnv

Name string

The name of the Cloud Run Service.

Value string
ValueFroms List<GetServiceTemplateSpecContainerEnvValueFrom>
Name string

The name of the Cloud Run Service.

Value string
ValueFroms []GetServiceTemplateSpecContainerEnvValueFrom
name String

The name of the Cloud Run Service.

value String
valueFroms List<GetServiceTemplateSpecContainerEnvValueFrom>
name string

The name of the Cloud Run Service.

value string
valueFroms GetServiceTemplateSpecContainerEnvValueFrom[]
name String

The name of the Cloud Run Service.

value String
valueFroms List<Property Map>

GetServiceTemplateSpecContainerEnvFrom

GetServiceTemplateSpecContainerEnvFromConfigMapRef

GetServiceTemplateSpecContainerEnvFromConfigMapRefLocalObjectReference

Name string

The name of the Cloud Run Service.

Name string

The name of the Cloud Run Service.

name String

The name of the Cloud Run Service.

name string

The name of the Cloud Run Service.

name str

The name of the Cloud Run Service.

name String

The name of the Cloud Run Service.

GetServiceTemplateSpecContainerEnvFromSecretRef

GetServiceTemplateSpecContainerEnvFromSecretRefLocalObjectReference

Name string

The name of the Cloud Run Service.

Name string

The name of the Cloud Run Service.

name String

The name of the Cloud Run Service.

name string

The name of the Cloud Run Service.

name str

The name of the Cloud Run Service.

name String

The name of the Cloud Run Service.

GetServiceTemplateSpecContainerEnvValueFrom

GetServiceTemplateSpecContainerEnvValueFromSecretKeyRef

Key string
Name string

The name of the Cloud Run Service.

Key string
Name string

The name of the Cloud Run Service.

key String
name String

The name of the Cloud Run Service.

key string
name string

The name of the Cloud Run Service.

key str
name str

The name of the Cloud Run Service.

key String
name String

The name of the Cloud Run Service.

GetServiceTemplateSpecContainerLivenessProbe

GetServiceTemplateSpecContainerLivenessProbeGrpc

Port int
Service string
Port int
Service string
port Integer
service String
port number
service string
port int
service str
port Number
service String

GetServiceTemplateSpecContainerLivenessProbeHttpGet

GetServiceTemplateSpecContainerLivenessProbeHttpGetHttpHeader

Name string

The name of the Cloud Run Service.

Value string
Name string

The name of the Cloud Run Service.

Value string
name String

The name of the Cloud Run Service.

value String
name string

The name of the Cloud Run Service.

value string
name str

The name of the Cloud Run Service.

value str
name String

The name of the Cloud Run Service.

value String

GetServiceTemplateSpecContainerPort

ContainerPort int
Name string

The name of the Cloud Run Service.

Protocol string
ContainerPort int
Name string

The name of the Cloud Run Service.

Protocol string
containerPort Integer
name String

The name of the Cloud Run Service.

protocol String
containerPort number
name string

The name of the Cloud Run Service.

protocol string
container_port int
name str

The name of the Cloud Run Service.

protocol str
containerPort Number
name String

The name of the Cloud Run Service.

protocol String

GetServiceTemplateSpecContainerResource

Limits Dictionary<string, string>
Requests Dictionary<string, string>
Limits map[string]string
Requests map[string]string
limits Map<String,String>
requests Map<String,String>
limits {[key: string]: string}
requests {[key: string]: string}
limits Mapping[str, str]
requests Mapping[str, str]
limits Map<String>
requests Map<String>

GetServiceTemplateSpecContainerStartupProbe

GetServiceTemplateSpecContainerStartupProbeGrpc

Port int
Service string
Port int
Service string
port Integer
service String
port number
service string
port int
service str
port Number
service String

GetServiceTemplateSpecContainerStartupProbeHttpGet

GetServiceTemplateSpecContainerStartupProbeHttpGetHttpHeader

Name string

The name of the Cloud Run Service.

Value string
Name string

The name of the Cloud Run Service.

Value string
name String

The name of the Cloud Run Service.

value String
name string

The name of the Cloud Run Service.

value string
name str

The name of the Cloud Run Service.

value str
name String

The name of the Cloud Run Service.

value String

GetServiceTemplateSpecContainerStartupProbeTcpSocket

Port int
Port int
port Integer
port number
port int
port Number

GetServiceTemplateSpecContainerVolumeMount

MountPath string
Name string

The name of the Cloud Run Service.

MountPath string
Name string

The name of the Cloud Run Service.

mountPath String
name String

The name of the Cloud Run Service.

mountPath string
name string

The name of the Cloud Run Service.

mount_path str
name str

The name of the Cloud Run Service.

mountPath String
name String

The name of the Cloud Run Service.

GetServiceTemplateSpecVolume

Name string

The name of the Cloud Run Service.

Secrets List<GetServiceTemplateSpecVolumeSecret>
Name string

The name of the Cloud Run Service.

Secrets []GetServiceTemplateSpecVolumeSecret
name String

The name of the Cloud Run Service.

secrets List<GetServiceTemplateSpecVolumeSecret>
name string

The name of the Cloud Run Service.

secrets GetServiceTemplateSpecVolumeSecret[]
name str

The name of the Cloud Run Service.

secrets Sequence[GetServiceTemplateSpecVolumeSecret]
name String

The name of the Cloud Run Service.

secrets List<Property Map>

GetServiceTemplateSpecVolumeSecret

GetServiceTemplateSpecVolumeSecretItem

Key string
Mode int
Path string
Key string
Mode int
Path string
key String
mode Integer
path String
key string
mode number
path string
key str
mode int
path str
key String
mode Number
path String

GetServiceTraffic

LatestRevision bool
Percent int
RevisionName string
Tag string
Url string
LatestRevision bool
Percent int
RevisionName string
Tag string
Url string
latestRevision Boolean
percent Integer
revisionName String
tag String
url String
latestRevision boolean
percent number
revisionName string
tag string
url string
latestRevision Boolean
percent Number
revisionName String
tag String
url String

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.