OutputCosmosdb

class OutputCosmosdb : KotlinCustomResource

Manages a Stream Analytics Output to CosmosDB.

Example Usage

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()
.location("West Europe")
.build());
final var exampleJob = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
.name("example-job")
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.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()
.resourceGroupName(exampleAccount.resourceGroupName())
.accountName(exampleAccount.name())
.throughput(400)
.build());
var exampleSqlContainer = new SqlContainer("exampleSqlContainer", SqlContainerArgs.builder()
.resourceGroupName(exampleAccount.resourceGroupName())
.accountName(exampleAccount.name())
.databaseName(exampleSqlDatabase.name())
.partitionKeyPath("foo")
.build());
var exampleOutputCosmosdb = new OutputCosmosdb("exampleOutputCosmosdb", OutputCosmosdbArgs.builder()
.streamAnalyticsJobId(exampleJob.applyValue(getJobResult -> getJobResult).applyValue(exampleJob -> exampleJob.applyValue(getJobResult -> getJobResult.id())))
.cosmosdbAccountKey(exampleAccount.primaryKey())
.cosmosdbSqlDatabaseId(exampleSqlDatabase.id())
.containerName(exampleSqlContainer.name())
.documentId("exampledocumentid")
.build());
}
}

Import

Stream Analytics Outputs for CosmosDB can be imported using the resource id, e.g.

$ pulumi import azure:streamanalytics/outputCosmosdb:OutputCosmosdb example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1

Properties

Link copied to clipboard
val containerName: Output<String>

The name of the CosmosDB container.

Link copied to clipboard

The account key for the CosmosDB database.

Link copied to clipboard

The ID of the CosmosDB database.

Link copied to clipboard
val documentId: Output<String>?

The name of the field in output events used to specify the primary key which insert or update operations are based on.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The name of the Stream Analytics Output. Changing this forces a new resource to be created.

Link copied to clipboard
val partitionKey: Output<String>?

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.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The ID of the Stream Analytics Job. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>