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

Key Vault name needs to be globally unique #353

Closed
angela-tran opened this issue Oct 25, 2023 · 2 comments · Fixed by #354
Closed

Key Vault name needs to be globally unique #353

angela-tran opened this issue Oct 25, 2023 · 2 comments · Fixed by #354
Assignees
Labels
bug Something isn't working infrastructure Terraform, Azure, etc.

Comments

@angela-tran
Copy link
Member

angela-tran commented Oct 25, 2023

Follow-up to #349

From https://dev.azure.com/sbmtd/eligibility-server/_build/results?buildId=12&view=logs&j=de9ad78b-21c3-52d3-f75b-ac0998b9a9c9&t=9f0d2323-8cb9-5ca6-9fa8-c6837cb4c41d


Error: creating Vault: (Name "eligibility-server-dev" / Resource Group "sbmtd-mobility-pass-eligibility-dev"): keyvault.VaultsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="VaultAlreadyExists" Message="The vault name 'eligibility-server-dev' is already in use. Vault names are globally unique so it is possible that the name is already taken. If you are sure that the vault name was not taken then it is possible that a vault with the same name was recently deleted but not purged after being placed in a recoverable state. If the vault is in a recoverable state then the vault will need to be purged before reusing the name. For more information about VaultAlreadyExists, soft delete and purging a vault follow this link [https://go.microsoft.com/fwlink/?linkid=2147740."](https://go.microsoft.com/fwlink/?linkid=2147740.%22)

│ with azurerm_key_vault.main,
│ on key_vault.tf line 1, in resource "azurerm_key_vault" "main":
│ 1: resource "azurerm_key_vault" "main" {

Here are the Resource naming restrictions for Azure Key Vaults: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault

Length: 3-24

Valid characters:
Alphanumerics and hyphens.
Start with letter. End with letter or digit. Can't contain consecutive hyphens.

@thekaveman
Copy link
Member

thekaveman commented Oct 25, 2023

creating Vault: (Name "eligibility-server-dev"...

Was this an error on our part? Why isn't SBMTD a part of this name? Or we just didn't know they had to be globally unique and thought we could create them under the RG?

@angela-tran
Copy link
Member Author

Was this an error on our part? Why isn't SBMTD a part of this name? Or we just didn't know they had to be globally unique and thought we could create them under the RG?

Yeah, we thought we could create them under the RG because the existing name didn't have anything agency-specific.

@thekaveman thekaveman added infrastructure Terraform, Azure, etc. bug Something isn't working labels Oct 25, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Digital Services Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working infrastructure Terraform, Azure, etc.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants