1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. apphub
  5. getDiscoveredWorkload
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.apphub.getDiscoveredWorkload

Explore with Pulumi AI

Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

Get information about a discovered workload from its uri.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const my_workload = gcp.apphub.getDiscoveredWorkload({
    location: "us-central1",
    workloadUri: "my-workload-uri",
});
Copy
import pulumi
import pulumi_gcp as gcp

my_workload = gcp.apphub.get_discovered_workload(location="us-central1",
    workload_uri="my-workload-uri")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/apphub"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apphub.GetDiscoveredWorkload(ctx, &apphub.GetDiscoveredWorkloadArgs{
			Location:    "us-central1",
			WorkloadUri: "my-workload-uri",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var my_workload = Gcp.Apphub.GetDiscoveredWorkload.Invoke(new()
    {
        Location = "us-central1",
        WorkloadUri = "my-workload-uri",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.apphub.ApphubFunctions;
import com.pulumi.gcp.apphub.inputs.GetDiscoveredWorkloadArgs;
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-workload = ApphubFunctions.getDiscoveredWorkload(GetDiscoveredWorkloadArgs.builder()
            .location("us-central1")
            .workloadUri("my-workload-uri")
            .build());

    }
}
Copy
variables:
  my-workload:
    fn::invoke:
      function: gcp:apphub:getDiscoveredWorkload
      arguments:
        location: us-central1
        workloadUri: my-workload-uri
Copy

Using getDiscoveredWorkload

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 getDiscoveredWorkload(args: GetDiscoveredWorkloadArgs, opts?: InvokeOptions): Promise<GetDiscoveredWorkloadResult>
function getDiscoveredWorkloadOutput(args: GetDiscoveredWorkloadOutputArgs, opts?: InvokeOptions): Output<GetDiscoveredWorkloadResult>
Copy
def get_discovered_workload(location: Optional[str] = None,
                            project: Optional[str] = None,
                            workload_uri: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetDiscoveredWorkloadResult
def get_discovered_workload_output(location: Optional[pulumi.Input[str]] = None,
                            project: Optional[pulumi.Input[str]] = None,
                            workload_uri: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetDiscoveredWorkloadResult]
Copy
func GetDiscoveredWorkload(ctx *Context, args *GetDiscoveredWorkloadArgs, opts ...InvokeOption) (*GetDiscoveredWorkloadResult, error)
func GetDiscoveredWorkloadOutput(ctx *Context, args *GetDiscoveredWorkloadOutputArgs, opts ...InvokeOption) GetDiscoveredWorkloadResultOutput
Copy

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

public static class GetDiscoveredWorkload 
{
    public static Task<GetDiscoveredWorkloadResult> InvokeAsync(GetDiscoveredWorkloadArgs args, InvokeOptions? opts = null)
    public static Output<GetDiscoveredWorkloadResult> Invoke(GetDiscoveredWorkloadInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDiscoveredWorkloadResult> getDiscoveredWorkload(GetDiscoveredWorkloadArgs args, InvokeOptions options)
public static Output<GetDiscoveredWorkloadResult> getDiscoveredWorkload(GetDiscoveredWorkloadArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:apphub/getDiscoveredWorkload:getDiscoveredWorkload
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Location This property is required. string
The location of the discovered workload.
WorkloadUri This property is required. string
The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
Project string
The host project of the discovered workload.
Location This property is required. string
The location of the discovered workload.
WorkloadUri This property is required. string
The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
Project string
The host project of the discovered workload.
location This property is required. String
The location of the discovered workload.
workloadUri This property is required. String
The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
project String
The host project of the discovered workload.
location This property is required. string
The location of the discovered workload.
workloadUri This property is required. string
The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
project string
The host project of the discovered workload.
location This property is required. str
The location of the discovered workload.
workload_uri This property is required. str
The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
project str
The host project of the discovered workload.
location This property is required. String
The location of the discovered workload.
workloadUri This property is required. String
The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
project String
The host project of the discovered workload.

getDiscoveredWorkload Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Location string
The location that the underlying resource resides in.
Name string
Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
WorkloadProperties List<GetDiscoveredWorkloadWorkloadProperty>
Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
WorkloadReferences List<GetDiscoveredWorkloadWorkloadReference>
Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
WorkloadUri string
Project string
Id string
The provider-assigned unique ID for this managed resource.
Location string
The location that the underlying resource resides in.
Name string
Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
WorkloadProperties []GetDiscoveredWorkloadWorkloadProperty
Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
WorkloadReferences []GetDiscoveredWorkloadWorkloadReference
Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
WorkloadUri string
Project string
id String
The provider-assigned unique ID for this managed resource.
location String
The location that the underlying resource resides in.
name String
Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
workloadProperties List<GetDiscoveredWorkloadWorkloadProperty>
Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
workloadReferences List<GetDiscoveredWorkloadWorkloadReference>
Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
workloadUri String
project String
id string
The provider-assigned unique ID for this managed resource.
location string
The location that the underlying resource resides in.
name string
Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
workloadProperties GetDiscoveredWorkloadWorkloadProperty[]
Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
workloadReferences GetDiscoveredWorkloadWorkloadReference[]
Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
workloadUri string
project string
id str
The provider-assigned unique ID for this managed resource.
location str
The location that the underlying resource resides in.
name str
Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
workload_properties Sequence[GetDiscoveredWorkloadWorkloadProperty]
Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
workload_references Sequence[GetDiscoveredWorkloadWorkloadReference]
Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
workload_uri str
project str
id String
The provider-assigned unique ID for this managed resource.
location String
The location that the underlying resource resides in.
name String
Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
workloadProperties List<Property Map>
Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
workloadReferences List<Property Map>
Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
workloadUri String
project String

Supporting Types

GetDiscoveredWorkloadWorkloadProperty

GcpProject This property is required. string
The service project identifier that the underlying cloud resource resides in.
Location This property is required. string
The location of the discovered workload.
Zone This property is required. string
The location that the underlying resource resides in if it is zonal.
GcpProject This property is required. string
The service project identifier that the underlying cloud resource resides in.
Location This property is required. string
The location of the discovered workload.
Zone This property is required. string
The location that the underlying resource resides in if it is zonal.
gcpProject This property is required. String
The service project identifier that the underlying cloud resource resides in.
location This property is required. String
The location of the discovered workload.
zone This property is required. String
The location that the underlying resource resides in if it is zonal.
gcpProject This property is required. string
The service project identifier that the underlying cloud resource resides in.
location This property is required. string
The location of the discovered workload.
zone This property is required. string
The location that the underlying resource resides in if it is zonal.
gcp_project This property is required. str
The service project identifier that the underlying cloud resource resides in.
location This property is required. str
The location of the discovered workload.
zone This property is required. str
The location that the underlying resource resides in if it is zonal.
gcpProject This property is required. String
The service project identifier that the underlying cloud resource resides in.
location This property is required. String
The location of the discovered workload.
zone This property is required. String
The location that the underlying resource resides in if it is zonal.

GetDiscoveredWorkloadWorkloadReference

Uri This property is required. string
The underlying resource URI.
Uri This property is required. string
The underlying resource URI.
uri This property is required. String
The underlying resource URI.
uri This property is required. string
The underlying resource URI.
uri This property is required. str
The underlying resource URI.
uri This property is required. String
The underlying resource URI.

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.
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi