
com.pulumi.azure.streamanalytics.kotlin.OutputCosmosdbArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.streamanalytics.kotlin
import com.pulumi.azure.streamanalytics.OutputCosmosdbArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages a Stream Analytics Output to CosmosDB.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const exampleResourceGroup = new azure.core.ResourceGroup("example", {
* name: "rg-example",
* location: "West Europe",
* });
* const example = azure.streamanalytics.getJobOutput({
* name: "example-job",
* resourceGroupName: exampleResourceGroup.name,
* });
* const exampleAccount = new azure.cosmosdb.Account("example", {
* name: "exampledb",
* resourceGroupName: exampleResourceGroup.name,
* location: exampleResourceGroup.location,
* offerType: "Standard",
* kind: "GlobalDocumentDB",
* consistencyPolicy: {
* consistencyLevel: "BoundedStaleness",
* maxIntervalInSeconds: 10,
* maxStalenessPrefix: 200,
* },
* geoLocations: [{
* location: exampleResourceGroup.location,
* failoverPriority: 0,
* }],
* });
* const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("example", {
* name: "cosmos-sql-db",
* resourceGroupName: exampleAccount.resourceGroupName,
* accountName: exampleAccount.name,
* throughput: 400,
* });
* const exampleSqlContainer = new azure.cosmosdb.SqlContainer("example", {
* name: "examplecontainer",
* resourceGroupName: exampleAccount.resourceGroupName,
* accountName: exampleAccount.name,
* databaseName: exampleSqlDatabase.name,
* partitionKeyPath: "foo",
* });
* const exampleOutputCosmosdb = new azure.streamanalytics.OutputCosmosdb("example", {
* name: "output-to-cosmosdb",
* streamAnalyticsJobId: example.apply(example => example.id),
* cosmosdbAccountKey: exampleAccount.primaryKey,
* cosmosdbSqlDatabaseId: exampleSqlDatabase.id,
* containerName: exampleSqlContainer.name,
* documentId: "exampledocumentid",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example_resource_group = azure.core.ResourceGroup("example",
* name="rg-example",
* location="West Europe")
* example = azure.streamanalytics.get_job_output(name="example-job",
* resource_group_name=example_resource_group.name)
* example_account = azure.cosmosdb.Account("example",
* name="exampledb",
* resource_group_name=example_resource_group.name,
* location=example_resource_group.location,
* offer_type="Standard",
* kind="GlobalDocumentDB",
* consistency_policy={
* "consistency_level": "BoundedStaleness",
* "max_interval_in_seconds": 10,
* "max_staleness_prefix": 200,
* },
* geo_locations=[{
* "location": example_resource_group.location,
* "failover_priority": 0,
* }])
* example_sql_database = azure.cosmosdb.SqlDatabase("example",
* name="cosmos-sql-db",
* resource_group_name=example_account.resource_group_name,
* account_name=example_account.name,
* throughput=400)
* example_sql_container = azure.cosmosdb.SqlContainer("example",
* name="examplecontainer",
* resource_group_name=example_account.resource_group_name,
* account_name=example_account.name,
* database_name=example_sql_database.name,
* partition_key_path="foo")
* example_output_cosmosdb = azure.streamanalytics.OutputCosmosdb("example",
* name="output-to-cosmosdb",
* stream_analytics_job_id=example.id,
* cosmosdb_account_key=example_account.primary_key,
* cosmosdb_sql_database_id=example_sql_database.id,
* container_name=example_sql_container.name,
* document_id="exampledocumentid")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "rg-example",
* Location = "West Europe",
* });
* var example = Azure.StreamAnalytics.GetJob.Invoke(new()
* {
* Name = "example-job",
* ResourceGroupName = exampleResourceGroup.Name,
* });
* var exampleAccount = new Azure.CosmosDB.Account("example", new()
* {
* Name = "exampledb",
* ResourceGroupName = exampleResourceGroup.Name,
* Location = exampleResourceGroup.Location,
* OfferType = "Standard",
* Kind = "GlobalDocumentDB",
* ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs
* {
* ConsistencyLevel = "BoundedStaleness",
* MaxIntervalInSeconds = 10,
* MaxStalenessPrefix = 200,
* },
* GeoLocations = new[]
* {
* new Azure.CosmosDB.Inputs.AccountGeoLocationArgs
* {
* Location = exampleResourceGroup.Location,
* FailoverPriority = 0,
* },
* },
* });
* var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("example", new()
* {
* Name = "cosmos-sql-db",
* ResourceGroupName = exampleAccount.ResourceGroupName,
* AccountName = exampleAccount.Name,
* Throughput = 400,
* });
* var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("example", new()
* {
* Name = "examplecontainer",
* ResourceGroupName = exampleAccount.ResourceGroupName,
* AccountName = exampleAccount.Name,
* DatabaseName = exampleSqlDatabase.Name,
* PartitionKeyPath = "foo",
* });
* var exampleOutputCosmosdb = new Azure.StreamAnalytics.OutputCosmosdb("example", new()
* {
* Name = "output-to-cosmosdb",
* StreamAnalyticsJobId = example.Apply(getJobResult => getJobResult.Id),
* CosmosdbAccountKey = exampleAccount.PrimaryKey,
* CosmosdbSqlDatabaseId = exampleSqlDatabase.Id,
* ContainerName = exampleSqlContainer.Name,
* DocumentId = "exampledocumentid",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("rg-example"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* example := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{
* Name: pulumi.String("example-job"),
* ResourceGroupName: exampleResourceGroup.Name,
* }, nil)
* exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
* Name: pulumi.String("exampledb"),
* ResourceGroupName: exampleResourceGroup.Name,
* Location: exampleResourceGroup.Location,
* OfferType: pulumi.String("Standard"),
* Kind: pulumi.String("GlobalDocumentDB"),
* ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
* ConsistencyLevel: pulumi.String("BoundedStaleness"),
* MaxIntervalInSeconds: pulumi.Int(10),
* MaxStalenessPrefix: pulumi.Int(200),
* },
* GeoLocations: cosmosdb.AccountGeoLocationArray{
* &cosmosdb.AccountGeoLocationArgs{
* Location: exampleResourceGroup.Location,
* FailoverPriority: pulumi.Int(0),
* },
* },
* })
* if err != nil {
* return err
* }
* exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "example", &cosmosdb.SqlDatabaseArgs{
* Name: pulumi.String("cosmos-sql-db"),
* ResourceGroupName: exampleAccount.ResourceGroupName,
* AccountName: exampleAccount.Name,
* Throughput: pulumi.Int(400),
* })
* if err != nil {
* return err
* }
* exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "example", &cosmosdb.SqlContainerArgs{
* Name: pulumi.String("examplecontainer"),
* ResourceGroupName: exampleAccount.ResourceGroupName,
* AccountName: exampleAccount.Name,
* DatabaseName: exampleSqlDatabase.Name,
* PartitionKeyPath: pulumi.String("foo"),
* })
* if err != nil {
* return err
* }
* _, err = streamanalytics.NewOutputCosmosdb(ctx, "example", &streamanalytics.OutputCosmosdbArgs{
* Name: pulumi.String("output-to-cosmosdb"),
* StreamAnalyticsJobId: pulumi.String(example.ApplyT(func(example streamanalytics.GetJobResult) (*string, error) {
* return &example.Id, nil
* }).(pulumi.StringPtrOutput)),
* CosmosdbAccountKey: exampleAccount.PrimaryKey,
* CosmosdbSqlDatabaseId: exampleSqlDatabase.ID(),
* ContainerName: exampleSqlContainer.Name,
* DocumentId: pulumi.String("exampledocumentid"),
* })
* 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.streamanalytics.StreamanalyticsFunctions;
* import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
* import com.pulumi.azure.cosmosdb.Account;
* import com.pulumi.azure.cosmosdb.AccountArgs;
* import com.pulumi.azure.cosmosdb.inputs.AccountConsistencyPolicyArgs;
* import com.pulumi.azure.cosmosdb.inputs.AccountGeoLocationArgs;
* import com.pulumi.azure.cosmosdb.SqlDatabase;
* import com.pulumi.azure.cosmosdb.SqlDatabaseArgs;
* import com.pulumi.azure.cosmosdb.SqlContainer;
* import com.pulumi.azure.cosmosdb.SqlContainerArgs;
* import com.pulumi.azure.streamanalytics.OutputCosmosdb;
* import com.pulumi.azure.streamanalytics.OutputCosmosdbArgs;
* 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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .name("rg-example")
* .location("West Europe")
* .build());
* final var example = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
* .name("example-job")
* .resourceGroupName(exampleResourceGroup.name())
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("exampledb")
* .resourceGroupName(exampleResourceGroup.name())
* .location(exampleResourceGroup.location())
* .offerType("Standard")
* .kind("GlobalDocumentDB")
* .consistencyPolicy(AccountConsistencyPolicyArgs.builder()
* .consistencyLevel("BoundedStaleness")
* .maxIntervalInSeconds(10)
* .maxStalenessPrefix(200)
* .build())
* .geoLocations(AccountGeoLocationArgs.builder()
* .location(exampleResourceGroup.location())
* .failoverPriority(0)
* .build())
* .build());
* var exampleSqlDatabase = new SqlDatabase("exampleSqlDatabase", SqlDatabaseArgs.builder()
* .name("cosmos-sql-db")
* .resourceGroupName(exampleAccount.resourceGroupName())
* .accountName(exampleAccount.name())
* .throughput(400)
* .build());
* var exampleSqlContainer = new SqlContainer("exampleSqlContainer", SqlContainerArgs.builder()
* .name("examplecontainer")
* .resourceGroupName(exampleAccount.resourceGroupName())
* .accountName(exampleAccount.name())
* .databaseName(exampleSqlDatabase.name())
* .partitionKeyPath("foo")
* .build());
* var exampleOutputCosmosdb = new OutputCosmosdb("exampleOutputCosmosdb", OutputCosmosdbArgs.builder()
* .name("output-to-cosmosdb")
* .streamAnalyticsJobId(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.id())))
* .cosmosdbAccountKey(exampleAccount.primaryKey())
* .cosmosdbSqlDatabaseId(exampleSqlDatabase.id())
* .containerName(exampleSqlContainer.name())
* .documentId("exampledocumentid")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleResourceGroup:
* type: azure:core:ResourceGroup
* name: example
* properties:
* name: rg-example
* location: West Europe
* exampleAccount:
* type: azure:cosmosdb:Account
* name: example
* properties:
* name: exampledb
* resourceGroupName: ${exampleResourceGroup.name}
* location: ${exampleResourceGroup.location}
* offerType: Standard
* kind: GlobalDocumentDB
* consistencyPolicy:
* consistencyLevel: BoundedStaleness
* maxIntervalInSeconds: 10
* maxStalenessPrefix: 200
* geoLocations:
* - location: ${exampleResourceGroup.location}
* failoverPriority: 0
* exampleSqlDatabase:
* type: azure:cosmosdb:SqlDatabase
* name: example
* properties:
* name: cosmos-sql-db
* resourceGroupName: ${exampleAccount.resourceGroupName}
* accountName: ${exampleAccount.name}
* throughput: 400
* exampleSqlContainer:
* type: azure:cosmosdb:SqlContainer
* name: example
* properties:
* name: examplecontainer
* resourceGroupName: ${exampleAccount.resourceGroupName}
* accountName: ${exampleAccount.name}
* databaseName: ${exampleSqlDatabase.name}
* partitionKeyPath: foo
* exampleOutputCosmosdb:
* type: azure:streamanalytics:OutputCosmosdb
* name: example
* properties:
* name: output-to-cosmosdb
* streamAnalyticsJobId: ${example.id}
* cosmosdbAccountKey: ${exampleAccount.primaryKey}
* cosmosdbSqlDatabaseId: ${exampleSqlDatabase.id}
* containerName: ${exampleSqlContainer.name}
* documentId: exampledocumentid
* variables:
* example:
* fn::invoke:
* Function: azure:streamanalytics:getJob
* Arguments:
* name: example-job
* resourceGroupName: ${exampleResourceGroup.name}
* ```
*
* ## Import
* Stream Analytics Outputs for CosmosDB can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:streamanalytics/outputCosmosdb:OutputCosmosdb example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1
* ```
* @property containerName The name of the CosmosDB container.
* @property cosmosdbAccountKey The account key for the CosmosDB database.
* @property cosmosdbSqlDatabaseId The ID of the CosmosDB database.
* @property documentId The name of the field in output events used to specify the primary key which insert or update operations are based on.
* @property name The name of the Stream Analytics Output. Changing this forces a new resource to be created.
* @property partitionKey The name of the field in output events used to specify the key for partitioning output across collections. If `container_name` contains `{partition}` token, this property is required to be specified.
* @property streamAnalyticsJobId The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
public data class OutputCosmosdbArgs(
public val containerName: Output? = null,
public val cosmosdbAccountKey: Output? = null,
public val cosmosdbSqlDatabaseId: Output? = null,
public val documentId: Output? = null,
public val name: Output? = null,
public val partitionKey: Output? = null,
public val streamAnalyticsJobId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.streamanalytics.OutputCosmosdbArgs =
com.pulumi.azure.streamanalytics.OutputCosmosdbArgs.builder()
.containerName(containerName?.applyValue({ args0 -> args0 }))
.cosmosdbAccountKey(cosmosdbAccountKey?.applyValue({ args0 -> args0 }))
.cosmosdbSqlDatabaseId(cosmosdbSqlDatabaseId?.applyValue({ args0 -> args0 }))
.documentId(documentId?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.partitionKey(partitionKey?.applyValue({ args0 -> args0 }))
.streamAnalyticsJobId(streamAnalyticsJobId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [OutputCosmosdbArgs].
*/
@PulumiTagMarker
public class OutputCosmosdbArgsBuilder internal constructor() {
private var containerName: Output? = null
private var cosmosdbAccountKey: Output? = null
private var cosmosdbSqlDatabaseId: Output? = null
private var documentId: Output? = null
private var name: Output? = null
private var partitionKey: Output? = null
private var streamAnalyticsJobId: Output? = null
/**
* @param value The name of the CosmosDB container.
*/
@JvmName("qfqyrvooypgctupi")
public suspend fun containerName(`value`: Output) {
this.containerName = value
}
/**
* @param value The account key for the CosmosDB database.
*/
@JvmName("wrojlaaxbahpaskv")
public suspend fun cosmosdbAccountKey(`value`: Output) {
this.cosmosdbAccountKey = value
}
/**
* @param value The ID of the CosmosDB database.
*/
@JvmName("cikwessiswcvngri")
public suspend fun cosmosdbSqlDatabaseId(`value`: Output) {
this.cosmosdbSqlDatabaseId = value
}
/**
* @param value The name of the field in output events used to specify the primary key which insert or update operations are based on.
*/
@JvmName("mtrodxhmoyxxpcnn")
public suspend fun documentId(`value`: Output) {
this.documentId = value
}
/**
* @param value The name of the Stream Analytics Output. Changing this forces a new resource to be created.
*/
@JvmName("yfdyjpcgiibxaafv")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The name of the field in output events used to specify the key for partitioning output across collections. If `container_name` contains `{partition}` token, this property is required to be specified.
*/
@JvmName("ucndwxfnnpwveuor")
public suspend fun partitionKey(`value`: Output) {
this.partitionKey = value
}
/**
* @param value The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
@JvmName("ydvspbfcgbsqihxw")
public suspend fun streamAnalyticsJobId(`value`: Output) {
this.streamAnalyticsJobId = value
}
/**
* @param value The name of the CosmosDB container.
*/
@JvmName("fdgrqwiotejtetol")
public suspend fun containerName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.containerName = mapped
}
/**
* @param value The account key for the CosmosDB database.
*/
@JvmName("mgnrbrnuqadngtfs")
public suspend fun cosmosdbAccountKey(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cosmosdbAccountKey = mapped
}
/**
* @param value The ID of the CosmosDB database.
*/
@JvmName("iqncdnylpxdqcdat")
public suspend fun cosmosdbSqlDatabaseId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cosmosdbSqlDatabaseId = mapped
}
/**
* @param value The name of the field in output events used to specify the primary key which insert or update operations are based on.
*/
@JvmName("riahjmpgoibawkis")
public suspend fun documentId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.documentId = mapped
}
/**
* @param value The name of the Stream Analytics Output. Changing this forces a new resource to be created.
*/
@JvmName("kdreelepdjxxhwvs")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The name of the field in output events used to specify the key for partitioning output across collections. If `container_name` contains `{partition}` token, this property is required to be specified.
*/
@JvmName("tsemvqjtiwcgnkni")
public suspend fun partitionKey(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.partitionKey = mapped
}
/**
* @param value The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
@JvmName("psylkullkyrgxuls")
public suspend fun streamAnalyticsJobId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.streamAnalyticsJobId = mapped
}
internal fun build(): OutputCosmosdbArgs = OutputCosmosdbArgs(
containerName = containerName,
cosmosdbAccountKey = cosmosdbAccountKey,
cosmosdbSqlDatabaseId = cosmosdbSqlDatabaseId,
documentId = documentId,
name = name,
partitionKey = partitionKey,
streamAnalyticsJobId = streamAnalyticsJobId,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy