Control class

Controls are rules that influence search results.

To get more information about Control, see:

Example Usage

Discoveryengine Control Basic

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

const basic = new gcp.discoveryengine.DataStore("basic", {
    location: "global",
    dataStoreId: "data-store-id",
    displayName: "tf-test-datastore",
    industryVertical: "GENERIC",
    contentConfig: "NO_CONTENT",
    solutionTypes: ["SOLUTION_TYPE_SEARCH"],
    createAdvancedSiteSearch: false,
});
const basicSearchEngine = new gcp.discoveryengine.SearchEngine("basic", {
    engineId: "engine-id",
    collectionId: "default_collection",
    location: basic.location,
    displayName: "tf-test-engine",
    dataStoreIds: [basic.dataStoreId],
    industryVertical: "GENERIC",
    appType: "APP_TYPE_INTRANET",
    searchEngineConfig: {},
});
const basicControl = new gcp.discoveryengine.Control("basic", {
    location: basicSearchEngine.location,
    engineId: basicSearchEngine.engineId,
    controlId: "control-id",
    displayName: "tf-test-control",
    solutionType: "SOLUTION_TYPE_SEARCH",
    useCases: ["SEARCH_USE_CASE_SEARCH"],
    synonymsAction: {
        synonyms: [
            "test",
            "experiment",
        ],
    },
});
import pulumi
import pulumi_gcp as gcp

basic = gcp.discoveryengine.DataStore("basic",
    location="global",
    data_store_id="data-store-id",
    display_name="tf-test-datastore",
    industry_vertical="GENERIC",
    content_config="NO_CONTENT",
    solution_types=["SOLUTION_TYPE_SEARCH"],
    create_advanced_site_search=False)
basic_search_engine = gcp.discoveryengine.SearchEngine("basic",
    engine_id="engine-id",
    collection_id="default_collection",
    location=basic.location,
    display_name="tf-test-engine",
    data_store_ids=[basic.data_store_id],
    industry_vertical="GENERIC",
    app_type="APP_TYPE_INTRANET",
    search_engine_config={})
basic_control = gcp.discoveryengine.Control("basic",
    location=basic_search_engine.location,
    engine_id=basic_search_engine.engine_id,
    control_id="control-id",
    display_name="tf-test-control",
    solution_type="SOLUTION_TYPE_SEARCH",
    use_cases=["SEARCH_USE_CASE_SEARCH"],
    synonyms_action={
        "synonyms": [
            "test",
            "experiment",
        ],
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var basic = new Gcp.DiscoveryEngine.DataStore("basic", new()
    {
        Location = "global",
        DataStoreId = "data-store-id",
        DisplayName = "tf-test-datastore",
        IndustryVertical = "GENERIC",
        ContentConfig = "NO_CONTENT",
        SolutionTypes = new[]
        {
            "SOLUTION_TYPE_SEARCH",
        },
        CreateAdvancedSiteSearch = false,
    });

    var basicSearchEngine = new Gcp.DiscoveryEngine.SearchEngine("basic", new()
    {
        EngineId = "engine-id",
        CollectionId = "default_collection",
        Location = basic.Location,
        DisplayName = "tf-test-engine",
        DataStoreIds = new[]
        {
            basic.DataStoreId,
        },
        IndustryVertical = "GENERIC",
        AppType = "APP_TYPE_INTRANET",
        SearchEngineConfig = new() { },
    });

    var basicControl = new Gcp.DiscoveryEngine.Control("basic", new()
    {
        Location = basicSearchEngine.Location,
        EngineId = basicSearchEngine.EngineId,
        ControlId = "control-id",
        DisplayName = "tf-test-control",
        SolutionType = "SOLUTION_TYPE_SEARCH",
        UseCases = new[]
        {
            "SEARCH_USE_CASE_SEARCH",
        },
        SynonymsAction = new Gcp.DiscoveryEngine.Inputs.ControlSynonymsActionArgs
        {
            Synonyms = new[]
            {
                "test",
                "experiment",
            },
        },
    });

});
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 {
		basic, err := discoveryengine.NewDataStore(ctx, "basic", &discoveryengine.DataStoreArgs{
			Location:         pulumi.String("global"),
			DataStoreId:      pulumi.String("data-store-id"),
			DisplayName:      pulumi.String("tf-test-datastore"),
			IndustryVertical: pulumi.String("GENERIC"),
			ContentConfig:    pulumi.String("NO_CONTENT"),
			SolutionTypes: pulumi.StringArray{
				pulumi.String("SOLUTION_TYPE_SEARCH"),
			},
			CreateAdvancedSiteSearch: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		basicSearchEngine, err := discoveryengine.NewSearchEngine(ctx, "basic", &discoveryengine.SearchEngineArgs{
			EngineId:     pulumi.String("engine-id"),
			CollectionId: pulumi.String("default_collection"),
			Location:     basic.Location,
			DisplayName:  pulumi.String("tf-test-engine"),
			DataStoreIds: pulumi.StringArray{
				basic.DataStoreId,
			},
			IndustryVertical:   pulumi.String("GENERIC"),
			AppType:            pulumi.String("APP_TYPE_INTRANET"),
			SearchEngineConfig: &discoveryengine.SearchEngineSearchEngineConfigArgs{},
		})
		if err != nil {
			return err
		}
		_, err = discoveryengine.NewControl(ctx, "basic", &discoveryengine.ControlArgs{
			Location:     basicSearchEngine.Location,
			EngineId:     basicSearchEngine.EngineId,
			ControlId:    pulumi.String("control-id"),
			DisplayName:  pulumi.String("tf-test-control"),
			SolutionType: pulumi.String("SOLUTION_TYPE_SEARCH"),
			UseCases: pulumi.StringArray{
				pulumi.String("SEARCH_USE_CASE_SEARCH"),
			},
			SynonymsAction: &discoveryengine.ControlSynonymsActionArgs{
				Synonyms: pulumi.StringArray{
					pulumi.String("test"),
					pulumi.String("experiment"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_discoveryengine_datastore" "basic" {
  location                    = "global"
  data_store_id               = "data-store-id"
  display_name                = "tf-test-datastore"
  industry_vertical           = "GENERIC"
  content_config              = "NO_CONTENT"
  solution_types              = ["SOLUTION_TYPE_SEARCH"]
  create_advanced_site_search = false
}
resource "gcp_discoveryengine_searchengine" "basic" {
  engine_id            = "engine-id"
  collection_id        = "default_collection"
  location             = gcp_discoveryengine_datastore.basic.location
  display_name         = "tf-test-engine"
  data_store_ids       = [gcp_discoveryengine_datastore.basic.data_store_id]
  industry_vertical    = "GENERIC"
  app_type             = "APP_TYPE_INTRANET"
  search_engine_config = {}
}
resource "gcp_discoveryengine_control" "basic" {
  location      = gcp_discoveryengine_searchengine.basic.location
  engine_id     = gcp_discoveryengine_searchengine.basic.engine_id
  control_id    = "control-id"
  display_name  = "tf-test-control"
  solution_type = "SOLUTION_TYPE_SEARCH"
  use_cases     = ["SEARCH_USE_CASE_SEARCH"]
  synonyms_action = {
    synonyms = ["test", "experiment"]
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.discoveryengine.DataStore;
import com.pulumi.gcp.discoveryengine.DataStoreArgs;
import com.pulumi.gcp.discoveryengine.SearchEngine;
import com.pulumi.gcp.discoveryengine.SearchEngineArgs;
import com.pulumi.gcp.discoveryengine.inputs.SearchEngineSearchEngineConfigArgs;
import com.pulumi.gcp.discoveryengine.Control;
import com.pulumi.gcp.discoveryengine.ControlArgs;
import com.pulumi.gcp.discoveryengine.inputs.ControlSynonymsActionArgs;
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) {
        var basic = new DataStore("basic", DataStoreArgs.builder()
            .location("global")
            .dataStoreId("data-store-id")
            .displayName("tf-test-datastore")
            .industryVertical("GENERIC")
            .contentConfig("NO_CONTENT")
            .solutionTypes("SOLUTION_TYPE_SEARCH")
            .createAdvancedSiteSearch(false)
            .build());

        var basicSearchEngine = new SearchEngine("basicSearchEngine", SearchEngineArgs.builder()
            .engineId("engine-id")
            .collectionId("default_collection")
            .location(basic.location())
            .displayName("tf-test-engine")
            .dataStoreIds(basic.dataStoreId())
            .industryVertical("GENERIC")
            .appType("APP_TYPE_INTRANET")
            .searchEngineConfig(SearchEngineSearchEngineConfigArgs.builder()
                .build())
            .build());

        var basicControl = new Control("basicControl", ControlArgs.builder()
            .location(basicSearchEngine.location())
            .engineId(basicSearchEngine.engineId())
            .controlId("control-id")
            .displayName("tf-test-control")
            .solutionType("SOLUTION_TYPE_SEARCH")
            .useCases("SEARCH_USE_CASE_SEARCH")
            .synonymsAction(ControlSynonymsActionArgs.builder()
                .synonyms(
                    "test",
                    "experiment")
                .build())
            .build());

    }
}
resources:
  basic:
    type: gcp:discoveryengine:DataStore
    properties:
      location: global
      dataStoreId: data-store-id
      displayName: tf-test-datastore
      industryVertical: GENERIC
      contentConfig: NO_CONTENT
      solutionTypes:
        - SOLUTION_TYPE_SEARCH
      createAdvancedSiteSearch: false
  basicSearchEngine:
    type: gcp:discoveryengine:SearchEngine
    name: basic
    properties:
      engineId: engine-id
      collectionId: default_collection
      location: ${basic.location}
      displayName: tf-test-engine
      dataStoreIds:
        - ${basic.dataStoreId}
      industryVertical: GENERIC
      appType: APP_TYPE_INTRANET
      searchEngineConfig: {}
  basicControl:
    type: gcp:discoveryengine:Control
    name: basic
    properties:
      location: ${basicSearchEngine.location}
      engineId: ${basicSearchEngine.engineId}
      controlId: control-id
      displayName: tf-test-control
      solutionType: SOLUTION_TYPE_SEARCH
      useCases:
        - SEARCH_USE_CASE_SEARCH
      synonymsAction:
        synonyms:
          - test
          - experiment

Import

Control can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/controls/{{control_id}}
  • {{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}
  • {{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}

When using the pulumi import command, Control can be imported using one of the formats above. For example:

$ pulumi import gcp:discoveryengine/control:Control default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/controls/{{control_id}}
$ pulumi import gcp:discoveryengine/control:Control default {{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}
$ pulumi import gcp:discoveryengine/control:Control default {{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}

Constructors

Control(String name, {ControlArgs? args, CustomResourceOptions? options})
Creates a new Control. name The Pulumi resource name. args Arguments used to configure this Control. The set of arguments for Control. options Resource options controlling this resource's behavior.
Control.reference(String urn)
Creates a typed reference to an existing Control resource.

Properties

boostAction ↔ Output<ControlBoostAction?>
Changes the returned order of results. Structure is documented below.
latefinal
childResources → Set<Resource>
finalinherited
collectionId ↔ Output<String?>
The collection ID. Currently only accepts "defaultCollection".
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
conditions ↔ Output<List<ControlCondition>?>
The conditions under which the control is active. Structure is documented below.
latefinal
controlId ↔ Output<String>
The unique id of the control.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
displayName ↔ Output<String>
The display name of the control. This field must be a UTF-8 encoded string with a length limit of 128 characters.
latefinal
engineId ↔ Output<String>
The engine to add the control to.
latefinal
filterAction ↔ Output<ControlFilterAction?>
Removes entries from returned results. Structure is documented below.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
location ↔ Output<String>
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
latefinal
name ↔ Output<String>
The unique full resource name of the control. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/controls/{control_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
promoteAction ↔ Output<ControlPromoteAction?>
Promotes a specified link for a query. Structure is documented below.
latefinal
redirectAction ↔ Output<ControlRedirectAction?>
Redirects to a specified URI. Structure is documented below.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
solutionType ↔ Output<String>
The solution type that the control belongs to. Possible values are: SOLUTION_TYPE_RECOMMENDATION, SOLUTION_TYPE_SEARCH, SOLUTION_TYPE_CHAT, SOLUTION_TYPE_GENERATIVE_CHAT.
latefinal
synonymsAction ↔ Output<ControlSynonymsAction?>
Associates queries with each other. Structure is documented below.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
useCases ↔ Output<List<String>?>
The use cases that the control is used for. Each value may be one of: SEARCH_USE_CASE_SEARCH, SEARCH_USE_CASE_BROWSE.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ControlState? state, CustomResourceOptions? options}) → Control
Gets an existing Control resource's state with the given name and id.