--- # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** Type: MMv1 *** # # ---------------------------------------------------------------------------- # # This code is generated by Magic Modules using the following: # # Configuration: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products/discoveryengine/SearchEngine.yaml # Template: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/templates/terraform/resource.html.markdown.tmpl # # DO NOT EDIT this file directly. Any changes made to this file will be # overwritten during the next generation cycle. # # ---------------------------------------------------------------------------- subcategory: "Discovery Engine" description: |- Vertex AI Search and Conversation can be used to create a search engine or a chat application by connecting it with a datastore --- # google_discovery_engine_search_engine Vertex AI Search and Conversation can be used to create a search engine or a chat application by connecting it with a datastore To get more information about SearchEngine, see: * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines) * How-to Guides * [Create a Search Engine](https://cloud.google.com/generative-ai-app-builder/docs/create-engine-es)
Open in Cloud Shell
## Example Usage - Discoveryengine Searchengine Basic ```hcl resource "google_discovery_engine_data_store" "basic" { location = "global" data_store_id = "example-datastore-id" display_name = "tf-test-structured-datastore" industry_vertical = "GENERIC" content_config = "NO_CONTENT" solution_types = ["SOLUTION_TYPE_SEARCH"] create_advanced_site_search = false } resource "google_discovery_engine_search_engine" "basic" { engine_id = "example-engine-id" collection_id = "default_collection" location = google_discovery_engine_data_store.basic.location display_name = "Example Display Name" data_store_ids = [google_discovery_engine_data_store.basic.data_store_id] search_engine_config { } } ```
Open in Cloud Shell
## Example Usage - Discoveryengine Searchengine Agentspace Basic ```hcl resource "google_discovery_engine_data_store" "agentspace_basic" { location = "global" data_store_id = "example-datastore-id" display_name = "tf-test-structured-datastore" industry_vertical = "GENERIC" content_config = "NO_CONTENT" solution_types = ["SOLUTION_TYPE_SEARCH"] create_advanced_site_search = false } resource "google_discovery_engine_search_engine" "agentspace_basic" { engine_id = "example-engine-id" collection_id = "default_collection" location = google_discovery_engine_data_store.agentspace_basic.location display_name = "tf-test-agentspace-search-engine" data_store_ids = [google_discovery_engine_data_store.agentspace_basic.data_store_id] industry_vertical = "GENERIC" app_type = "APP_TYPE_INTRANET" search_engine_config { search_tier = "SEARCH_TIER_STANDARD" required_subscription_tier = "SUBSCRIPTION_TIER_ENTERPRISE" search_add_ons = ["SEARCH_ADD_ON_LLM"] } features = { "agent-sharing-without-admin-approval" = "FEATURE_STATE_ON" "disable-agent-sharing" = "FEATURE_STATE_OFF" "enable-end-user-sharing-with-groups" = "FEATURE_STATE_OFF" "workflow-agents" = "FEATURE_STATE_ON" } knowledge_graph_config { } } ``` ## Argument Reference The following arguments are supported: * `display_name` - (Required) Required. The display name of the engine. Should be human readable. UTF-8 encoded string with limit of 1024 characters. * `data_store_ids` - (Required) The data stores associated with this engine. For SOLUTION_TYPE_SEARCH type of engines, they can only associate with at most one data store. * `search_engine_config` - (Required) Configurations for a Search Engine. Structure is [documented below](#nested_search_engine_config). * `engine_id` - (Required) Unique ID to use for Search Engine App. * `collection_id` - (Required) The collection ID. * `location` - (Required) Location. * `industry_vertical` - (Optional) The industry vertical that the engine registers. The restriction of the Engine industry vertical is based on DataStore: If unspecified, default to GENERIC. Vertical on Engine has to match vertical of the DataStore liniked to the engine. Default value is `GENERIC`. Possible values are: `GENERIC`, `MEDIA`, `HEALTHCARE_FHIR`. * `common_config` - (Optional) Common config spec that specifies the metadata of the engine. Structure is [documented below](#nested_common_config). * `app_type` - (Optional) This is the application type this engine resource represents. The supported values: 'APP_TYPE_UNSPECIFIED', 'APP_TYPE_INTRANET'. * `disable_analytics` - (Optional) Whether to disable analytics for searches performed on this engine. * `features` - (Optional) A map of the feature config for the engine to opt in or opt out of features. * `kms_key_name` - (Optional) The KMS key to be used to protect this Engine at creation time. Must be set for requests that need to comply with CMEK Org Policy protections. If this field is set and processed successfully, the Engine will be protected by the KMS key, as indicated in the cmek_config field. * `knowledge_graph_config` - (Optional) Configurations for the Knowledge Graph. Structure is [documented below](#nested_knowledge_graph_config). * `procurement_contact_emails` - (Optional) The emails of the procurement contacts. * `model_configs` - (Optional) Maps a model name to its specific configuration for this engine. This allows admin users to turn on/off individual models. This only stores models whose states are overridden by the admin. When the state is unspecified, or `model_configs` is empty for this model, the system decides if this model is available based on the default configuration. For example, a preview model is disabled by default if the admin has not chosen to enable it. Each value is one of `MODEL_STATE_UNSPECIFIED`, `MODEL_ENABLED`, or `MODEL_DISABLED`; see the [ModelState API reference](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines#modelstate) for details. * `project` - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. * `deletion_policy` - (Optional) Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'terraform apply' 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. The `search_engine_config` block supports: * `search_tier` - (Optional) The search feature tier of this engine. Defaults to SearchTier.SEARCH_TIER_STANDARD if not specified. Default value is `SEARCH_TIER_STANDARD`. Possible values are: `SEARCH_TIER_STANDARD`, `SEARCH_TIER_ENTERPRISE`. * `required_subscription_tier` - (Optional) The required subscription tier of this engine. If the required subscription tier is search, user with higher license tier like assist can still access the standalone app associated with this engine. Possible values are: `SUBSCRIPTION_TIER_UNSPECIFIED`, `SUBSCRIPTION_TIER_SEARCH`, `SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT`, `SUBSCRIPTION_TIER_FRONTLINE_WORKER`, `SUBSCRIPTION_TIER_AGENTSPACE_STARTER`, `SUBSCRIPTION_TIER_AGENTSPACE_BUSINESS`, `SUBSCRIPTION_TIER_ENTERPRISE`, `SUBSCRIPTION_TIER_ENTERPRISE_EMERGING`, `SUBSCRIPTION_TIER_EDU`, `SUBSCRIPTION_TIER_EDU_PRO`, `SUBSCRIPTION_TIER_EDU_EMERGING`, `SUBSCRIPTION_TIER_EDU_PRO_EMERGING`, `SUBSCRIPTION_TIER_FRONTLINE_STARTER`. * `search_add_ons` - (Optional) The add-on that this search engine enables. Each value may be one of: `SEARCH_ADD_ON_LLM`. The `common_config` block supports: * `company_name` - (Optional) The name of the company, business or entity that is associated with the engine. Setting this may help improve LLM related features.cd The `knowledge_graph_config` block supports: * `enable_cloud_knowledge_graph` - (Optional) Whether to enable the Cloud Knowledge Graph for the engine. * `cloud_knowledge_graph_types` - (Optional) Specify entity types to support. * `enable_private_knowledge_graph` - (Optional) Whether to enable the Private Knowledge Graph for the engine. * `feature_config` - (Optional) Feature config for the Knowledge Graph. Structure is [documented below](#nested_knowledge_graph_config_feature_config). The `feature_config` block supports: * `disable_private_kg_query_understanding` - (Optional) Whether to disable the private KG query understanding for the engine. * `disable_private_kg_enrichment` - (Optional) Whether to disable the private KG enrichment for the engine. * `disable_private_kg_auto_complete` - (Optional) Whether to disable the private KG auto complete for the engine. * `disable_private_kg_query_ui_chips` - (Optional) Whether to disable the private KG for query UI chips. ## Attributes Reference In addition to the arguments listed above, the following computed attributes are exported: * `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}` * `name` - The unique full resource name of the search engine. Values are of the format `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. * `create_time` - Timestamp the Engine was created at. * `update_time` - Timestamp the Engine was last updated. ## Timeouts This resource provides the following [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: - `create` - Default is 20 minutes. - `update` - Default is 20 minutes. - `delete` - Default is 20 minutes. ## Import SearchEngine can be imported using any of these accepted formats: * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}` * `{{project}}/{{location}}/{{collection_id}}/{{engine_id}}` * `{{location}}/{{collection_id}}/{{engine_id}}` In Terraform v1.12.0 and later, use an [`identity` block](https://developer.hashicorp.com/terraform/language/block/import#identity) to import SearchEngine using identity values. For example: ```tf import { identity = { engineId = "<-required value->" collectionId = "<-required value->" location = "<-required value->" project = "<-optional value->" } to = google_discovery_engine_search_engine.default } ``` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SearchEngine using one of the formats above. For example: ```tf import { id = "projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}" to = google_discovery_engine_search_engine.default } ``` When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), SearchEngine can be imported using one of the formats above. For example: ``` $ terraform import google_discovery_engine_search_engine.default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}} $ terraform import google_discovery_engine_search_engine.default {{project}}/{{location}}/{{collection_id}}/{{engine_id}} $ terraform import google_discovery_engine_search_engine.default {{location}}/{{collection_id}}/{{engine_id}} ``` ## User Project Overrides This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).