All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.search.kotlin.SharedPrivateLinkService.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.search.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [SharedPrivateLinkService].
 */
@PulumiTagMarker
public class SharedPrivateLinkServiceResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: SharedPrivateLinkServiceArgs = SharedPrivateLinkServiceArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend SharedPrivateLinkServiceArgsBuilder.() -> Unit) {
        val builder = SharedPrivateLinkServiceArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): SharedPrivateLinkService {
        val builtJavaResource =
            com.pulumi.azure.search.SharedPrivateLinkService(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return SharedPrivateLinkService(builtJavaResource)
    }
}

/**
 * Manages the Shared Private Link Service for an Azure Search Service.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const test = new azure.core.ResourceGroup("test", {
 *     name: "example-resourceGroup",
 *     location: "east us",
 * });
 * const testService = new azure.search.Service("test", {
 *     name: "example-search",
 *     resourceGroupName: test.name,
 *     location: test.location,
 *     sku: "standard",
 * });
 * const testAccount = new azure.storage.Account("test", {
 *     name: "xiaxintestsaforsearchspl",
 *     resourceGroupName: test.name,
 *     location: test.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const testSharedPrivateLinkService = new azure.search.SharedPrivateLinkService("test", {
 *     name: "example-spl",
 *     searchServiceId: testService.id,
 *     subresourceName: "blob",
 *     targetResourceId: testAccount.id,
 *     requestMessage: "please approve",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * test = azure.core.ResourceGroup("test",
 *     name="example-resourceGroup",
 *     location="east us")
 * test_service = azure.search.Service("test",
 *     name="example-search",
 *     resource_group_name=test.name,
 *     location=test.location,
 *     sku="standard")
 * test_account = azure.storage.Account("test",
 *     name="xiaxintestsaforsearchspl",
 *     resource_group_name=test.name,
 *     location=test.location,
 *     account_tier="Standard",
 *     account_replication_type="LRS")
 * test_shared_private_link_service = azure.search.SharedPrivateLinkService("test",
 *     name="example-spl",
 *     search_service_id=test_service.id,
 *     subresource_name="blob",
 *     target_resource_id=test_account.id,
 *     request_message="please approve")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Azure.Core.ResourceGroup("test", new()
 *     {
 *         Name = "example-resourceGroup",
 *         Location = "east us",
 *     });
 *     var testService = new Azure.Search.Service("test", new()
 *     {
 *         Name = "example-search",
 *         ResourceGroupName = test.Name,
 *         Location = test.Location,
 *         Sku = "standard",
 *     });
 *     var testAccount = new Azure.Storage.Account("test", new()
 *     {
 *         Name = "xiaxintestsaforsearchspl",
 *         ResourceGroupName = test.Name,
 *         Location = test.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "LRS",
 *     });
 *     var testSharedPrivateLinkService = new Azure.Search.SharedPrivateLinkService("test", new()
 *     {
 *         Name = "example-spl",
 *         SearchServiceId = testService.Id,
 *         SubresourceName = "blob",
 *         TargetResourceId = testAccount.Id,
 *         RequestMessage = "please approve",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/search"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		test, err := core.NewResourceGroup(ctx, "test", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resourceGroup"),
 * 			Location: pulumi.String("east us"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		testService, err := search.NewService(ctx, "test", &search.ServiceArgs{
 * 			Name:              pulumi.String("example-search"),
 * 			ResourceGroupName: test.Name,
 * 			Location:          test.Location,
 * 			Sku:               pulumi.String("standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		testAccount, err := storage.NewAccount(ctx, "test", &storage.AccountArgs{
 * 			Name:                   pulumi.String("xiaxintestsaforsearchspl"),
 * 			ResourceGroupName:      test.Name,
 * 			Location:               test.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("LRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = search.NewSharedPrivateLinkService(ctx, "test", &search.SharedPrivateLinkServiceArgs{
 * 			Name:             pulumi.String("example-spl"),
 * 			SearchServiceId:  testService.ID(),
 * 			SubresourceName:  pulumi.String("blob"),
 * 			TargetResourceId: testAccount.ID(),
 * 			RequestMessage:   pulumi.String("please approve"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.search.Service;
 * import com.pulumi.azure.search.ServiceArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.search.SharedPrivateLinkService;
 * import com.pulumi.azure.search.SharedPrivateLinkServiceArgs;
 * 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 test = new ResourceGroup("test", ResourceGroupArgs.builder()
 *             .name("example-resourceGroup")
 *             .location("east us")
 *             .build());
 *         var testService = new Service("testService", ServiceArgs.builder()
 *             .name("example-search")
 *             .resourceGroupName(test.name())
 *             .location(test.location())
 *             .sku("standard")
 *             .build());
 *         var testAccount = new Account("testAccount", AccountArgs.builder()
 *             .name("xiaxintestsaforsearchspl")
 *             .resourceGroupName(test.name())
 *             .location(test.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("LRS")
 *             .build());
 *         var testSharedPrivateLinkService = new SharedPrivateLinkService("testSharedPrivateLinkService", SharedPrivateLinkServiceArgs.builder()
 *             .name("example-spl")
 *             .searchServiceId(testService.id())
 *             .subresourceName("blob")
 *             .targetResourceId(testAccount.id())
 *             .requestMessage("please approve")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resourceGroup
 *       location: east us
 *   testService:
 *     type: azure:search:Service
 *     name: test
 *     properties:
 *       name: example-search
 *       resourceGroupName: ${test.name}
 *       location: ${test.location}
 *       sku: standard
 *   testAccount:
 *     type: azure:storage:Account
 *     name: test
 *     properties:
 *       name: xiaxintestsaforsearchspl
 *       resourceGroupName: ${test.name}
 *       location: ${test.location}
 *       accountTier: Standard
 *       accountReplicationType: LRS
 *   testSharedPrivateLinkService:
 *     type: azure:search:SharedPrivateLinkService
 *     name: test
 *     properties:
 *       name: example-spl
 *       searchServiceId: ${testService.id}
 *       subresourceName: blob
 *       targetResourceId: ${testAccount.id}
 *       requestMessage: please approve
 * ```
 * 
 * ## Import
 * Azure Search Shared Private Link Resource can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:search/sharedPrivateLinkService:SharedPrivateLinkService example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Search/searchServices/service1/sharedPrivateLinkResources/resource1
 * ```
 */
public class SharedPrivateLinkService internal constructor(
    override val javaResource: com.pulumi.azure.search.SharedPrivateLinkService,
) : KotlinCustomResource(javaResource, SharedPrivateLinkServiceMapper) {
    /**
     * Specify the name of the Azure Search Shared Private Link Resource. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Specify the request message for requesting approval of the Shared Private Link Enabled Remote Resource.
     */
    public val requestMessage: Output?
        get() = javaResource.requestMessage().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specify the id of the Azure Search Service. Changing this forces a new resource to be created.
     */
    public val searchServiceId: Output
        get() = javaResource.searchServiceId().applyValue({ args0 -> args0 })

    /**
     * The status of a private endpoint connection. Possible values are Pending, Approved, Rejected or Disconnected.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * Specify the sub resource name which the Azure Search Private Endpoint is able to connect to. Changing this forces a new resource to be created.
     */
    public val subresourceName: Output
        get() = javaResource.subresourceName().applyValue({ args0 -> args0 })

    /**
     * Specify the ID of the Shared Private Link Enabled Remote Resource which this Azure Search Private Endpoint should be connected to. Changing this forces a new resource to be created.
     * > **NOTE:** The sub resource name should match with the type of the target resource id that's being specified.
     */
    public val targetResourceId: Output
        get() = javaResource.targetResourceId().applyValue({ args0 -> args0 })
}

public object SharedPrivateLinkServiceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.search.SharedPrivateLinkService::class == javaResource::class

    override fun map(javaResource: Resource): SharedPrivateLinkService =
        SharedPrivateLinkService(javaResource as com.pulumi.azure.search.SharedPrivateLinkService)
}

/**
 * @see [SharedPrivateLinkService].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [SharedPrivateLinkService].
 */
public suspend fun sharedPrivateLinkService(
    name: String,
    block: suspend SharedPrivateLinkServiceResourceBuilder.() -> Unit,
): SharedPrivateLinkService {
    val builder = SharedPrivateLinkServiceResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [SharedPrivateLinkService].
 * @param name The _unique_ name of the resulting resource.
 */
public fun sharedPrivateLinkService(name: String): SharedPrivateLinkService {
    val builder = SharedPrivateLinkServiceResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy