import * as pulumi from "@pulumi/pulumi"; /** * 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 * * ```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 exampleIoTHub = new azure.iot.IoTHub("example", { * name: "exampleIothub", * resourceGroupName: example.name, * location: example.location, * sku: { * name: "B1", * capacity: 1, * }, * tags: { * purpose: "example", * }, * }); * const exampleAccount = new azure.cosmosdb.Account("example", { * name: "cosmosdb-account", * location: example.location, * resourceGroupName: example.name, * offerType: "Standard", * kind: "GlobalDocumentDB", * consistencyPolicy: { * consistencyLevel: "Strong", * }, * geoLocations: [{ * location: example.location, * failoverPriority: 0, * }], * }); * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("example", { * name: "cosmos-sql-db", * resourceGroupName: exampleAccount.resourceGroupName, * accountName: exampleAccount.name, * }); * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("example", { * name: "example-container", * resourceGroupName: exampleAccount.resourceGroupName, * accountName: exampleAccount.name, * databaseName: exampleSqlDatabase.name, * partitionKeyPath: "/definition/id", * }); * const exampleEndpointCosmosdbAccount = new azure.iot.EndpointCosmosdbAccount("example", { * name: "example", * resourceGroupName: example.name, * iothubId: exampleIoTHub.id, * containerName: exampleSqlContainer.name, * databaseName: exampleSqlDatabase.name, * endpointUri: exampleAccount.endpoint, * primaryKey: exampleAccount.primaryKey, * secondaryKey: exampleAccount.secondaryKey, * }); * ``` * * ## Import * * IoTHub Cosmos DB Account Endpoint can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:iot/endpointCosmosdbAccount:EndpointCosmosdbAccount endpoint1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/endpoints/cosmosDBAccountEndpoint1 * ``` */ export declare class EndpointCosmosdbAccount extends pulumi.CustomResource { /** * Get an existing EndpointCosmosdbAccount resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: EndpointCosmosdbAccountState, opts?: pulumi.CustomResourceOptions): EndpointCosmosdbAccount; /** * Returns true if the given object is an instance of EndpointCosmosdbAccount. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is EndpointCosmosdbAccount; /** * The type used to authenticate against the Cosmos DB Account endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`. */ readonly authenticationType: pulumi.Output; /** * The name of the Cosmos DB Container in the Cosmos DB Database. Changing this forces a new resource to be created. */ readonly containerName: pulumi.Output; /** * The name of the Cosmos DB Database in the Cosmos DB Account. Changing this forces a new resource to be created. */ readonly databaseName: pulumi.Output; /** * The URI of the Cosmos DB Account. Changing this forces a new resource to be created. */ readonly endpointUri: pulumi.Output; /** * The ID of the User Managed Identity used to authenticate against the Cosmos DB Account endpoint. * * > **Note:** `identityId` can only be specified when `authenticationType` is `identityBased`. It must be one of the `identityIds` of the Iot Hub. If not specified when `authenticationType` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used. */ readonly identityId: pulumi.Output; /** * The ID of the IoT Hub to create the endpoint. Changing this forces a new resource to be created. */ readonly iothubId: pulumi.Output; /** * 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. */ readonly name: pulumi.Output; /** * The name of the partition key associated with the Cosmos DB Container. */ readonly partitionKeyName: pulumi.Output; /** * The template for generating a synthetic partition key value for use within the Cosmos DB Container. */ readonly partitionKeyTemplate: pulumi.Output; /** * The primary key of the Cosmos DB Account. * * > **Note:** `primaryKey` must and can only be specified when `authenticationType` is `keyBased`. */ readonly primaryKey: pulumi.Output; /** * The name of the resource group under which the Cosmos DB Account has been created. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * The secondary key of the Cosmos DB Account. * * > **Note:** `secondaryKey` must and can only be specified when `authenticationType` is `keyBased`. */ readonly secondaryKey: pulumi.Output; /** * The subscription ID for the endpoint. * * > **Note:** When `subscriptionId` isn't specified it will be set to the subscription ID of the IoT Hub resource. */ readonly subscriptionId: pulumi.Output; /** * Create a EndpointCosmosdbAccount resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: EndpointCosmosdbAccountArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EndpointCosmosdbAccount resources. */ export interface EndpointCosmosdbAccountState { /** * The type used to authenticate against the Cosmos DB Account endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`. */ authenticationType?: pulumi.Input; /** * The name of the Cosmos DB Container in the Cosmos DB Database. Changing this forces a new resource to be created. */ containerName?: pulumi.Input; /** * The name of the Cosmos DB Database in the Cosmos DB Account. Changing this forces a new resource to be created. */ databaseName?: pulumi.Input; /** * The URI of the Cosmos DB Account. Changing this forces a new resource to be created. */ endpointUri?: pulumi.Input; /** * The ID of the User Managed Identity used to authenticate against the Cosmos DB Account endpoint. * * > **Note:** `identityId` can only be specified when `authenticationType` is `identityBased`. It must be one of the `identityIds` of the Iot Hub. If not specified when `authenticationType` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used. */ identityId?: pulumi.Input; /** * The ID of the IoT Hub to create the endpoint. Changing this forces a new resource to be created. */ iothubId?: pulumi.Input; /** * 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. */ name?: pulumi.Input; /** * The name of the partition key associated with the Cosmos DB Container. */ partitionKeyName?: pulumi.Input; /** * The template for generating a synthetic partition key value for use within the Cosmos DB Container. */ partitionKeyTemplate?: pulumi.Input; /** * The primary key of the Cosmos DB Account. * * > **Note:** `primaryKey` must and can only be specified when `authenticationType` is `keyBased`. */ primaryKey?: pulumi.Input; /** * The name of the resource group under which the Cosmos DB Account has been created. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * The secondary key of the Cosmos DB Account. * * > **Note:** `secondaryKey` must and can only be specified when `authenticationType` is `keyBased`. */ secondaryKey?: pulumi.Input; /** * The subscription ID for the endpoint. * * > **Note:** When `subscriptionId` isn't specified it will be set to the subscription ID of the IoT Hub resource. */ subscriptionId?: pulumi.Input; } /** * The set of arguments for constructing a EndpointCosmosdbAccount resource. */ export interface EndpointCosmosdbAccountArgs { /** * The type used to authenticate against the Cosmos DB Account endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`. */ authenticationType?: pulumi.Input; /** * The name of the Cosmos DB Container in the Cosmos DB Database. Changing this forces a new resource to be created. */ containerName: pulumi.Input; /** * The name of the Cosmos DB Database in the Cosmos DB Account. Changing this forces a new resource to be created. */ databaseName: pulumi.Input; /** * The URI of the Cosmos DB Account. Changing this forces a new resource to be created. */ endpointUri: pulumi.Input; /** * The ID of the User Managed Identity used to authenticate against the Cosmos DB Account endpoint. * * > **Note:** `identityId` can only be specified when `authenticationType` is `identityBased`. It must be one of the `identityIds` of the Iot Hub. If not specified when `authenticationType` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used. */ identityId?: pulumi.Input; /** * The ID of the IoT Hub to create the endpoint. Changing this forces a new resource to be created. */ iothubId: pulumi.Input; /** * 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. */ name?: pulumi.Input; /** * The name of the partition key associated with the Cosmos DB Container. */ partitionKeyName?: pulumi.Input; /** * The template for generating a synthetic partition key value for use within the Cosmos DB Container. */ partitionKeyTemplate?: pulumi.Input; /** * The primary key of the Cosmos DB Account. * * > **Note:** `primaryKey` must and can only be specified when `authenticationType` is `keyBased`. */ primaryKey?: pulumi.Input; /** * The name of the resource group under which the Cosmos DB Account has been created. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * The secondary key of the Cosmos DB Account. * * > **Note:** `secondaryKey` must and can only be specified when `authenticationType` is `keyBased`. */ secondaryKey?: pulumi.Input; /** * The subscription ID for the endpoint. * * > **Note:** When `subscriptionId` isn't specified it will be set to the subscription ID of the IoT Hub resource. */ subscriptionId?: pulumi.Input; }