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

Message="The name 'easqlserver.database.windows.net' already exists. #14867

Open
lspeleman opened this issue Aug 27, 2020 · 1 comment
Open
Labels
question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/rds Issues and PRs that pertain to the rds service.

Comments

@lspeleman
Copy link

Hi,

I'm new to Terraform.
I'm trying to create a sql server in Azure. My first steps.
But I'm stuck and I don't understand what is giving me this error.
The SQL Server does not exist. I guess the error is misleading me. But I have no idea how to debug to get more information in what went wrong.

If anyone has an idea, I will be grateful.

This is my main.tf

The provider

provider "azurerm" {

AzureRM provider 2.x

version = "~>2.0"
subscription_id = "xxxxxxxxxxxxxxxxxxxxx"

v2.x required "features" block

features {}
}

Create SQL Server

resource "azurerm_sql_server" "cld2paasgrpeasrvn002" {
name = "easqlserver"
resource_group_name = "RESOURCE_GRP_NAME"
location = "West Europe"
version = "12.0"
administrator_login = "lucabc"
administrator_login_password = "1-fdfd-dfd1"

tags = {
environment = "testing"
}
}

This is the error I receive

luc@Azure:~/clouddrive/TERRAFORM-TEST-PLAN$ terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

azurerm_sql_server.cld2paasgrpeasrvn002 will be created

  • resource "azurerm_sql_server" "cld2paasgrpeasrvn002" {
    • administrator_login = "lucabc"
    • administrator_login_password = (sensitive value)
    • connection_policy = "Default"
    • fully_qualified_domain_name = (known after apply)
    • id = (known after apply)
    • location = "westeurope"
    • name = "easqlserver"
    • resource_group_name = "RESOURCE_GRP_NAME"
    • tags = {
      • "environment" = "testing"
        }
    • version = "12.0"
      }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

azurerm_sql_server.cld2paasgrpeasrvn002: Creating...

Error: Error waiting on create/update future for SQL Server "easqlserver" (Resource Group "RESOURCE_GRP_NAME"): Code="NameAlreadyExists" Message="The name 'easqlserver.database.windows.net' already exists. Choose
a different name."

on main.tf line 11, in resource "azurerm_sql_server" "cld2paasgrpeasrvn002":
11: resource "azurerm_sql_server" "cld2paasgrpeasrvn002" {

luc@Azure:~/clouddrive/TERRAFORM-TEST-PLAN$

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 27, 2020
@breathingdust breathingdust added question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/rds Issues and PRs that pertain to the rds service. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 16, 2021
@ljluestc
Copy link


provider "azurerm" {
  version = "~>2.0"
  subscription_id = "xxxxxxxxxxxxxxxxxxxxx"
  features {}
}

resource "azurerm_sql_server" "cld2paasgrpeasrvn002" {
  name                = "mynewsqlserver"  # Choose a unique name here
  resource_group_name = "RESOURCE_GRP_NAME"
  location            = "West Europe"
  version             = "12.0"
  administrator_login = "lucabc"
  administrator_login_password = "1-fdfd-dfd1"

  tags = {
    environment = "testing"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

No branches or pull requests

3 participants