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

azurerm_api_management - remove check that public_ip_address_id must be specified when zone is provided #27976

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions internal/services/apimanagement/api_management_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,9 +843,6 @@ func resourceApiManagementServiceCreate(d *pluginsdk.ResourceData, meta interfac
return errors.New("`zones` is only supported when sku type is `Premium`")
}

if publicIpAddressId == "" {
return errors.New("`public_ip_address` must be specified when `zones` are provided")
}
zones := zones.ExpandUntyped(v)
properties.Zones = &zones
}
Expand Down Expand Up @@ -1133,9 +1130,6 @@ func resourceApiManagementServiceUpdate(d *pluginsdk.ResourceData, meta interfac
return errors.New("`zones` is only supported when sku type is `Premium`")
}

if d.Get("public_ip_address_id").(string) == "" {
return errors.New("`public_ip_address` must be specified when `zones` are provided")
}
zones := zones.ExpandUntyped(v)
payload.Zones = &zones
}
Expand Down
10 changes: 0 additions & 10 deletions internal/services/apimanagement/api_management_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,15 +1097,6 @@ resource "azurerm_subnet_network_security_group_association" "test" {
network_security_group_id = azurerm_network_security_group.test.id
}

resource "azurerm_public_ip" "test" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for removing this from the test?

Copy link
Contributor Author

@sinbai sinbai Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbfrahry thanks for your time. This was removed from the test because public_ip_address_id = azurerm_public_ip.test.id was removed from test, it is no longer in use.

name = "acctestIP-%[1]d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku = "Standard"
allocation_method = "Static"
domain_name_label = "acctest-ip-%[1]d"
}

resource "azurerm_resource_group" "test2" {
name = "acctestRG2-%[1]d"
location = "%[3]s"
Expand Down Expand Up @@ -1203,7 +1194,6 @@ resource "azurerm_api_management" "test" {
publisher_name = "pub1"
publisher_email = "pub1@email.com"
sku_name = "Premium_2"
public_ip_address_id = azurerm_public_ip.test.id
virtual_network_type = "Internal"
zones = ["1", "2"]

Expand Down
Loading