Class Service


  • public class Service
    extends com.pulumi.resources.CustomResource
    Describes an Azure Cognitive Search service and its current state. Azure REST API version: 2022-09-01. Prior API version in Azure Native 1.x: 2020-08-01. Other available API versions: 2021-04-01-preview, 2023-11-01. ## Example Usage ### SearchCreateOrUpdateService ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.azurenative.search.Service; import com.pulumi.azurenative.search.ServiceArgs; 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) { var service = new Service("service", ServiceArgs.builder() .hostingMode("default") .location("westus") .partitionCount(1) .replicaCount(3) .resourceGroupName("rg1") .searchServiceName("mysearchservice") .sku(Map.of("name", "standard")) .tags(Map.of("app-name", "My e-commerce app")) .build()); } } ``` ### SearchCreateOrUpdateServiceAuthOptions ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.azurenative.search.Service; import com.pulumi.azurenative.search.ServiceArgs; 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) { var service = new Service("service", ServiceArgs.builder() .authOptions(Map.of("aadOrApiKey", Map.of("aadAuthFailureMode", "http401WithBearerChallenge"))) .hostingMode("default") .location("westus") .partitionCount(1) .replicaCount(3) .resourceGroupName("rg1") .searchServiceName("mysearchservice") .sku(Map.of("name", "standard")) .tags(Map.of("app-name", "My e-commerce app")) .build()); } } ``` ### SearchCreateOrUpdateServiceDisableLocalAuth ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.azurenative.search.Service; import com.pulumi.azurenative.search.ServiceArgs; 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) { var service = new Service("service", ServiceArgs.builder() .disableLocalAuth(true) .hostingMode("default") .location("westus") .partitionCount(1) .replicaCount(3) .resourceGroupName("rg1") .searchServiceName("mysearchservice") .sku(Map.of("name", "standard")) .tags(Map.of("app-name", "My e-commerce app")) .build()); } } ``` ### SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.azurenative.search.Service; import com.pulumi.azurenative.search.ServiceArgs; 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) { var service = new Service("service", ServiceArgs.builder() .hostingMode("default") .location("westus") .partitionCount(1) .publicNetworkAccess("disabled") .replicaCount(3) .resourceGroupName("rg1") .searchServiceName("mysearchservice") .sku(Map.of("name", "standard")) .tags(Map.of("app-name", "My e-commerce app")) .build()); } } ``` ### SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.azurenative.search.Service; import com.pulumi.azurenative.search.ServiceArgs; 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) { var service = new Service("service", ServiceArgs.builder() .hostingMode("default") .location("westus") .networkRuleSet(Map.of("ipRules", Map.of("value", "123.4.5.6"), Map.of("value", "123.4.6.0/18"))) .partitionCount(1) .replicaCount(1) .resourceGroupName("rg1") .searchServiceName("mysearchservice") .sku(Map.of("name", "standard")) .tags(Map.of("app-name", "My e-commerce app")) .build()); } } ``` ### SearchCreateOrUpdateServiceWithCmkEnforcement ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.azurenative.search.Service; import com.pulumi.azurenative.search.ServiceArgs; 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) { var service = new Service("service", ServiceArgs.builder() .encryptionWithCmk(Map.of("enforcement", "Enabled")) .hostingMode("default") .location("westus") .partitionCount(1) .replicaCount(3) .resourceGroupName("rg1") .searchServiceName("mysearchservice") .sku(Map.of("name", "standard")) .tags(Map.of("app-name", "My e-commerce app")) .build()); } } ``` ### SearchCreateOrUpdateServiceWithIdentity ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.azurenative.search.Service; import com.pulumi.azurenative.search.ServiceArgs; 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) { var service = new Service("service", ServiceArgs.builder() .hostingMode("default") .identity(Map.of("type", "SystemAssigned")) .location("westus") .partitionCount(1) .replicaCount(3) .resourceGroupName("rg1") .searchServiceName("mysearchservice") .sku(Map.of("name", "standard")) .tags(Map.of("app-name", "My e-commerce app")) .build()); } } ``` ## Import An existing resource can be imported using its type token, name, and identifier, e.g. ```sh $ pulumi import azure-native:search:Service mysearchservice /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Service​(java.lang.String name)  
      Service​(java.lang.String name, ServiceArgs args)  
      Service​(java.lang.String name, ServiceArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Constructor Detail

      • Service

        public Service​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Service

        public Service​(java.lang.String name,
                       ServiceArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Service

        public Service​(java.lang.String name,
                       ServiceArgs args,
                       @Nullable
                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • authOptions

        public com.pulumi.core.Output<java.util.Optional<DataPlaneAuthOptionsResponse>> authOptions()
        Returns:
        Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true.
      • disableLocalAuth

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disableLocalAuth()
        Returns:
        When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot be set to true if 'dataPlaneAuthOptions' are defined.
      • encryptionWithCmk

        public com.pulumi.core.Output<java.util.Optional<EncryptionWithCmkResponse>> encryptionWithCmk()
        Returns:
        Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service.
      • hostingMode

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> hostingMode()
        Returns:
        Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'.
      • identity

        public com.pulumi.core.Output<java.util.Optional<IdentityResponse>> identity()
        Returns:
        The identity of the resource.
      • location

        public com.pulumi.core.Output<java.lang.String> location()
        Returns:
        The geo-location where the resource lives
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the resource
      • networkRuleSet

        public com.pulumi.core.Output<java.util.Optional<NetworkRuleSetResponse>> networkRuleSet()
        Returns:
        Network specific rules that determine how the Azure Cognitive Search service may be reached.
      • partitionCount

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> partitionCount()
        Returns:
        The number of partitions in the search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3.
      • privateEndpointConnections

        public com.pulumi.core.Output<java.util.List<PrivateEndpointConnectionResponse>> privateEndpointConnections()
        Returns:
        The list of private endpoint connections to the Azure Cognitive Search service.
      • provisioningState

        public com.pulumi.core.Output<java.lang.String> provisioningState()
        Returns:
        The state of the last provisioning operation performed on the search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'succeeded' directly in the call to Create search service. This is because the free service uses capacity that is already set up.
      • publicNetworkAccess

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> publicNetworkAccess()
        Returns:
        This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method.
      • replicaCount

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> replicaCount()
        Returns:
        The number of replicas in the search service. If specified, it must be a value between 1 and 12 inclusive for standard SKUs or between 1 and 3 inclusive for basic SKU.
      • sharedPrivateLinkResources

        public com.pulumi.core.Output<java.util.List<SharedPrivateLinkResourceResponse>> sharedPrivateLinkResources()
        Returns:
        The list of shared private link resources managed by the Azure Cognitive Search service.
      • sku

        public com.pulumi.core.Output<java.util.Optional<SkuResponse>> sku()
        Returns:
        The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service.
      • status

        public com.pulumi.core.Output<java.lang.String> status()
        Returns:
        The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, it means the Azure Cognitive Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned.
      • statusDetails

        public com.pulumi.core.Output<java.lang.String> statusDetails()
        Returns:
        The details of the search service status.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Resource tags.
      • type

        public com.pulumi.core.Output<java.lang.String> type()
        Returns:
        The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
      • get

        public static Service get​(java.lang.String name,
                                  com.pulumi.core.Output<java.lang.String> id,
                                  @Nullable
                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        options - Optional settings to control the behavior of the CustomResource.