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

Terraform: Update deprecated azurerm_app_service_plan resource to azurerm_service_plan #54

Open
epopisces opened this issue Nov 20, 2023 · 0 comments
Labels
terraform Items related to the Terraform IaC code
Milestone

Comments

@epopisces
Copy link

azurerm_app_service_plan is deprecated in version 3.x of the azurerm provider. The recommended guidance is to use the new azurerm_service_plan resource. Fortunately the update is relatively straightforward.

# the existing:
resource "azurerm_app_service_plan" "redcap" {
  name                = "${local.app_service_name}Plan"
  resource_group_name = azurerm_resource_group.redcap.name
  location            = azurerm_resource_group.redcap.location
  tags                = var.tags
  kind                = "Linux"
  reserved            = true

  sku {
    tier     = var.app_service_plan_tier
    size     = var.app_service_plan_size
    capacity = var.skuCapacity
  }
}

# becomes: 
resource "azurerm_service_plan" "redcap" {
  name                = "${local.app_service_name}Plan"
  resource_group_name = azurerm_resource_group.redcap.name
  location            = azurerm_resource_group.redcap.location
  os_type             = "Linux"
  sku_name            = var.app_service_plan_size
}

The app_service_plan_tier and skuCapacity arguments can then be removed.

Any existing projects updating from the one resource to the other will need to use terraform state move or terraform import to bring the existing resource under management of the new resource.

@SvenAelterman SvenAelterman added the terraform Items related to the Terraform IaC code label Nov 25, 2023
@SvenAelterman SvenAelterman added this to the Backlog milestone Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terraform Items related to the Terraform IaC code
Projects
None yet
Development

No branches or pull requests

2 participants