1. Packages
  2. Packages
  3. Google Cloud (GCP) Classic
  4. API Docs
  5. discoveryengine
  6. getSearchEngineIamPolicy
Viewing docs for Google Cloud v9.30.0
published on Monday, Jul 13, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.30.0
published on Monday, Jul 13, 2026 by Pulumi

    Retrieves the current IAM policy data for searchengine

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const policy = gcp.discoveryengine.getSearchEngineIamPolicy({
        project: basic.project,
        location: basic.location,
        collectionId: basic.collectionId,
        engineId: basic.engineId,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.discoveryengine.get_search_engine_iam_policy(project=basic["project"],
        location=basic["location"],
        collection_id=basic["collectionId"],
        engine_id=basic["engineId"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/discoveryengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := discoveryengine.LookupSearchEngineIamPolicy(ctx, &discoveryengine.LookupSearchEngineIamPolicyArgs{
    			Project:      pulumi.StringRef(basic.Project),
    			Location:     pulumi.StringRef(basic.Location),
    			CollectionId: basic.CollectionId,
    			EngineId:     basic.EngineId,
    		}, 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 policy = Gcp.DiscoveryEngine.GetSearchEngineIamPolicy.Invoke(new()
        {
            Project = basic.Project,
            Location = basic.Location,
            CollectionId = basic.CollectionId,
            EngineId = basic.EngineId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.discoveryengine.DiscoveryengineFunctions;
    import com.pulumi.gcp.discoveryengine.inputs.GetSearchEngineIamPolicyArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 policy = DiscoveryengineFunctions.getSearchEngineIamPolicy(GetSearchEngineIamPolicyArgs.builder()
                .project(basic.project())
                .location(basic.location())
                .collectionId(basic.collectionId())
                .engineId(basic.engineId())
                .build());
    
        }
    }
    
    variables:
      policy:
        fn::invoke:
          function: gcp:discoveryengine:getSearchEngineIamPolicy
          arguments:
            project: ${basic.project}
            location: ${basic.location}
            collectionId: ${basic.collectionId}
            engineId: ${basic.engineId}
    
    pulumi {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    data "gcp_discoveryengine_getsearchengineiampolicy" "policy" {
      project       = basic.project
      location      = basic.location
      collection_id = basic.collectionId
      engine_id     = basic.engineId
    }
    

    Using getSearchEngineIamPolicy

    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 getSearchEngineIamPolicy(args: GetSearchEngineIamPolicyArgs, opts?: InvokeOptions): Promise<GetSearchEngineIamPolicyResult>
    function getSearchEngineIamPolicyOutput(args: GetSearchEngineIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetSearchEngineIamPolicyResult>
    def get_search_engine_iam_policy(collection_id: Optional[str] = None,
                                     engine_id: Optional[str] = None,
                                     location: Optional[str] = None,
                                     project: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetSearchEngineIamPolicyResult
    def get_search_engine_iam_policy_output(collection_id: pulumi.Input[Optional[str]] = None,
                                     engine_id: pulumi.Input[Optional[str]] = None,
                                     location: pulumi.Input[Optional[str]] = None,
                                     project: pulumi.Input[Optional[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetSearchEngineIamPolicyResult]
    func LookupSearchEngineIamPolicy(ctx *Context, args *LookupSearchEngineIamPolicyArgs, opts ...InvokeOption) (*LookupSearchEngineIamPolicyResult, error)
    func LookupSearchEngineIamPolicyOutput(ctx *Context, args *LookupSearchEngineIamPolicyOutputArgs, opts ...InvokeOption) LookupSearchEngineIamPolicyResultOutput

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

    public static class GetSearchEngineIamPolicy 
    {
        public static Task<GetSearchEngineIamPolicyResult> InvokeAsync(GetSearchEngineIamPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetSearchEngineIamPolicyResult> Invoke(GetSearchEngineIamPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSearchEngineIamPolicyResult> getSearchEngineIamPolicy(GetSearchEngineIamPolicyArgs args, InvokeOptions options)
    public static Output<GetSearchEngineIamPolicyResult> getSearchEngineIamPolicy(GetSearchEngineIamPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:discoveryengine/getSearchEngineIamPolicy:getSearchEngineIamPolicy
      arguments:
        # arguments dictionary
    data "gcp_discoveryengine_getsearchengineiampolicy" "name" {
        # arguments
    }

    The following arguments are supported:

    CollectionId string
    The collection ID. Used to find the parent resource to bind the IAM policy to
    EngineId string
    Used to find the parent resource to bind the IAM policy to
    Location string
    Location. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    CollectionId string
    The collection ID. Used to find the parent resource to bind the IAM policy to
    EngineId string
    Used to find the parent resource to bind the IAM policy to
    Location string
    Location. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    collection_id string
    The collection ID. Used to find the parent resource to bind the IAM policy to
    engine_id string
    Used to find the parent resource to bind the IAM policy to
    location string
    Location. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    collectionId String
    The collection ID. Used to find the parent resource to bind the IAM policy to
    engineId String
    Used to find the parent resource to bind the IAM policy to
    location String
    Location. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    collectionId string
    The collection ID. Used to find the parent resource to bind the IAM policy to
    engineId string
    Used to find the parent resource to bind the IAM policy to
    location string
    Location. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    collection_id str
    The collection ID. Used to find the parent resource to bind the IAM policy to
    engine_id str
    Used to find the parent resource to bind the IAM policy to
    location str
    Location. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
    collectionId String
    The collection ID. Used to find the parent resource to bind the IAM policy to
    engineId String
    Used to find the parent resource to bind the IAM policy to
    location String
    Location. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

    getSearchEngineIamPolicy Result

    The following output properties are available:

    CollectionId string
    EngineId string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    PolicyData string
    (Required only by gcp.discoveryengine.SearchEngineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    Project string
    CollectionId string
    EngineId string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    PolicyData string
    (Required only by gcp.discoveryengine.SearchEngineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    Project string
    collection_id string
    engine_id string
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    policy_data string
    (Required only by gcp.discoveryengine.SearchEngineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project string
    collectionId String
    engineId String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    policyData String
    (Required only by gcp.discoveryengine.SearchEngineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project String
    collectionId string
    engineId string
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    policyData string
    (Required only by gcp.discoveryengine.SearchEngineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project string
    collection_id str
    engine_id str
    etag str
    (Computed) The etag of the IAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    policy_data str
    (Required only by gcp.discoveryengine.SearchEngineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    project str
    collectionId String
    engineId String
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    policyData String
    (Required only by gcp.discoveryengine.SearchEngineIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    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.
    gcp logo
    Viewing docs for Google Cloud v9.30.0
    published on Monday, Jul 13, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial