EndpointCosmosdbAccountArgs

data class EndpointCosmosdbAccountArgs(val authenticationType: Output<String>? = null, val containerName: Output<String>? = null, val databaseName: Output<String>? = null, val endpointUri: Output<String>? = null, val identityId: Output<String>? = null, val iothubId: Output<String>? = null, val name: Output<String>? = null, val partitionKeyName: Output<String>? = null, val partitionKeyTemplate: Output<String>? = null, val primaryKey: Output<String>? = null, val resourceGroupName: Output<String>? = null, val secondaryKey: Output<String>? = null) : ConvertibleToJava<EndpointCosmosdbAccountArgs>

Manages an IotHub Cosmos DB Account Endpoint

NOTE: Endpoints can be defined either directly on the azure.iot.IoTHub resource, or using the azurerm_iothub_endpoint_* resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a azurerm_iothub_endpoint_* resource and another endpoint of a different type directly on the azure.iot.IoTHub resource is not supported.

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.iot.IoTHub;
import com.pulumi.azure.iot.IoTHubArgs;
import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
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.iot.EndpointCosmosdbAccount;
import com.pulumi.azure.iot.EndpointCosmosdbAccountArgs;
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());
var exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.sku(IoTHubSkuArgs.builder()
.name("B1")
.capacity("1")
.build())
.tags(Map.of("purpose", "example"))
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.offerType("Standard")
.kind("GlobalDocumentDB")
.consistencyPolicy(AccountConsistencyPolicyArgs.builder()
.consistencyLevel("Strong")
.build())
.geoLocations(AccountGeoLocationArgs.builder()
.location(exampleResourceGroup.location())
.failoverPriority(0)
.build())
.build());
var exampleSqlDatabase = new SqlDatabase("exampleSqlDatabase", SqlDatabaseArgs.builder()
.resourceGroupName(exampleAccount.resourceGroupName())
.accountName(exampleAccount.name())
.build());
var exampleSqlContainer = new SqlContainer("exampleSqlContainer", SqlContainerArgs.builder()
.resourceGroupName(exampleAccount.resourceGroupName())
.accountName(exampleAccount.name())
.databaseName(exampleSqlDatabase.name())
.partitionKeyPath("/definition/id")
.build());
var exampleEndpointCosmosdbAccount = new EndpointCosmosdbAccount("exampleEndpointCosmosdbAccount", EndpointCosmosdbAccountArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.iothubId(exampleIoTHub.id())
.containerName(exampleSqlContainer.name())
.databaseName(exampleSqlDatabase.name())
.endpointUri(exampleAccount.endpoint())
.primaryKey(exampleAccount.primaryKey())
.secondaryKey(exampleAccount.secondaryKey())
.build());
}
}

Import

IoTHub Cosmos DB Account Endpoint can be imported using the resource id, e.g.

$ pulumi import azure:iot/endpointCosmosdbAccount:EndpointCosmosdbAccount endpoint1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/endpoints/cosmosDBAccountEndpoint1

Constructors

Link copied to clipboard
fun EndpointCosmosdbAccountArgs(authenticationType: Output<String>? = null, containerName: Output<String>? = null, databaseName: Output<String>? = null, endpointUri: Output<String>? = null, identityId: Output<String>? = null, iothubId: Output<String>? = null, name: Output<String>? = null, partitionKeyName: Output<String>? = null, partitionKeyTemplate: Output<String>? = null, primaryKey: Output<String>? = null, resourceGroupName: Output<String>? = null, secondaryKey: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): EndpointCosmosdbAccountArgs

Properties

Link copied to clipboard
val authenticationType: Output<String>? = null

The type used to authenticate against the Cosmos DB Account endpoint. Possible values are keyBased and identityBased. Defaults to keyBased.

Link copied to clipboard
val containerName: Output<String>? = null

The name of the Cosmos DB Container in the Cosmos DB Database. Changing this forces a new resource to be created.

Link copied to clipboard
val databaseName: Output<String>? = null

The name of the Cosmos DB Database in the Cosmos DB Account. Changing this forces a new resource to be created.

Link copied to clipboard
val endpointUri: Output<String>? = null

The URI of the Cosmos DB Account. Changing this forces a new resource to be created.

Link copied to clipboard
val identityId: Output<String>? = null

The ID of the User Managed Identity used to authenticate against the Cosmos DB Account endpoint.

Link copied to clipboard
val iothubId: Output<String>? = null

The ID of the IoT Hub to create the endpoint. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>? = null

The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: events, operationsMonitoringEvents, fileNotifications and $default. Changing this forces a new resource to be created.

Link copied to clipboard
val partitionKeyName: Output<String>? = null

The name of the partition key associated with the Cosmos DB Container.

Link copied to clipboard
val partitionKeyTemplate: Output<String>? = null

The template for generating a synthetic partition key value for use within the Cosmos DB Container.

Link copied to clipboard
val primaryKey: Output<String>? = null

The primary key of the Cosmos DB Account.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group under which the Cosmos DB Account has been created. Changing this forces a new resource to be created.

Link copied to clipboard
val secondaryKey: Output<String>? = null

The secondary key of the Cosmos DB Account.