hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.63k forks source link

Error waiting for certificate in KeyVault #12344

Closed kennethsparre1980 closed 3 years ago

kennethsparre1980 commented 3 years ago

Community Note

Terraform1.0.0 hashicorp/azurerm 2.64.0

Affected Resource(s)

Terraform Configuration Files

resource "random_id" "randomid_gen" {
  keepers = {
    # Generate a new ID only when a new resource group is defined
  }

  byte_length = 8
}

# #########################################################
#  Key vault certificate
# #########################################################

resource "azurerm_key_vault_certificate" "key_vault_certificate" {
  name         = lower("${var.key_vault_certificate_prefix}-${var.application_name}-${var.subscription_name}-${var.environment}-${var.ver}-${random_id.randomid_gen.hex}")
  key_vault_id = var.key_vault_id

  #certificate {
  #  contents = filebase64("certificate-to-import.pfx")
  #  password = ""
  #}

  certificate_policy {
    issuer_parameters {
      name = "Self"
    }

    key_properties {
      exportable = true
      key_size   = 2048
      key_type   = "RSA"
      reuse_key  = true
    }

    lifetime_action {
      action {
        action_type = "AutoRenew"
      }

      trigger {
        days_before_expiry = 30
      }
    }

    secret_properties {
      content_type = "application/x-pkcs12"
    }

    x509_certificate_properties {
      # Server Authentication = 1.3.6.1.5.5.7.3.1
      # Client Authentication = 1.3.6.1.5.5.7.3.2
      extended_key_usage = ["1.3.6.1.5.5.7.3.1"]

      key_usage = [
        "cRLSign",
        "dataEncipherment",
        "digitalSignature",
        "keyAgreement",
        "keyCertSign",
        "keyEncipherment",
      ]

      subject_alternative_names {
        dns_names = ["mysite1.com"]
      }

      subject            = "CN=saltedm.com"
      validity_in_months = 24
    }
  }
}

Actual Behaviour

Error: Error waiting for Certificate "kv-agw-cert-agw-subedm-s-89-beb18dc9c8a3df8a" in Vault "https://kv-core-subedm-s-1.vault.azure.net/" to become available: couldn't find resource (21 retries)

Steps to Reproduce

  1. terraform apply
tombuildsstuff commented 3 years ago

Duplicate of #12347

github-actions[bot] commented 3 years ago

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.