UserStore class

Represents a user store.

To get more information about UserStore, see:

Example Usage

Discoveryengine Userstore Basic

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

const basic = new gcp.discoveryengine.LicenseConfig("basic", {
    location: "us",
    licenseConfigId: "license-config-id",
    licenseCount: 50,
    subscriptionTier: "SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT",
    startDate: {
        year: 2099,
        month: 1,
        day: 1,
    },
    endDate: {
        year: 2100,
        month: 1,
        day: 1,
    },
    subscriptionTerm: "SUBSCRIPTION_TERM_ONE_YEAR",
});
const project = gcp.organizations.getProject({});
const basicUserStore = new gcp.discoveryengine.UserStore("basic", {
    location: basic.location,
    defaultLicenseConfig: pulumi.all([project, basic.location, basic.licenseConfigId]).apply(([project, location, licenseConfigId]) => `projects/${project.number}/locations/${location}/licenseConfigs/${licenseConfigId}`),
    enableLicenseAutoRegister: true,
});
import pulumi
import pulumi_gcp as gcp

basic = gcp.discoveryengine.LicenseConfig("basic",
    location="us",
    license_config_id="license-config-id",
    license_count=50,
    subscription_tier="SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT",
    start_date={
        "year": 2099,
        "month": 1,
        "day": 1,
    },
    end_date={
        "year": 2100,
        "month": 1,
        "day": 1,
    },
    subscription_term="SUBSCRIPTION_TERM_ONE_YEAR")
project = gcp.organizations.get_project()
basic_user_store = gcp.discoveryengine.UserStore("basic",
    location=basic.location,
    default_license_config=pulumi.Output.all(
        location=basic.location,
        license_config_id=basic.license_config_id
).apply(lambda resolved_outputs: f"projects/{project.number}/locations/{resolved_outputs['location']}/licenseConfigs/{resolved_outputs['license_config_id']}")
,
    enable_license_auto_register=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var basic = new Gcp.DiscoveryEngine.LicenseConfig("basic", new()
    {
        Location = "us",
        LicenseConfigId = "license-config-id",
        LicenseCount = 50,
        SubscriptionTier = "SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT",
        StartDate = new Gcp.DiscoveryEngine.Inputs.LicenseConfigStartDateArgs
        {
            Year = 2099,
            Month = 1,
            Day = 1,
        },
        EndDate = new Gcp.DiscoveryEngine.Inputs.LicenseConfigEndDateArgs
        {
            Year = 2100,
            Month = 1,
            Day = 1,
        },
        SubscriptionTerm = "SUBSCRIPTION_TERM_ONE_YEAR",
    });

    var project = Gcp.Organizations.GetProject.Invoke();

    var basicUserStore = new Gcp.DiscoveryEngine.UserStore("basic", new()
    {
        Location = basic.Location,
        DefaultLicenseConfig = Output.Tuple(project, basic.Location, basic.LicenseConfigId).Apply(values =>
        {
            var project = values.Item1;
            var location = values.Item2;
            var licenseConfigId = values.Item3;
            return $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}/locations/{location}/licenseConfigs/{licenseConfigId}";
        }),
        EnableLicenseAutoRegister = true,
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/discoveryengine"
	"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 {
		basic, err := discoveryengine.NewLicenseConfig(ctx, "basic", &discoveryengine.LicenseConfigArgs{
			Location:         pulumi.String("us"),
			LicenseConfigId:  pulumi.String("license-config-id"),
			LicenseCount:     pulumi.Int(50),
			SubscriptionTier: pulumi.String("SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT"),
			StartDate: &discoveryengine.LicenseConfigStartDateArgs{
				Year:  pulumi.Int(2099),
				Month: pulumi.Int(1),
				Day:   pulumi.Int(1),
			},
			EndDate: &discoveryengine.LicenseConfigEndDateArgs{
				Year:  pulumi.Int(2100),
				Month: pulumi.Int(1),
				Day:   pulumi.Int(1),
			},
			SubscriptionTerm: pulumi.String("SUBSCRIPTION_TERM_ONE_YEAR"),
		})
		if err != nil {
			return err
		}
		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = discoveryengine.NewUserStore(ctx, "basic", &discoveryengine.UserStoreArgs{
			Location: basic.Location,
			DefaultLicenseConfig: pulumi.All(basic.Location, basic.LicenseConfigId).ApplyT(func(_args []interface{}) (string, error) {
				location := _args[0].(string)
				licenseConfigId := _args[1].(string)
				return fmt.Sprintf("projects/%v/locations/%v/licenseConfigs/%v", project.Number, location, licenseConfigId), nil
			}).(pulumi.StringOutput),
			EnableLicenseAutoRegister: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_organizations_getproject" "project" {
}

resource "gcp_discoveryengine_licenseconfig" "basic" {
  location          = "us"
  license_config_id = "license-config-id"
  license_count     = 50
  subscription_tier = "SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT"
  start_date = {
    year  = 2099
    month = 1
    day   = 1
  }
  end_date = {
    year  = 2100
    month = 1
    day   = 1
  }
  subscription_term = "SUBSCRIPTION_TERM_ONE_YEAR"
}
resource "gcp_discoveryengine_userstore" "basic" {
  location                     = gcp_discoveryengine_licenseconfig.basic.location
  default_license_config       ="projects/${data.gcp_organizations_getproject.project.number}/locations/${gcp_discoveryengine_licenseconfig.basic.location}/licenseConfigs/${gcp_discoveryengine_licenseconfig.basic.license_config_id}"
  enable_license_auto_register = true
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.discoveryengine.LicenseConfig;
import com.pulumi.gcp.discoveryengine.LicenseConfigArgs;
import com.pulumi.gcp.discoveryengine.inputs.LicenseConfigStartDateArgs;
import com.pulumi.gcp.discoveryengine.inputs.LicenseConfigEndDateArgs;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.discoveryengine.UserStore;
import com.pulumi.gcp.discoveryengine.UserStoreArgs;
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 LicenseConfig("basic", LicenseConfigArgs.builder()
            .location("us")
            .licenseConfigId("license-config-id")
            .licenseCount(50)
            .subscriptionTier("SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT")
            .startDate(LicenseConfigStartDateArgs.builder()
                .year(2099)
                .month(1)
                .day(1)
                .build())
            .endDate(LicenseConfigEndDateArgs.builder()
                .year(2100)
                .month(1)
                .day(1)
                .build())
            .subscriptionTerm("SUBSCRIPTION_TERM_ONE_YEAR")
            .build());

        final var project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
            .build());

        var basicUserStore = new UserStore("basicUserStore", UserStoreArgs.builder()
            .location(basic.location())
            .defaultLicenseConfig(Output.tuple(basic.location(), basic.licenseConfigId()).applyValue(values -> {
                var location = values.t1;
                var licenseConfigId = values.t2;
                return String.format("projects/%s/locations/%s/licenseConfigs/%s", project.number(),location,licenseConfigId);
            }))
            .enableLicenseAutoRegister(true)
            .build());

    }
}
resources:
  basic:
    type: gcp:discoveryengine:LicenseConfig
    properties:
      location: us
      licenseConfigId: license-config-id
      licenseCount: 50
      subscriptionTier: SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT
      startDate:
        year: 2099
        month: 1
        day: 1
      endDate:
        year: 2100
        month: 1
        day: 1
      subscriptionTerm: SUBSCRIPTION_TERM_ONE_YEAR
  basicUserStore:
    type: gcp:discoveryengine:UserStore
    name: basic
    properties:
      location: ${basic.location}
      defaultLicenseConfig: projects/${project.number}/locations/${basic.location}/licenseConfigs/${basic.licenseConfigId}
      enableLicenseAutoRegister: true
variables:
  project:
    fn::invoke:
      function: gcp:organizations:getProject
      arguments: {}

Import

UserStore can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/userStores/{{user_store_id}}
  • {{project}}/{{location}}/{{user_store_id}}
  • {{location}}/{{user_store_id}}

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

$ pulumi import gcp:discoveryengine/userStore:UserStore default projects/{{project}}/locations/{{location}}/userStores/{{user_store_id}}
$ pulumi import gcp:discoveryengine/userStore:UserStore default {{project}}/{{location}}/{{user_store_id}}
$ pulumi import gcp:discoveryengine/userStore:UserStore default {{location}}/{{user_store_id}}

Constructors

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

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
defaultLicenseConfig ↔ Output<String?>
The resource name of the default license config assigned to users created in this user store. Format: projects/{project}/locations/{location}/licenseConfigs/{license_config}. If enableLicenseAutoRegister is true, new users will automatically register under the default subscription. If the default license config doesn't have remaining license seats left, new users will not be assigned with license.
latefinal
enableExpiredLicenseAutoUpdate ↔ Output<bool?>
Whether to enable automatic license update for users with expired licenses in this user store. If enabled, users with expired licenses will automatically be updated to the default subscription if there are remaining license seats.
latefinal
enableLicenseAutoRegister ↔ Output<bool?>
Whether to enable automatic license registration for new users created in this user store. If enabled, new users will automatically register under the default subscription.
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 user store. Values are of the format projects/{project}/locations/{location}/userStores/{user_store_id}.
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
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
userStoreId ↔ Output<String?>
The ID of the user store. Currently only accepts "defaultUserStore".
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, {UserStoreState? state, CustomResourceOptions? options}) → UserStore
Gets an existing UserStore resource's state with the given name and id.