You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and review the contribution guide to help.
Terraform Version
Terraform 0.13+
AzureRM Provider Version
3.65.0
Affected Resource(s)/Data Source(s)
azurerm_api_management_api
Terraform Configuration Files
resource"azurerm_api_management_api""createAPIv1r1" {
name=var.api_nameresource_group_name=data.azurerm_resource_group.rg.nameapi_management_name=data.azurerm_api_management.apim.namedisplay_name=var.api_display_namepath=var.api_pathservice_url=var.api_service_url_v1revision="1"revision_description="This is the revision 1"protocols=["https"]
import {
content_format=var.api_content_formatcontent_value=var.api_specification_v1r1
}
}
resource"azurerm_api_management_api""createAPIv1r2" {
name=var.api_nameresource_group_name=data.azurerm_resource_group.rg.nameapi_management_name=data.azurerm_api_management.apim.nameservice_url=var.api_service_url_v1revision="2"source_api_id=azurerm_api_management_api.createAPIv1r1.idrevision_description="This is the revision 2"import {
content_format=var.api_content_formatcontent_value=var.api_specification_v1r2
}
}
Debug Output/Panic Output
Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=400 -- Original Error: Code="ValidationError" Message="Can't change property Name for non-current revision "
Expected Behaviour
The expectation is to have two revisions (1 and 2) in the APIM for this API.
Actual Behaviour
Terraform has been successfully initialized!
azurerm_api_management_api.createAPIv1r1: Creating...
azurerm_api_management_api.createAPIv1r1: Still creating... [10s elapsed]
azurerm_api_management_api.createAPIv1r1: Still creating... [20s elapsed]
azurerm_api_management_api.createAPIv1r1: Still creating... [30s elapsed]
azurerm_api_management_api.createAPIv1r1: Creation complete after 32s [id=/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/apis/000]
azurerm_api_management_api.createAPIv1r2: Creating...
azurerm_api_management_api.createAPIv1r2: Still creating... [10s elapsed]
azurerm_api_management_api.createAPIv1r2: Still creating... [20s elapsed]
..........
azurerm_api_management_api.createAPIv1r2: Still creating... [3m30s elapsed]
│ Error: waiting on creating/updating Api: (Name "api_name" / Service Name "000" / Resource Group "000"): Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=400 -- Original Error: Code="ValidationError" Message="Can't change property Name for non-current revision "
│
│ with azurerm_api_management_api.createAPIv1r2,
│ on main.tf line AA, in resource "azurerm_api_management_api" "createAPIv1r2":
│ AA: resource "azurerm_api_management_api" "createAPIv1r2" {
│
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Steps to Reproduce
terraform apply
Important Factoids
No response
References
Related issue: #22380 #18093 #19069
Mentioned related issues at least used one of the below properties. Therefore, the similar error occurred (e.g. "Can't change property one of the below properties name for non-current revision will be displayed")
Caution
If you are editing a non-current revision of an API, you cannot change the following properties: Name
Type
Description
Subscription required
API version
API version description
Path
Protocols
These properties can only be changed in the current revision. If your edits change any of the above properties of a non-current revision, the error message Can't change property for non-current revision will be displayed."
While the terraform plan runs that tried to provide the name information. Which is most likely the error caused (Message="Can't change property Name for non-current revision "). See image below:
The solution should/could be to create another resource like azurerm_api_management_api_revision, where the the name argument should not be require. As well as all of the above shouldn't be also part of required argument.
Hence, resource azurerm_api_management_api_revision could be based on the argument source_api_id and required, not on the name (required).
Is there an existing issue for this?
Community Note
Terraform Version
Terraform 0.13+
AzureRM Provider Version
3.65.0
Affected Resource(s)/Data Source(s)
azurerm_api_management_api
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The expectation is to have two revisions (1 and 2) in the APIM for this API.
Actual Behaviour
Terraform has been successfully initialized!
azurerm_api_management_api.createAPIv1r1: Creating...
azurerm_api_management_api.createAPIv1r1: Still creating... [10s elapsed]
azurerm_api_management_api.createAPIv1r1: Still creating... [20s elapsed]
azurerm_api_management_api.createAPIv1r1: Still creating... [30s elapsed]
azurerm_api_management_api.createAPIv1r1: Creation complete after 32s [id=/subscriptions/000/resourceGroups/000/providers/Microsoft.ApiManagement/service/000/apis/000]
azurerm_api_management_api.createAPIv1r2: Creating...
azurerm_api_management_api.createAPIv1r2: Still creating... [10s elapsed]
azurerm_api_management_api.createAPIv1r2: Still creating... [20s elapsed]
..........
azurerm_api_management_api.createAPIv1r2: Still creating... [3m30s elapsed]
│ Error: waiting on creating/updating Api: (Name "api_name" / Service Name "000" / Resource Group "000"): Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=400 -- Original Error: Code="ValidationError" Message="Can't change property Name for non-current revision "
│
│ with azurerm_api_management_api.createAPIv1r2,
│ on main.tf line AA, in resource "azurerm_api_management_api" "createAPIv1r2":
│ AA: resource "azurerm_api_management_api" "createAPIv1r2" {
│
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Steps to Reproduce
terraform apply
Important Factoids
No response
References
Related issue:
#22380
#18093
#19069
Mentioned related issues at least used one of the below properties. Therefore, the similar error occurred (e.g. "Can't change property one of the below properties name for non-current revision will be displayed")
References: Revisions in Azure API Management (https://learn.microsoft.com/en-us/azure/api-management/api-management-revisions), in this page the section "Revision descriptions" clearly says that in the "Name" should not be provided.
From the page:
While the
terraform plan
runs that tried to provide thename
information. Which is most likely the error caused (Message="Can't change property Name for non-current revision "). See image below:The solution should/could be to create another resource like
azurerm_api_management_api_revision
, where the thename
argument should not be require. As well as all of the above shouldn't be also part of required argument.Hence, resource
azurerm_api_management_api_revision
could be based on the argumentsource_api_id
and required, not on thename
(required).References: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api for the arguments
name
(required).The text was updated successfully, but these errors were encountered: