Skip to content
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

Error in Postgres module #29

Open
grayjeremy opened this issue May 29, 2019 · 0 comments
Open

Error in Postgres module #29

grayjeremy opened this issue May 29, 2019 · 0 comments

Comments

@grayjeremy
Copy link

The postgres module behaves differently in terraform 0.11.14 and 0.12. Error and input posted below. This issue is peeled off of #16

Error

Error: Missing resource instance key

  on .terraform\modules\demo_db\sjones-sot-terraform-azurerm-database-for-postgres-59b1e13\postgres.tf line 10, in resource "azurerm_postgresql_server" "postgresql_server":  10:   resource_group_name = "${var.resource_group_name == "" ? azurerm_resource_group.resource_group.name : var.resource_group_name}"
Because azurerm_resource_group.resource_group has "count" set, its attributes
must be accessed on specific instances.

For example, to correlate with indices of a referring resource, use:
    azurerm_resource_group.resource_group[count.index]

Input

module "demo_db" {
  source            = "sjones-sot/database-for-postgres/azurerm"
  resource_group_name = "${var.az_rg_name}"
  location          = "${var.az_region_default}"
  service_name      = "testdb"
  db_admin_password = "${var.az_fake_password}"
  sku_compute_units = 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant