Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.cognitive.kotlin
import com.pulumi.azure.cognitive.kotlin.outputs.AccountCustomerManagedKey
import com.pulumi.azure.cognitive.kotlin.outputs.AccountIdentity
import com.pulumi.azure.cognitive.kotlin.outputs.AccountNetworkAcls
import com.pulumi.azure.cognitive.kotlin.outputs.AccountStorage
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
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.cognitive.kotlin.outputs.AccountCustomerManagedKey.Companion.toKotlin as accountCustomerManagedKeyToKotlin
import com.pulumi.azure.cognitive.kotlin.outputs.AccountIdentity.Companion.toKotlin as accountIdentityToKotlin
import com.pulumi.azure.cognitive.kotlin.outputs.AccountNetworkAcls.Companion.toKotlin as accountNetworkAclsToKotlin
import com.pulumi.azure.cognitive.kotlin.outputs.AccountStorage.Companion.toKotlin as accountStorageToKotlin
/**
* Builder for [Account].
*/
@PulumiTagMarker
public class AccountResourceBuilder internal constructor() {
public var name: String? = null
public var args: AccountArgs = AccountArgs()
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 AccountArgsBuilder.() -> Unit) {
val builder = AccountArgsBuilder()
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(): Account {
val builtJavaResource = com.pulumi.azure.cognitive.Account(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Account(builtJavaResource)
}
}
/**
* Manages a Cognitive Services Account.
* > **Note:** Version v2.65.0 of the Azure Provider and later will attempt to Purge the Cognitive Account during deletion. This feature can be disabled using the `features` block within the `provider` block, see the provider documentation on the features block for more information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleAccount = new azure.cognitive.Account("example", {
* name: "example-account",
* location: example.location,
* resourceGroupName: example.name,
* kind: "Face",
* skuName: "S0",
* tags: {
* Acceptance: "Test",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_account = azure.cognitive.Account("example",
* name="example-account",
* location=example.location,
* resource_group_name=example.name,
* kind="Face",
* sku_name="S0",
* tags={
* "Acceptance": "Test",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleAccount = new Azure.Cognitive.Account("example", new()
* {
* Name = "example-account",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Kind = "Face",
* SkuName = "S0",
* Tags =
* {
* { "Acceptance", "Test" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* _, err = cognitive.NewAccount(ctx, "example", &cognitive.AccountArgs{
* Name: pulumi.String("example-account"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Kind: pulumi.String("Face"),
* SkuName: pulumi.String("S0"),
* Tags: pulumi.StringMap{
* "Acceptance": pulumi.String("Test"),
* },
* })
* 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.cognitive.Account;
* import com.pulumi.azure.cognitive.AccountArgs;
* 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("example-account")
* .location(example.location())
* .resourceGroupName(example.name())
* .kind("Face")
* .skuName("S0")
* .tags(Map.of("Acceptance", "Test"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleAccount:
* type: azure:cognitive:Account
* name: example
* properties:
* name: example-account
* location: ${example.location}
* resourceGroupName: ${example.name}
* kind: Face
* skuName: S0
* tags:
* Acceptance: Test
* ```
*
* ## Import
* Cognitive Service Accounts can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:cognitive/account:Account account1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.CognitiveServices/accounts/account1
* ```
*/
public class Account internal constructor(
override val javaResource: com.pulumi.azure.cognitive.Account,
) : KotlinCustomResource(javaResource, AccountMapper) {
/**
* If `kind` is `TextAnalytics` this specifies the ID of the Search service.
*/
public val customQuestionAnsweringSearchServiceId: Output?
get() = javaResource.customQuestionAnsweringSearchServiceId().applyValue({ args0 ->
args0.map({ args0 -> args0 }).orElse(null)
})
/**
* If `kind` is `TextAnalytics` this specifies the key of the Search service.
* > **NOTE:** `custom_question_answering_search_service_id` and `custom_question_answering_search_service_key` are used for [Custom Question Answering, the renamed version of QnA Maker](https://docs.microsoft.com/azure/cognitive-services/qnamaker/custom-question-answering), while `qna_runtime_endpoint` is used for [the old version of QnA Maker](https://docs.microsoft.com/azure/cognitive-services/qnamaker/overview/overview)
*/
public val customQuestionAnsweringSearchServiceKey: Output?
get() = javaResource.customQuestionAnsweringSearchServiceKey().applyValue({ args0 ->
args0.map({ args0 -> args0 }).orElse(null)
})
/**
* The subdomain name used for token-based authentication. This property is required when `network_acls` is specified. This property is also required when using the OpenAI service with libraries which assume the Azure OpenAI endpoint is a subdomain on `https://openai.azure.com/`, eg. `https://.openai.azure.com/`. Changing this forces a new resource to be created.
*/
public val customSubdomainName: Output?
get() = javaResource.customSubdomainName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A `customer_managed_key` block as documented below.
*/
public val customerManagedKey: Output?
get() = javaResource.customerManagedKey().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> accountCustomerManagedKeyToKotlin(args0) })
}).orElse(null)
})
/**
* Whether to enable the dynamic throttling for this Cognitive Service Account.
*/
public val dynamicThrottlingEnabled: Output?
get() = javaResource.dynamicThrottlingEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The endpoint used to connect to the Cognitive Service Account.
*/
public val endpoint: Output
get() = javaResource.endpoint().applyValue({ args0 -> args0 })
/**
* List of FQDNs allowed for the Cognitive Account.
*/
public val fqdns: Output>?
get() = javaResource.fqdns().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* An `identity` block as defined below.
*/
public val identity: Output?
get() = javaResource.identity().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
accountIdentityToKotlin(args0)
})
}).orElse(null)
})
/**
* Specifies the type of Cognitive Service Account that should be created. Possible values are `Academic`, `AnomalyDetector`, `Bing.Autosuggest`, `Bing.Autosuggest.v7`, `Bing.CustomSearch`, `Bing.Search`, `Bing.Search.v7`, `Bing.Speech`, `Bing.SpellCheck`, `Bing.SpellCheck.v7`, `CognitiveServices`, `ComputerVision`, `ContentModerator`, `ContentSafety`, `CustomSpeech`, `CustomVision.Prediction`, `CustomVision.Training`, `Emotion`, `Face`, `FormRecognizer`, `ImmersiveReader`, `LUIS`, `LUIS.Authoring`, `MetricsAdvisor`, `OpenAI`, `Personalizer`, `QnAMaker`, `Recommendations`, `SpeakerRecognition`, `Speech`, `SpeechServices`, `SpeechTranslation`, `TextAnalytics`, `TextTranslation` and `WebLM`. Changing this forces a new resource to be created.
* > **NOTE:** New Bing Search resources cannot be created as their APIs are moving from Cognitive Services Platform to new surface area under Microsoft.com. Starting from October 30, 2020, existing instances of Bing Search APIs provisioned via Cognitive Services will be continuously supported for next 3 years or till the end of respective Enterprise Agreement, whichever happens first.
* > **NOTE:** You must create your first Face, Text Analytics, or Computer Vision resources from the Azure portal to review and acknowledge the terms and conditions. In Azure Portal, the checkbox to accept terms and conditions is only displayed when a US region is selected. More information on [Prerequisites](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli?tabs=windows#prerequisites).
*/
public val kind: Output
get() = javaResource.kind().applyValue({ args0 -> args0 })
/**
* Whether local authentication methods is enabled for the Cognitive Account. Defaults to `true`.
*/
public val localAuthEnabled: Output?
get() = javaResource.localAuthEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The Azure AD Client ID (Application ID). This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created.
*/
public val metricsAdvisorAadClientId: Output?
get() = javaResource.metricsAdvisorAadClientId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Azure AD Tenant ID. This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created.
*/
public val metricsAdvisorAadTenantId: Output?
get() = javaResource.metricsAdvisorAadTenantId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The super user of Metrics Advisor. This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created.
*/
public val metricsAdvisorSuperUserName: Output?
get() = javaResource.metricsAdvisorSuperUserName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The website name of Metrics Advisor. This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created.
* > **NOTE:** This URL is mandatory if the `kind` is set to `QnAMaker`.
*/
public val metricsAdvisorWebsiteName: Output?
get() = javaResource.metricsAdvisorWebsiteName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the name of the Cognitive Service Account. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* A `network_acls` block as defined below. When this property is specified, `custom_subdomain_name` is also required to be set.
*/
public val networkAcls: Output?
get() = javaResource.networkAcls().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
accountNetworkAclsToKotlin(args0)
})
}).orElse(null)
})
/**
* Whether outbound network access is restricted for the Cognitive Account. Defaults to `false`.
*/
public val outboundNetworkAccessRestricted: Output?
get() = javaResource.outboundNetworkAccessRestricted().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A primary access key which can be used to connect to the Cognitive Service Account.
*/
public val primaryAccessKey: Output
get() = javaResource.primaryAccessKey().applyValue({ args0 -> args0 })
/**
* Whether public network access is allowed for the Cognitive Account. Defaults to `true`.
*/
public val publicNetworkAccessEnabled: Output?
get() = javaResource.publicNetworkAccessEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A URL to link a QnAMaker cognitive account to a QnA runtime.
*/
public val qnaRuntimeEndpoint: Output?
get() = javaResource.qnaRuntimeEndpoint().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the resource group in which the Cognitive Service Account is created. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* The secondary access key which can be used to connect to the Cognitive Service Account.
*/
public val secondaryAccessKey: Output
get() = javaResource.secondaryAccessKey().applyValue({ args0 -> args0 })
/**
* Specifies the SKU Name for this Cognitive Service Account. Possible values are `F0`, `F1`, `S0`, `S`, `S1`, `S2`, `S3`, `S4`, `S5`, `S6`, `P0`, `P1`, `P2`, `E0` and `DC0`.
* > **NOTE:** SKU `DC0` is the commitment tier for Cognitive Services containers running in disconnected environments. You must obtain approval from Microsoft by submitting the [request form](https://aka.ms/csdisconnectedcontainers) first, before you can use this SKU. More information on [Purchase a commitment plan to use containers in disconnected environments](https://learn.microsoft.com/en-us/azure/cognitive-services/containers/disconnected-containers?tabs=stt#purchase-a-commitment-plan-to-use-containers-in-disconnected-environments).
*/
public val skuName: Output
get() = javaResource.skuName().applyValue({ args0 -> args0 })
/**
* A `storage` block as defined below.
*/
public val storages: Output>?
get() = javaResource.storages().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> accountStorageToKotlin(args0) })
})
}).orElse(null)
})
/**
* A mapping of tags to assign to the resource.
*/
public val tags: Output