Terraform-provider-azurerm: Add Support for Custom Host Names for new Developer Portal (*.developer.azure-api.net)

Created on 4 Nov 2019  ·  8Comments  ·  Source: terraform-providers/terraform-provider-azurerm

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

Description


Microsoft is in the process of rolling out the new developer portal design (*.developer.azure-api.net). There is a new host name ("developer") for this, but the current version of the terraform provider does not support this new host name.

New or Affected Resource(s)

  • azurerm_api_management

Potential Terraform Configuration

resource "azurerm_api_management" "default" {
  count =  var.resource_count
  name                = "${var.apim_name}"
  location            = "${var.location}"
  resource_group_name = "${var.resource_group_name}"
  publisher_name      = "My Company"
  publisher_email     = "[email protected]"
  depends_on          = [data.azurerm_resource_group.default]

  hostname_configuration {
    proxy { 
        host_name = "api.mycompany.com"
        certificate = "${filebase64(var.pfx_file)}"
        certificate_password = "${var.pfx_password}"
      }

      developerportal { 
        host_name = "developer.mycompany.com"
        certificate = "${filebase64(var.pfx_file)}"
        certificate_password = "${var.pfx_password}"
      }
  }

  sku_name = "${var.apim_sku_name}_${var.apim_sku_capacity}"
}

References

  • https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2019-01-01/service#HostnameConfiguration

  • enhancement servicapi-management

    Most helpful comment

    @spyder007 Hey mate.

    The apimanagement version was updated to 2019-01-01 in Azure v39.0.0 SDK. I believe the version that this provider now uses is v40.3.0

    Would you wanna give this another go?

    All 8 comments

    I started to modify azurermresource_arm_api_management_api.go to support this, but it looks as though this change will require moving to the 2019-01-01 version for API Management. The DeveloperPortal model is not available in the 2018-01-01 version of the Azure SDK for go.

    I feel like that is a much larger change than I was anticipating for this, so I'm not sure how to proceed. I think I see where that version can be changed, but some guidance might be useful.

    This issue would be great to have solved since the old portal is marked as legacy and can't be used for new api management portals

    @spyder007 Hey mate.

    The apimanagement version was updated to 2019-01-01 in Azure v39.0.0 SDK. I believe the version that this provider now uses is v40.3.0

    Would you wanna give this another go?

    @dansali I'll put it on my todo list: at the moment, we wrote a custom python script to update the certificates directly via the Azure Management API, so it's not high on my current list.

    @katbyte could someone look into this one? Should be a pretty straight forward implementation as the SDK within this repo is up to date

    I can confirm the fix works for this now, so issue can be closed, cheers!

    https://github.com/terraform-providers/terraform-provider-azurerm/issues/6714

    thanks @alanwales, this was indeed fixed by #6714 so closing as requested!

    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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

    Was this page helpful?
    0 / 5 - 0 ratings