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.61k stars 4.65k forks source link

Support for new v2 SKUs in azurerm_api_management #24377

Open sven5 opened 11 months ago

sven5 commented 11 months ago

Is there an existing issue for this?

Community Note

Description

Azure API Management allows new Service Tiers. https://learn.microsoft.com/en-us/azure/api-management/v2-service-tiers-overview

New or Affected Resource(s)/Data Source(s)

azurerm_api_management

Potential Terraform Configuration

No response

References

No response

aleena-siddiqui commented 8 months ago

Is there any update on this?

wiebeck commented 8 months ago

This seems to be a duplicate of #23443

wiebeck commented 8 months ago

I was about to add the new SKU names to the ApimSkuName function when I noticed that this would probably also require to switch to API Management API version 2023-03-01-preview or later (the provider currently uses 2022-08-01). See the docs here. Is it acceptable to use preview APIs in the provider?

arsubram-akamai commented 7 months ago

As mentioned in below link, both v2 SKUs are available (GA). Can we expect a new revision in terraform-provider-azurerm to support these SKUs?

https://azure.microsoft.com/en-in/updates/announcing-general-availability-of-azure-api-management-basic-v2-and-standard-v2-tiers/

vasu-telepathy commented 7 months ago

Hi! echoing the above comment. Would it be possible to provide support for v2 SKUs? Thanks!

anandpatra18 commented 6 months ago

Hey guys! Does anyone have any updates or timelines for this feature ?

dattachandan commented 6 months ago

Would be keen to see this in the Azure Verified Modules as well

vasu-telepathy commented 6 months ago

Second Ping: Any idea when this will be available now that the APIM is GA for V2? Thanks!

Antupis commented 6 months ago

Any updates on this Azure documentation says "Support for API Management instances hosted on the stv1 platform will be retired by 31 August 2024. "

vasu-telepathy commented 6 months ago

Hi! Yes. This update is desperately needed.

JEngel05 commented 6 months ago

Is this resource still actively maintained? Bicep has had this functionality for quite awhile. Still waiting on Terraform to support it and it's been completely silent on when we may see this functionality. It makes it hard to justify using Terraform when there is such a delay in feature implementation.

sven5 commented 6 months ago

@vasu-telepathy

Any updates on this Azure documentation says "Support for API Management instances hosted on the stv1 platform will be retired by 31 August 2024. "

You're mixing things up. This issue is not about stv1 or stv2 compute platform. You can read more about compute platforms here.

This issue is about the Service Tier of APIM. You can read more about this here or in the documentation.

vasu-telepathy commented 6 months ago

@sven5 Did you mean to address that note to @Antupis ?

sven5 commented 6 months ago

@vasu-telepathy Oh yes, sorry for confusion.

vasu-telepathy commented 6 months ago

@sven5 No worries. Brings back to my original question on support for V2. Is there a timeline? Thanks!

kewalaka commented 6 months ago

i posted a clarification about the difference between stv1+2 and these new SKUs on the earlier issue that was closed in favour of this one.

tuukkjs commented 6 months ago

+1 this is important to have. New tiers have some advantages over old ones, e.g., afaik the v2 tiers offer faster provisioning and scaling, and the Standard v2 tier supports simplified connection to network-isolated backends and multiple custom domain names.

Also, I am interested in possible workarounds on how to upgrade a Terraform-managed API management resource to v2 tier while explicit v2 tier support is not available in the provider.

wiebeck commented 6 months ago

afaik the v2 tiers offer faster provisioning and scaling, and the Standard v2 tier supports simplified connection to network-isolated backends and multiple custom domain names.

Also "pricing".

vasu-telepathy commented 6 months ago

Yes. Pricing...I forget to mention that. Standard V2 is very attractive for us.

zadigus commented 5 months ago

any progress on the topic?

sven5 commented 5 months ago

Hi @tombuildsstuff,

could you please shed some light on this.

jakubramut commented 5 months ago

hello @tombuildsstuff, do you have any expected date when the support for v2 SKU will be available in azurerm terraform provider?

SiiwY commented 5 months ago

Has work started on this?

gustafholst commented 5 months ago

Any news on this?

Shohoo commented 5 months ago

Any progress?

JackB-2 commented 5 months ago

Is this available yet?

PhatAdam commented 5 months ago

Any update to this?
We require a vnet integration, and with microsoft removing support for the developer tier and support - we have to move our Dev, and QA to Standard_V2 but the terraform api library isn't available.

│ Error: invalid value for sku_name (This is not a valid Api Management sku name.) │ │ with azurerm_api_management.pbm_dev_apim, │ on apim.tf line 59, in resource "azurerm_api_management" "pbm_dev_apim": │ 59: sku_name = "Standard_v2" │

image

AjinkyaBapat commented 5 months ago

Does this also mean we cannot use azurerm_api_management_api and azurerm_api_management_product_api resources with the APIM which is created outside of Terraform with Standard v2 SKU ??

Update: Tried this today and was able to use these 2 resources against Standard V2 APIM created outside TF.

Xavierferna commented 4 months ago

I am a bit disappointed with the Terraform team because there have been no updates. I believe it is time to switch to the native Bicep tool instead of relying on inconsistent Terraform support.

YewTongWong commented 4 months ago

Hi any update on this one? I am too looking to upgrade from V1 to V2 but it seems like it's not available with terraform yet

zadigus commented 3 months ago

what's the status of this? we would like to switch to standard v2

mrozenbeekBudgetThuis commented 3 months ago

I would to know the status of this, cause we need to move to this for the workspace gateways and costs and other different reasons. If it is allowed i would love to make those changes if i can, but the api needed for these SKU's is still in preview.

zadigus commented 3 months ago

If you're sick of waiting, you can use the azapi provider like this, for example:

terraform {
  required_providers {
    azapi = {
      source  = "azure/azapi"
      version = "=1.15.0"
    }
  }
}

resource "azapi_resource" "apim" {
  type      = "Microsoft.ApiManagement/service@2023-09-01-preview"
  name      = var.resource_name
  location  = var.location
  parent_id = var.resource_group_id

  body = {
    properties = {
      apiVersionConstraint = {
        minApiVersion = "2019-12-01"
      }
      publicIpAddressId   = azurerm_public_ip.apim.id
      publicNetworkAccess = "Enabled"
      publisherEmail      = var.publisher_email
      publisherName       = "Cognex"
      sku = {
        capacity = 1
        name     = "StandardV2"
      }
      virtualNetworkConfiguration = {
        subnetResourceId = var.subnet_id
      }
      virtualNetworkType = "External"
    }
  }
  response_export_values = ["properties.gatewayUrl"]
}

output gateway_url {
  value = azapi_resource.apim.output.properties.gatewayUrl
}

output apim_name {
  value = azapi_resource.apim.name
}

The usage of that API is documented here.

I, personally, have no time to wait until this feature is released in the azurerm provider.

mrozenbeekBudgetThuis commented 3 months ago

If you're sick of waiting, you can use the azapi provider like this, for example:

terraform {
  required_providers {
    azapi = {
      source  = "azure/azapi"
      version = "=1.15.0"
    }
  }
}

resource "azapi_resource" "apim" {
  type      = "Microsoft.ApiManagement/service@2023-09-01-preview"
  name      = var.resource_name
  location  = var.location
  parent_id = var.resource_group_id

  body = jsonencode({
    properties = {
      apiVersionConstraint = {
        minApiVersion = "2019-12-01"
      }
      publicIpAddressId   = azurerm_public_ip.apim.id
      publicNetworkAccess = "Disabled"
      publisherEmail      = var.publisher_email
      publisherName       = "Cognex"
      sku = {
        capacity = 1
        name     = "Standard_v2"
      }
      virtualNetworkConfiguration = {
        subnetResourceId = var.subnet_id
      }
      virtualNetworkType = "External"
    }
  })
}

output gateway_url {
  value = azapi_resource.apim.output.properties.gatewayUrl
}

output apim_name {
  value = azapi_resource.apim.name
}

The usage of that API is documented here.

I, personally, have no time to wait until this feature is released in the azurerm provider.

@zadigus good call, i'm not that deep into terraform yet, but this seems like a good short-term solution, thank!!!

w3bward commented 2 months ago

Any update on this? This looks similar to #25445, which has an open PR attached to it, and was added to the 4.2 milestone, but 4.2 has now shipped and a fix for this does not appear to have been included.

This is getting a little ridiculous, these skus have been GA since April, but there's been little movement on the Terraform side of this.

rebla commented 2 months ago

If you're sick of waiting, you can use the azapi provider like this, for example:

terraform {
  required_providers {
    azapi = {
      source  = "azure/azapi"
      version = "=1.15.0"
    }
  }
}

resource "azapi_resource" "apim" {
  type      = "Microsoft.ApiManagement/service@2023-09-01-preview"
  name      = var.resource_name
  location  = var.location
  parent_id = var.resource_group_id

  body = {
    properties = {
      apiVersionConstraint = {
        minApiVersion = "2019-12-01"
      }
      publicIpAddressId   = azurerm_public_ip.apim.id
      publicNetworkAccess = "Disabled"
      publisherEmail      = var.publisher_email
      publisherName       = "Cognex"
      sku = {
        capacity = 1
        name     = "StandardV2"
      }
      virtualNetworkConfiguration = {
        subnetResourceId = var.subnet_id
      }
      virtualNetworkType = "External"
    }
  }
  response_export_values = ["properties.gatewayUrl"]
}

output gateway_url {
  value = azapi_resource.apim.output.properties.gatewayUrl
}

output apim_name {
  value = azapi_resource.apim.name
}

The usage of that API is documented here.

I, personally, have no time to wait until this feature is released in the azurerm provider.

But these skus are also not available on the API, right? https://learn.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2023-09-01-preview/service?pivots=deployment-language-bicep#apimanagementserviceskuproperties

zadigus commented 2 months ago

@rebla they are available, it's just not properly documented; I am using azapi to deploy the APIM in my projects and it works perfectly fine. For Standard v2, you need to use name = "StandardV2" as in my terraform configuration above

rebla commented 2 months ago

@rebla they are available, it's just not properly documented; I am using azapi to deploy the APIM in my projects and it works perfectly fine. For Standard v2, you need to use name = "StandardV2" as in my terraform configuration above

Thanks!

nathanmagyarconsultant commented 1 month ago

If you're sick of waiting, you can use the azapi provider like this, for example:

terraform {
  required_providers {
    azapi = {
      source  = "azure/azapi"
      version = "=1.15.0"
    }
  }
}

resource "azapi_resource" "apim" {
  type      = "Microsoft.ApiManagement/service@2023-09-01-preview"
  name      = var.resource_name
  location  = var.location
  parent_id = var.resource_group_id

  body = {
    properties = {
      apiVersionConstraint = {
        minApiVersion = "2019-12-01"
      }
      publicIpAddressId   = azurerm_public_ip.apim.id
      publicNetworkAccess = "Enabled"
      publisherEmail      = var.publisher_email
      publisherName       = "Cognex"
      sku = {
        capacity = 1
        name     = "StandardV2"
      }
      virtualNetworkConfiguration = {
        subnetResourceId = var.subnet_id
      }
      virtualNetworkType = "External"
    }
  }
  response_export_values = ["properties.gatewayUrl"]
}

output gateway_url {
  value = azapi_resource.apim.output.properties.gatewayUrl
}

output apim_name {
  value = azapi_resource.apim.name
}

The usage of that API is documented here.

I, personally, have no time to wait until this feature is released in the azurerm provider.

Thanks for this, but one correction for it to work on my end was to pull sku outside of properties.

Like this:

  resource "azapi_resource" "apim" {
  type      = "Microsoft.ApiManagement/service@2023-09-01-preview"
  name      = var.resource_name
  parent_id = var.resource_group_id

  body = {
    properties = {
      apiVersionConstraint = {
        minApiVersion = "2019-12-01" 
      }
      publicIpAddressId   = azurerm_public_ip.apim.id
      publicNetworkAccess = "Disabled"
      publisherName      = Cognex
      publisherEmail     = var.publisher_email
      virtualNetworkConfiguration = {
        subnetResourceId = var.subnet_id
      }
      virtualNetworkType = "External"
    }
    location = "Australia Southeast"
    sku = {
      capacity = 1
      name     = "StandardV2"
    }
  }
  response_export_values = ["properties.gatewayUrl"]
}

Works great though while we wait for a fix on this. Thanks for sharing!

DavidPriceNBS commented 1 month ago

Looks as though there is an open PR for this here https://github.com/hashicorp/terraform-provider-azurerm/pull/26770

Its from July though and appears to be awaiting a maintainer approving static analysis and subsequent jobs https://github.com/hashicorp/terraform-provider-azurerm/actions/runs/11147245616

mrozenbeekBudgetThuis commented 1 month ago

@DavidPriceNBS we have been trying the apim v2, but MS skipped private vnet and also workspaces will be in a premiumV2, my guess is that all these changes making it hard to make a stable v2 implementation yet. we are skipping v2 for now due to the nmissing features like workspaces.

stan-spotts commented 2 weeks ago

Getting worried about the developer instance losing VNET capability and needing Standard_V2 support here. I'll ask this month - is support for the SKU coming soon?