1. Packages
  2. Packages
  3. Google Cloud (GCP) Classic
  4. API Docs
  5. iam
  6. WorkloadIdentityServiceAgent
Viewing docs for Google Cloud v9.21.0
published on Friday, Apr 24, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.21.0
published on Friday, Apr 24, 2026 by Pulumi

    A Service Agent within the Workload Identity API.

    Example Usage

    Workload Identity Service Agent Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const project = gcp.organizations.getProject({});
    const primary = new gcp.iam.WorkloadIdentityServiceAgent("primary", {parent: project.then(project => `projects/${project.number}/locations/global/serviceProducers/healthcare.googleapis.com`)});
    
    import pulumi
    import pulumi_gcp as gcp
    
    project = gcp.organizations.get_project()
    primary = gcp.iam.WorkloadIdentityServiceAgent("primary", parent=f"projects/{project.number}/locations/global/serviceProducers/healthcare.googleapis.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/iam"
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = iam.NewWorkloadIdentityServiceAgent(ctx, "primary", &iam.WorkloadIdentityServiceAgentArgs{
    			Parent: pulumi.Sprintf("projects/%v/locations/global/serviceProducers/healthcare.googleapis.com", project.Number),
    		})
    		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 project = Gcp.Organizations.GetProject.Invoke();
    
        var primary = new Gcp.Iam.WorkloadIdentityServiceAgent("primary", new()
        {
            Parent = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}/locations/global/serviceProducers/healthcare.googleapis.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.organizations.OrganizationsFunctions;
    import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
    import com.pulumi.gcp.iam.WorkloadIdentityServiceAgent;
    import com.pulumi.gcp.iam.WorkloadIdentityServiceAgentArgs;
    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 project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
                .build());
    
            var primary = new WorkloadIdentityServiceAgent("primary", WorkloadIdentityServiceAgentArgs.builder()
                .parent(String.format("projects/%s/locations/global/serviceProducers/healthcare.googleapis.com", project.number()))
                .build());
    
        }
    }
    
    resources:
      primary:
        type: gcp:iam:WorkloadIdentityServiceAgent
        properties:
          parent: projects/${project.number}/locations/global/serviceProducers/healthcare.googleapis.com
    variables:
      project:
        fn::invoke:
          function: gcp:organizations:getProject
          arguments: {}
    

    Create WorkloadIdentityServiceAgent Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new WorkloadIdentityServiceAgent(name: string, args: WorkloadIdentityServiceAgentArgs, opts?: CustomResourceOptions);
    @overload
    def WorkloadIdentityServiceAgent(resource_name: str,
                                     args: WorkloadIdentityServiceAgentArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkloadIdentityServiceAgent(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     parent: Optional[str] = None)
    func NewWorkloadIdentityServiceAgent(ctx *Context, name string, args WorkloadIdentityServiceAgentArgs, opts ...ResourceOption) (*WorkloadIdentityServiceAgent, error)
    public WorkloadIdentityServiceAgent(string name, WorkloadIdentityServiceAgentArgs args, CustomResourceOptions? opts = null)
    public WorkloadIdentityServiceAgent(String name, WorkloadIdentityServiceAgentArgs args)
    public WorkloadIdentityServiceAgent(String name, WorkloadIdentityServiceAgentArgs args, CustomResourceOptions options)
    
    type: gcp:iam:WorkloadIdentityServiceAgent
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args WorkloadIdentityServiceAgentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args WorkloadIdentityServiceAgentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args WorkloadIdentityServiceAgentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkloadIdentityServiceAgentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkloadIdentityServiceAgentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var workloadIdentityServiceAgentResource = new Gcp.Iam.WorkloadIdentityServiceAgent("workloadIdentityServiceAgentResource", new()
    {
        Parent = "string",
    });
    
    example, err := iam.NewWorkloadIdentityServiceAgent(ctx, "workloadIdentityServiceAgentResource", &iam.WorkloadIdentityServiceAgentArgs{
    	Parent: pulumi.String("string"),
    })
    
    var workloadIdentityServiceAgentResource = new WorkloadIdentityServiceAgent("workloadIdentityServiceAgentResource", WorkloadIdentityServiceAgentArgs.builder()
        .parent("string")
        .build());
    
    workload_identity_service_agent_resource = gcp.iam.WorkloadIdentityServiceAgent("workloadIdentityServiceAgentResource", parent="string")
    
    const workloadIdentityServiceAgentResource = new gcp.iam.WorkloadIdentityServiceAgent("workloadIdentityServiceAgentResource", {parent: "string"});
    
    type: gcp:iam:WorkloadIdentityServiceAgent
    properties:
        parent: string
    

    WorkloadIdentityServiceAgent Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The WorkloadIdentityServiceAgent resource accepts the following input properties:

    Parent string
    The parent resource path.
    Parent string
    The parent resource path.
    parent String
    The parent resource path.
    parent string
    The parent resource path.
    parent str
    The parent resource path.
    parent String
    The parent resource path.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WorkloadIdentityServiceAgent resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceAgents List<WorkloadIdentityServiceAgentServiceAgent>
    The list of ServiceAgents generated by the API call. Structure is documented below.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceAgents []WorkloadIdentityServiceAgentServiceAgent
    The list of ServiceAgents generated by the API call. Structure is documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceAgents List<WorkloadIdentityServiceAgentServiceAgent>
    The list of ServiceAgents generated by the API call. Structure is documented below.
    id string
    The provider-assigned unique ID for this managed resource.
    serviceAgents WorkloadIdentityServiceAgentServiceAgent[]
    The list of ServiceAgents generated by the API call. Structure is documented below.
    id str
    The provider-assigned unique ID for this managed resource.
    service_agents Sequence[WorkloadIdentityServiceAgentServiceAgent]
    The list of ServiceAgents generated by the API call. Structure is documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceAgents List<Property Map>
    The list of ServiceAgents generated by the API call. Structure is documented below.

    Look up Existing WorkloadIdentityServiceAgent Resource

    Get an existing WorkloadIdentityServiceAgent resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: WorkloadIdentityServiceAgentState, opts?: CustomResourceOptions): WorkloadIdentityServiceAgent
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            parent: Optional[str] = None,
            service_agents: Optional[Sequence[WorkloadIdentityServiceAgentServiceAgentArgs]] = None) -> WorkloadIdentityServiceAgent
    func GetWorkloadIdentityServiceAgent(ctx *Context, name string, id IDInput, state *WorkloadIdentityServiceAgentState, opts ...ResourceOption) (*WorkloadIdentityServiceAgent, error)
    public static WorkloadIdentityServiceAgent Get(string name, Input<string> id, WorkloadIdentityServiceAgentState? state, CustomResourceOptions? opts = null)
    public static WorkloadIdentityServiceAgent get(String name, Output<String> id, WorkloadIdentityServiceAgentState state, CustomResourceOptions options)
    resources:  _:    type: gcp:iam:WorkloadIdentityServiceAgent    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Parent string
    The parent resource path.
    ServiceAgents List<WorkloadIdentityServiceAgentServiceAgent>
    The list of ServiceAgents generated by the API call. Structure is documented below.
    Parent string
    The parent resource path.
    ServiceAgents []WorkloadIdentityServiceAgentServiceAgentArgs
    The list of ServiceAgents generated by the API call. Structure is documented below.
    parent String
    The parent resource path.
    serviceAgents List<WorkloadIdentityServiceAgentServiceAgent>
    The list of ServiceAgents generated by the API call. Structure is documented below.
    parent string
    The parent resource path.
    serviceAgents WorkloadIdentityServiceAgentServiceAgent[]
    The list of ServiceAgents generated by the API call. Structure is documented below.
    parent str
    The parent resource path.
    service_agents Sequence[WorkloadIdentityServiceAgentServiceAgentArgs]
    The list of ServiceAgents generated by the API call. Structure is documented below.
    parent String
    The parent resource path.
    serviceAgents List<Property Map>
    The list of ServiceAgents generated by the API call. Structure is documented below.

    Supporting Types

    WorkloadIdentityServiceAgentServiceAgent, WorkloadIdentityServiceAgentServiceAgentArgs

    Container string
    (Output)
    Name string
    (Output)
    Principal string
    (Output)
    Role string
    (Output)
    ServiceProducer string
    (Output)
    State string
    (Output)
    Container string
    (Output)
    Name string
    (Output)
    Principal string
    (Output)
    Role string
    (Output)
    ServiceProducer string
    (Output)
    State string
    (Output)
    container String
    (Output)
    name String
    (Output)
    principal String
    (Output)
    role String
    (Output)
    serviceProducer String
    (Output)
    state String
    (Output)
    container string
    (Output)
    name string
    (Output)
    principal string
    (Output)
    role string
    (Output)
    serviceProducer string
    (Output)
    state string
    (Output)
    container str
    (Output)
    name str
    (Output)
    principal str
    (Output)
    role str
    (Output)
    service_producer str
    (Output)
    state str
    (Output)
    container String
    (Output)
    name String
    (Output)
    principal String
    (Output)
    role String
    (Output)
    serviceProducer String
    (Output)
    state String
    (Output)

    Import

    This resource does not support import.

    To learn more about importing existing cloud resources, see Importing resources.

    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.
    gcp logo
    Viewing docs for Google Cloud v9.21.0
    published on Friday, Apr 24, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.