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

azurerm_mongo_cluster doesn't appear to work correctly with random_password #36140

Closed
rayterrill opened this issue Dec 1, 2024 · 2 comments
Closed
Labels

Comments

@rayterrill
Copy link

rayterrill commented Dec 1, 2024

Terraform Version

Terraform v1.9.8
on darwin_amd64
+ provider registry.terraform.io/hashicorp/azuread v3.0.2
+ provider registry.terraform.io/hashicorp/azurerm v4.12.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/hashicorp/time v0.12.1

Terraform Configuration Files

resource "random_password" "password" {
  length      = 9
  min_numeric = 3
  special     = false
}

resource "azurerm_mongo_cluster" "cluster" {
  name                   = format("my-mongo-%s", var.environment)
  resource_group_name    = var.resource_group_name
  location               = var.location
  administrator_username = "admin"
  administrator_password = random_password.password.result
  shard_count            = "1"
  compute_tier           = "M30"
  high_availability_mode = "Disabled"
  storage_size_in_gb     = "128"
  version                = "6.0"
}

Debug Output

2024-12-01T11:06:48.453-0800 [ERROR] vertex "module.mongo.azurerm_mongo_cluster.cluster" error: `administrator_password` is required when `create_mode` is Default
2024-12-01T11:06:48.453-0800 [ERROR] provider.terraform-provider-azurerm_v4.12.0_x5: Response contains error diagnostic: diagnostic_severity=ERROR tf_proto_version=5.7 tf_provider_addr=registry.terraform.io/hashicorp/azurerm tf_rpc=PlanResourceChange @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail="" tf_resource_type=azurerm_mongo_cluster diagnostic_summary="`administrator_password` is required when `create_mode` is Default" tf_req_id=b83b8937-451f-2fe3-7c8f-86fd0193c1cc timestamp=2024-12-01T11:06:48.452-0800
2024-12-01T11:06:48.453-0800 [ERROR] vertex "module.mongo.azurerm_mongo_cluster.cluster (expand)" error: `administrator_password` is required when `create_mode` is Default

╷
│ Error: `administrator_password` is required when `create_mode` is Default
│
│   with module.mongo.azurerm_mongo_cluster.cluster,
│   on ../modules/mongo/main.tf line 7, in resource "azurerm_mongo_cluster" "cluster":
│    7: resource "azurerm_mongo_cluster" "cluster" {
│
╵

Expected Behavior

Should be able to chain together other resources vs having to hardcode password

Actual Behavior


│ Error: administrator_password is required when create_mode is Default

│ with module.mongo.azurerm_mongo_cluster.cluster,
│ on ../modules/mongo/main.tf line 7, in resource "azurerm_mongo_cluster" "cluster":
│ 7: resource "azurerm_mongo_cluster" "cluster" {

Steps to Reproduce

  1. terraform init
  2. terraform apply

Additional Context

Works correctly if you hardcode the password as a string vs using a resource like random_password

References

No response

@rayterrill rayterrill added bug new new issue not yet triaged labels Dec 1, 2024
@jbardin
Copy link
Member

jbardin commented Dec 2, 2024

Hello,

This appears to be an issue or question with the AzureRM provider, not with Terraform itself. You can see existing issues and file a new one in their repository here: https://github.com/terraform-providers/terraform-provider-azurerm/issues. If you have questions about Terraform or the AzureRM provider, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by a few core maintainers.

Thanks!

@jbardin jbardin closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
Copy link
Contributor

github-actions bot commented Jan 2, 2025

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants