Message="The name 'easqlserver.database.windows.net' already exists. #14867
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.
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:
Terraform will perform the following actions:
azurerm_sql_server.cld2paasgrpeasrvn002 will be created
}
}
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$
The text was updated successfully, but these errors were encountered: