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

r/api_management - support for publicIpAddressId for multi-zone deployments #13445

Closed
uracharla opened this issue Sep 22, 2021 · 5 comments · Fixed by #14660
Closed

r/api_management - support for publicIpAddressId for multi-zone deployments #13445

uracharla opened this issue Sep 22, 2021 · 5 comments · Fixed by #14660

Comments

@uracharla
Copy link

uracharla commented Sep 22, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.13.4

Your version of Terraform is out of date! The latest version
is 1.0.7. You can update by downloading from https://www.terraform.io/downloads.html
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=2.76.0"
    }
  }
}

Affected Resource(s)

  • azurerm_api_management

Terraform Configuration Files

resource "azurerm_api_management" "main" {
  name                = var.api_management_name
  resource_group_name = var.resource_group_name
  location            = var.api_management_location

  sku_name        = "Premium_3"
  publisher_name  = var.api_management_publisher_name
  publisher_email = var.api_management_publisher_email

  zones = [1,2,3]
  virtual_network_type = var.virtual_network_type

  dynamic "virtual_network_configuration" {
    for_each = var.apim_locations != null ? slice(var.apim_locations, 0, 1) : []
    content {
      subnet_id = data.azurerm_subnet.main[0].id

    }
  }
  dynamic "additional_location" {
    for_each = var.apim_locations != null && var.api_management_sku_name == "Premium_1" ? slice(var.apim_locations, 1, length(var.apim_locations)) : []
    content {
      location = lookup(additional_location.value, "location", null)
      dynamic "virtual_network_configuration" {
        for_each = lookup(additional_location.value, "subnet_name", null) == null ? [] : [1]
        content {
          subnet_id = data.azurerm_subnet.main[index(var.apim_locations, additional_location.value)].id
        }
      }
    }
  }
  tags = var.api_management_tags
}

Actual Behaviour

From the terraform documentation, I was specifying the availiablity zone 1,2,3 and terraform through me the error,

{\"error\":{\"code\":\"NotSupported\",\"message\":\"Deploying Microsoft.ApiManagement/service into      
Virtual Network in location `Australia East` and configuring Availability Zones (1,2,3) is only supported  
 in api-version 2021-01-01-preview,2021-04-01-preview,2021-08-01 and setting property   
`publicIpAddressId` is a must. Refer to aka.ms/azurestandardpublicip on how to create a   
Standard SKU Public IP Address resource.\",\"details\":null,\"innerError\":null}}"

there is no option to specify the public IP address ID in the terraform resource azurerm_api_management

Steps to Reproduce

  1. terraform apply
@uracharla uracharla changed the title Provisioning APIM is not allowing to deploy multiple availability zones Provisioning APIM is failed to deploy multiple availability zones Sep 22, 2021
@koikonom koikonom added sdk/requires-newer-api-version This requires upgrading the version of the API being used service/api-management labels Sep 23, 2021
@lrsvendsen
Copy link

Any updates on the issue?

Being able to set a Public IP address (properties.publicIpAddressId)(1) is also required in order to provision APIM using the stv2(2) Compute Platform.

(1) (https://docs.microsoft.com/en-us/azure/api-management/api-management-using-with-vnet?tabs=stv2#prerequisites)

(2) (https://docs.microsoft.com/en-us/rest/api/apimanagement/2021-04-01-preview/api-management-service/create-or-update#code-try-0)

katbyte pushed a commit that referenced this issue Dec 14, 2021
Microsoft added a large amount of functionality in 2021-01-01-preview for API Management. This PR is to move us to the latest stable API release, which will allow for adding functionality to resolved issues such as #12021 and #13445. It updates all the constants which were renamed.

The only potential regression is that Sample is no longer a property in the OperationRepresentation schema. It has been replaced with a map of Examples. I can update the schema, but I'm not sure how to deal with the value property of the ParameterExampleContract. If someone can help me with this, I'll push the code for the Examples.

My plan is to uplift the features in separate PRs.
@asifkd012020
Copy link

Though the API was updated to 2021-08-01 but the support for public IP address is still missing from the input, without which the deployment of multi az apim will still fail.

@tombuildsstuff tombuildsstuff added enhancement and removed sdk/requires-newer-api-version This requires upgrading the version of the API being used labels Dec 17, 2021
@tombuildsstuff tombuildsstuff changed the title Provisioning APIM is failed to deploy multiple availability zones r/api_management - support for publicIpAddressId for multi-zone deployments Dec 17, 2021
@lrsvendsen
Copy link

That PublicIPAddressID has not been implemented from the Azure Go SDK is also blocking issue #12021

@oWretch
Copy link
Contributor

oWretch commented Dec 17, 2021

I am actively working on this code as we need it for a project. I hope to have a PR early next week to support zones and public ips

katbyte pushed a commit that referenced this issue Feb 8, 2022
)

Co-authored-by: kt <[email protected]>

This PR adds the functionality released in the 2021-08-01 API update to the core API Management resources.

Resolves #12021
Resolves #13445
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants