-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r/cosmosdb_table: expose connection strings #9990
Comments
locals {
locations = { germanywestcentral = "germanywestcentral", canadaeast = "canadaeast"}
}
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "default" {
name = "rglahodatf-canadaeast"
location = "canadaeast"
}
resource "azurerm_cosmosdb_account" "default" {
name = "cosmos-lahodatf"
location = azurerm_resource_group.default.location
resource_group_name = azurerm_resource_group.default.name
offer_type = "Standard"
kind = "GlobalDocumentDB"
enable_automatic_failover = true
capabilities {
name = "EnableTable"
}
enable_multiple_write_locations = true
consistency_policy {
consistency_level = "Session"
}
geo_location {
location = azurerm_resource_group.default.location
failover_priority = 0
}
}
resource "azurerm_cosmosdb_table" "default" {
name = "cosmos-db-table"
resource_group_name = azurerm_cosmosdb_account.default.resource_group_name
account_name = azurerm_cosmosdb_account.default.name
throughput = 400
}
output "cosmosdb_connection_string0" {
value = azurerm_cosmosdb_account.default.connection_strings[0]
}
output "cosmosdb_connection_string1" {
value = azurerm_cosmosdb_account.default.connection_strings[1]
}
output "cosmosdb_connection_string2" {
value = azurerm_cosmosdb_account.default.connection_strings[2]
}
output "cosmosdb_connection_string3" {
value = azurerm_cosmosdb_account.default.connection_strings[3]
}
output "cosmosdb_connection_string" {
value = azurerm_cosmosdb_account.default.endpoint
}
output "cosmosdb_connection_primary_key" {
value = azurerm_cosmosdb_account.default.primary_key
} |
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
Outputs:
cosmosdb_connection_primary_key = "Ob2LgUinQB7RN6xjLmCcpoNTSpzFYI69qvtL6OeWCCIcpaVxfpBfLnzOduKvNs8NWwP0ZnqIHdyhLLjlt44mFA=="
cosmosdb_connection_string = "https://cosmos-lahodatf.documents.azure.com:443/"
cosmosdb_connection_string0 = "AccountEndpoint=https://cosmos-lahodatf.documents.azure.com:443/;AccountKey=Ob2LgUinQB7RN6xjLmCcpoNTSpzFYI69qvtL6OeWCCIcpaVxfpBfLnzOduKvNs8NWwP0ZnqIHdyhLLjlt44mFA==;"
cosmosdb_connection_string1 = "AccountEndpoint=https://cosmos-lahodatf.documents.azure.com:443/;AccountKey=CFIoPX5bszG1Qv8B2dSJJ0uhDaUTumAuIfB55PZRxG2jjc7wNTxWzQTPsStQje7BA51sS7hulJi7j3Ke84MpkA==;"
cosmosdb_connection_string2 = "AccountEndpoint=https://cosmos-lahodatf.documents.azure.com:443/;AccountKey=816WdxtGZGLabXZOPLLVbEhWwLtWimXZBG5Rt1XcYnZ4w1Y16KusX2HbTFTA4mdCD9C3GXJqvF6dMrq43HU7Jw==;"
cosmosdb_connection_string3 = "AccountEndpoint=https://cosmos-lahodatf.documents.azure.com:443/;AccountKey=HzCDW8EUPy0fvECU0BVYIomsURSsA9Nl6wslSs4R2zSWA7MgPp9PZ6yREHbTZ5ulFclXISQS0pXQIdBssqezrA==;"
D:\tmp\terraform\step8> |
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/azurerm" {
version = "2.41.0" {
"version": 4,
"terraform_version": "0.14.3",
"serial": 10, |
any endpoints on account return documents, while table tf stuff does not have any connection info. i glue stuff via interpolation/index/keys/regions. |
poor man connection string |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
Cosmos Db Table API
Terraform Configuration Files
same as here https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cosmosdb_table and and azurerm_cosmosdb_account write_endpoints[0]
Debug Output
Links to documents
https://...-westeurope.documents.azure.com:443/;
Expected Behaviour
Links to table
https://....table.cosmos.azure.com:443/;
Actual Behaviour
I get link to document.
Steps to Reproduce
Important Factoids
The text was updated successfully, but these errors were encountered: