From 56622c55140c0e3ce14ccf637111a4075bda7375 Mon Sep 17 00:00:00 2001 From: teowa <104055472+teowa@users.noreply.github.com> Date: Fri, 17 Apr 2026 04:09:11 +0000 Subject: [PATCH 1/2] azurerm_nat_gateway_public_ip_prefix_association - support associating IPv6 Public IP Prefixes --- ...y_public_ip_prefix_association_resource.go | 154 ++++++++++------ ...lic_ip_prefix_association_resource_test.go | 170 ++++++++++++++++-- ...public_ip_prefix_association.html.markdown | 60 +++++-- 3 files changed, 295 insertions(+), 89 deletions(-) diff --git a/internal/services/network/nat_gateway_public_ip_prefix_association_resource.go b/internal/services/network/nat_gateway_public_ip_prefix_association_resource.go index 8dd76c528c06..b34715c6add7 100644 --- a/internal/services/network/nat_gateway_public_ip_prefix_association_resource.go +++ b/internal/services/network/nat_gateway_public_ip_prefix_association_resource.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes" "github.com/hashicorp/go-azure-sdk/resource-manager/network/2025-01-01/natgateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2025-01-01/publicipprefixes" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -71,8 +71,8 @@ func resourceNATGatewayPublicIpPrefixAssociationCreate(d *pluginsdk.ResourceData return err } - locks.ByName(natGatewayId.NatGatewayName, natGatewayResourceName) - defer locks.UnlockByName(natGatewayId.NatGatewayName, natGatewayResourceName) + locks.ByID(natGatewayId.ID()) + defer locks.UnlockByID(natGatewayId.ID()) natGateway, err := client.Get(ctx, *natGatewayId, natgateways.DefaultGetOperationOptions()) if err != nil { @@ -89,27 +89,42 @@ func resourceNATGatewayPublicIpPrefixAssociationCreate(d *pluginsdk.ResourceData return fmt.Errorf("retrieving %s: `properties` was nil", natGatewayId) } - id := commonids.NewCompositeResourceID(natGatewayId, publicIpPrefixId) - - publicIpPrefixes := make([]natgateways.SubResource, 0) - if natGateway.Model.Properties.PublicIPPrefixes != nil { - for _, existingPublicIPPrefix := range *natGateway.Model.Properties.PublicIPPrefixes { - if existingPublicIPPrefix.Id == nil { - continue - } + publicIpPrefix, err := meta.(*clients.Client).Network.PublicIPPrefixes.Get(ctx, *publicIpPrefixId, publicipprefixes.DefaultGetOperationOptions()) + if err != nil { + if response.WasNotFound(publicIpPrefix.HttpResponse) { + return fmt.Errorf("%s was not found", publicIpPrefixId) + } + return fmt.Errorf("retrieving %s: %+v", publicIpPrefixId, err) + } + if publicIpPrefix.Model == nil { + return fmt.Errorf("retrieving %s: `model` was nil", publicIpPrefixId) + } + if publicIpPrefix.Model.Properties == nil { + return fmt.Errorf("retrieving %s: `properties` was nil", publicIpPrefixId) + } - if strings.EqualFold(*existingPublicIPPrefix.Id, publicIpPrefixId.ID()) { - return tf.ImportAsExistsError("azurerm_nat_gateway_public_ip_prefix_association", id.ID()) - } + isIPv6 := pointer.From(publicIpPrefix.Model.Properties.PublicIPAddressVersion) == publicipprefixes.IPVersionIPvSix + id := commonids.NewCompositeResourceID(natGatewayId, publicIpPrefixId) - publicIpPrefixes = append(publicIpPrefixes, existingPublicIPPrefix) + gatewayProperties := natGateway.Model.Properties + publicIpPrefixes := pointer.From(gatewayProperties.PublicIPPrefixes) + if isIPv6 { + publicIpPrefixes = pointer.From(gatewayProperties.PublicIPPrefixesV6) + } + for _, existingPublicIPPrefix := range publicIpPrefixes { + if strings.EqualFold(pointer.From(existingPublicIPPrefix.Id), publicIpPrefixId.ID()) { + return tf.ImportAsExistsError("azurerm_nat_gateway_public_ip_prefix_association", id.ID()) } } publicIpPrefixes = append(publicIpPrefixes, natgateways.SubResource{ Id: pointer.To(publicIpPrefixId.ID()), }) - natGateway.Model.Properties.PublicIPPrefixes = &publicIpPrefixes + if isIPv6 { + gatewayProperties.PublicIPPrefixesV6 = pointer.To(publicIpPrefixes) + } else { + gatewayProperties.PublicIPPrefixes = pointer.To(publicIpPrefixes) + } if err := client.CreateOrUpdateThenPoll(ctx, *natGatewayId, *natGateway.Model); err != nil { return fmt.Errorf("updating %s: %+v", natGatewayId, err) @@ -140,32 +155,16 @@ func resourceNATGatewayPublicIpPrefixAssociationRead(d *pluginsdk.ResourceData, return fmt.Errorf("retrieving %s: %+v", id.First, err) } - if model := natGateway.Model; model != nil { - if props := model.Properties; props != nil { - if props.PublicIPPrefixes == nil { - log.Printf("[DEBUG] %s doesn't have any Public IP Prefixes - removing from state!", id.First) - d.SetId("") - return nil - } - - publicIPPrefixId := "" - for _, pipp := range *props.PublicIPPrefixes { - if pipp.Id == nil { - continue - } - - if strings.EqualFold(*pipp.Id, id.Second.ID()) { - publicIPPrefixId = *pipp.Id - break - } - } - - if publicIPPrefixId == "" { - log.Printf("[DEBUG] Association between %s and %s was not found - removing from state", id.First, id.Second) - d.SetId("") - return nil - } - } + if natGateway.Model == nil { + return fmt.Errorf("retrieving %s: `model` was nil", id.First) + } + if natGateway.Model.Properties == nil { + return fmt.Errorf("retrieving %s: `properties` was nil", id.First) + } + if !natGatewayPublicIpPrefixAssociationExists(natGateway.Model.Properties, id.Second.ID()) { + log.Printf("[DEBUG] Association between %s and %s was not found - removing from state", id.First, id.Second) + d.SetId("") + return nil } d.Set("nat_gateway_id", id.First.ID()) @@ -184,8 +183,8 @@ func resourceNATGatewayPublicIpPrefixAssociationDelete(d *pluginsdk.ResourceData return err } - locks.ByName(id.First.NatGatewayName, natGatewayResourceName) - defer locks.UnlockByName(id.First.NatGatewayName, natGatewayResourceName) + locks.ByID(id.First.ID()) + defer locks.UnlockByID(id.First.ID()) natGateway, err := client.Get(ctx, *id.First, natgateways.DefaultGetOperationOptions()) if err != nil { @@ -202,23 +201,64 @@ func resourceNATGatewayPublicIpPrefixAssociationDelete(d *pluginsdk.ResourceData return fmt.Errorf("retrieving %s: `properties` was nil", id.First) } - publicIpPrefixes := make([]natgateways.SubResource, 0) - if publicIPPrefixes := natGateway.Model.Properties.PublicIPPrefixes; publicIPPrefixes != nil { - for _, publicIPPrefix := range *publicIPPrefixes { - if publicIPPrefix.Id == nil { - continue - } - - if !strings.EqualFold(*publicIPPrefix.Id, id.Second.ID()) { - publicIpPrefixes = append(publicIpPrefixes, publicIPPrefix) - } - } + if !removeNATGatewayPublicIpPrefixAssociation(natGateway.Model.Properties, id.Second.ID()) { + return nil } - natGateway.Model.Properties.PublicIPPrefixes = &publicIpPrefixes if err := client.CreateOrUpdateThenPoll(ctx, *id.First, *natGateway.Model); err != nil { - return fmt.Errorf("removing association between %s and %s: %+v", id.First, id.Second, err) + return fmt.Errorf("deleting %s: %+v", id, err) } return nil } + +func natGatewayPublicIpPrefixAssociationExists(properties *natgateways.NatGatewayPropertiesFormat, publicIpPrefixId string) bool { + if properties == nil { + return false + } + + for _, publicIpPrefix := range pointer.From(properties.PublicIPPrefixes) { + if strings.EqualFold(pointer.From(publicIpPrefix.Id), publicIpPrefixId) { + return true + } + } + + for _, publicIpPrefix := range pointer.From(properties.PublicIPPrefixesV6) { + if strings.EqualFold(pointer.From(publicIpPrefix.Id), publicIpPrefixId) { + return true + } + } + + return false +} + +func removeNATGatewayPublicIpPrefixAssociation(properties *natgateways.NatGatewayPropertiesFormat, publicIpPrefixId string) bool { + if properties == nil { + return false + } + + removed := false + updatedIPv4Prefixes := make([]natgateways.SubResource, 0) + for _, publicIpPrefix := range pointer.From(properties.PublicIPPrefixes) { + if strings.EqualFold(pointer.From(publicIpPrefix.Id), publicIpPrefixId) { + removed = true + continue + } + + updatedIPv4Prefixes = append(updatedIPv4Prefixes, publicIpPrefix) + } + properties.PublicIPPrefixes = pointer.To(updatedIPv4Prefixes) + + updatedIPv6Prefixes := make([]natgateways.SubResource, 0) + for _, publicIpPrefix := range pointer.From(properties.PublicIPPrefixesV6) { + if strings.EqualFold(pointer.From(publicIpPrefix.Id), publicIpPrefixId) { + removed = true + continue + } + + updatedIPv6Prefixes = append(updatedIPv6Prefixes, publicIpPrefix) + } + properties.PublicIPPrefixesV6 = pointer.To(updatedIPv6Prefixes) + + return removed +} diff --git a/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go b/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go index 1685eabcb2b3..9040d411e529 100644 --- a/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go +++ b/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes" "github.com/hashicorp/go-azure-sdk/resource-manager/network/2025-01-01/natgateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2025-01-01/publicipprefixes" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -59,6 +59,34 @@ func TestAccNatGatewayPublicIpPrefixAssociation_updateNatGateway(t *testing.T) { }) } +func TestAccNatGatewayPublicIpPrefixAssociation_ipv6(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_nat_gateway_public_ip_prefix_association", "test") + r := NatGatewayPublicIpPrefixAssociationResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.ipv6(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccNatGatewayPublicIpPrefixAssociation_multipleAssociations(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_nat_gateway_public_ip_prefix_association", "test") + r := NatGatewayPublicIpPrefixAssociationResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.multipleAssociations(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func TestAccNatGatewayPublicIpPrefixAssociation_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_nat_gateway_public_ip_prefix_association", "test") r := NatGatewayPublicIpPrefixAssociationResource{} @@ -101,13 +129,16 @@ func (t NatGatewayPublicIpPrefixAssociationResource) Exists(ctx context.Context, found := false if model := resp.Model; model != nil { if props := model.Properties; props != nil { - if props.PublicIPPrefixes != nil { - for _, pip := range *props.PublicIPPrefixes { - if pip.Id == nil { - continue - } + for _, pip := range pointer.From(props.PublicIPPrefixes) { + if strings.EqualFold(pointer.From(pip.Id), id.Second.ID()) { + found = true + break + } + } - if strings.EqualFold(*pip.Id, id.Second.ID()) { + if !found { + for _, pip := range pointer.From(props.PublicIPPrefixesV6) { + if strings.EqualFold(pointer.From(pip.Id), id.Second.ID()) { found = true break } @@ -139,15 +170,25 @@ func (NatGatewayPublicIpPrefixAssociationResource) Destroy(ctx context.Context, return nil, fmt.Errorf("retrieving %s: `properties` was nil", id.First) } - updatedPrefixes := make([]natgateways.SubResource, 0) - if publicIpPrefixes := resp.Model.Properties.PublicIPPrefixes; publicIpPrefixes != nil { - for _, publicIpPrefix := range *publicIpPrefixes { - if !strings.EqualFold(*publicIpPrefix.Id, id.Second.ID()) { - updatedPrefixes = append(updatedPrefixes, publicIpPrefix) - } + updatedIPv4Prefixes := make([]natgateways.SubResource, 0) + for _, publicIpPrefix := range pointer.From(resp.Model.Properties.PublicIPPrefixes) { + if strings.EqualFold(pointer.From(publicIpPrefix.Id), id.Second.ID()) { + continue + } + + updatedIPv4Prefixes = append(updatedIPv4Prefixes, publicIpPrefix) + } + resp.Model.Properties.PublicIPPrefixes = pointer.To(updatedIPv4Prefixes) + + updatedIPv6Prefixes := make([]natgateways.SubResource, 0) + for _, publicIpPrefix := range pointer.From(resp.Model.Properties.PublicIPPrefixesV6) { + if strings.EqualFold(pointer.From(publicIpPrefix.Id), id.Second.ID()) { + continue } + + updatedIPv6Prefixes = append(updatedIPv6Prefixes, publicIpPrefix) } - resp.Model.Properties.PublicIPPrefixes = &updatedPrefixes + resp.Model.Properties.PublicIPPrefixesV6 = pointer.To(updatedIPv6Prefixes) if err := client.Network.NatGateways.CreateOrUpdateThenPoll(ctx2, *id.First, *resp.Model); err != nil { return nil, fmt.Errorf("deleting %s: %+v", id, err) @@ -158,10 +199,10 @@ func (NatGatewayPublicIpPrefixAssociationResource) Destroy(ctx context.Context, func (r NatGatewayPublicIpPrefixAssociationResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` -%s +%[1]s resource "azurerm_nat_gateway" "test" { - name = "acctest-NatGateway-%d" + name = "acctest-NatGateway-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name sku_name = "Standard" @@ -187,10 +228,10 @@ resource "azurerm_nat_gateway_public_ip_prefix_association" "import" { func (r NatGatewayPublicIpPrefixAssociationResource) updateNatGateway(data acceptance.TestData) string { return fmt.Sprintf(` -%s +%[1]s resource "azurerm_nat_gateway" "test" { - name = "acctest-NatGateway-%d" + name = "acctest-NatGateway-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name sku_name = "Standard" @@ -206,6 +247,47 @@ resource "azurerm_nat_gateway_public_ip_prefix_association" "test" { `, r.template(data), data.RandomInteger) } +func (r NatGatewayPublicIpPrefixAssociationResource) ipv6(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s + +resource "azurerm_nat_gateway" "test" { + name = "acctest-NatGateway-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "StandardV2" +} + +resource "azurerm_nat_gateway_public_ip_prefix_association" "test" { + nat_gateway_id = azurerm_nat_gateway.test.id + public_ip_prefix_id = azurerm_public_ip_prefix.test.id +} +`, r.templateIPv6(data, string(publicipprefixes.PublicIPPrefixSkuNameStandardVTwo)), data.RandomInteger) +} + +func (r NatGatewayPublicIpPrefixAssociationResource) multipleAssociations(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s + +resource "azurerm_nat_gateway" "test" { + name = "acctest-NatGateway-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "StandardV2" +} + +resource "azurerm_nat_gateway_public_ip_prefix_association" "test" { + nat_gateway_id = azurerm_nat_gateway.test.id + public_ip_prefix_id = azurerm_public_ip_prefix.test.id +} + +resource "azurerm_nat_gateway_public_ip_prefix_association" "test2" { + nat_gateway_id = azurerm_nat_gateway.test.id + public_ip_prefix_id = azurerm_public_ip_prefix.test2.id +} +`, r.templateDualStack(data), data.RandomInteger) +} + func (NatGatewayPublicIpPrefixAssociationResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -226,3 +308,55 @@ resource "azurerm_public_ip_prefix" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } + +func (NatGatewayPublicIpPrefixAssociationResource) templateIPv6(data acceptance.TestData, sku string) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-ngpi-v6-%[1]d" + location = "%[2]s" +} + +resource "azurerm_public_ip_prefix" "test" { + name = "acctestpublicIPPrefixV6-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + ip_version = "IPv6" + prefix_length = 127 + sku = "%[3]s" +} +`, data.RandomInteger, data.Locations.Primary, sku) +} + +func (NatGatewayPublicIpPrefixAssociationResource) templateDualStack(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-ngpi-dual-%[1]d" + location = "%[2]s" +} + +resource "azurerm_public_ip_prefix" "test" { + name = "acctestpublicIPPrefix-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + prefix_length = 30 + sku = "StandardV2" +} + +resource "azurerm_public_ip_prefix" "test2" { + name = "acctestpublicIPPrefixV6-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + ip_version = "IPv6" + prefix_length = 127 + sku = "StandardV2" +} +`, data.RandomInteger, data.Locations.Primary) +} diff --git a/website/docs/r/nat_gateway_public_ip_prefix_association.html.markdown b/website/docs/r/nat_gateway_public_ip_prefix_association.html.markdown index 1e2158244d3e..26fc18b5dcff 100644 --- a/website/docs/r/nat_gateway_public_ip_prefix_association.html.markdown +++ b/website/docs/r/nat_gateway_public_ip_prefix_association.html.markdown @@ -3,24 +3,24 @@ subcategory: "Network" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_nat_gateway_public_ip_prefix_association" description: |- - Manages the association between a NAT Gateway and a Public IP Prefix. + Manages a NAT Gateway Public IP Prefix association. --- # azurerm_nat_gateway_public_ip_prefix_association -Manages the association between a NAT Gateway and a Public IP Prefix. +Manages a NAT Gateway Public IP Prefix association. ## Example Usage ```hcl resource "azurerm_resource_group" "example" { - name = "example-resources" + name = "example-resource-group" location = "West Europe" } resource "azurerm_public_ip_prefix" "example" { - name = "example" + name = "example-public-ip-prefix" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name prefix_length = 30 @@ -28,7 +28,7 @@ resource "azurerm_public_ip_prefix" "example" { } resource "azurerm_nat_gateway" "example" { - name = "example-NatGateway" + name = "example-nat-gateway" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name sku_name = "Standard" @@ -40,39 +40,71 @@ resource "azurerm_nat_gateway_public_ip_prefix_association" "example" { } ``` +## Example Usage for IPv6 + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resource-group" + location = "West Europe" +} + +resource "azurerm_public_ip_prefix" "example" { + name = "example-public-ip-prefix" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + ip_version = "IPv6" + prefix_length = 127 + sku = "StandardV2" +} + +resource "azurerm_nat_gateway" "example" { + name = "example-nat-gateway" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + sku_name = "StandardV2" +} + +resource "azurerm_nat_gateway_public_ip_prefix_association" "example" { + nat_gateway_id = azurerm_nat_gateway.example.id + public_ip_prefix_id = azurerm_public_ip_prefix.example.id +} +``` + ## Arguments Reference The following arguments are supported: * `nat_gateway_id` - (Required) The ID of the NAT Gateway. Changing this forces a new resource to be created. -* `public_ip_prefix_id` - (Required) The ID of the Public IP Prefix which this NAT Gateway which should be connected to. Changing this forces a new resource to be created. +* `public_ip_prefix_id` - (Required) The ID of the Public IP Prefix which this NAT Gateway should be connected to. Changing this forces a new resource to be created. + +~> **Note:** When `nat_gateway_id` references a NAT Gateway with SKU `Standard`, `public_ip_prefix_id` must reference a Public IP Prefix with SKU `Standard`. When `nat_gateway_id` references a NAT Gateway with SKU `StandardV2`, `public_ip_prefix_id` must reference a Public IP Prefix with SKU `StandardV2`. -~> **Note:** When `nat_gateway_id` references a `StandardV2` NAT Gateway, `public_ip_prefix_id` must reference a `StandardV2` Public IP Prefix. Azure rejects `Standard` Public IP Prefixes with `StandardV2` NAT Gateways, and this incompatibility is not validated during terraform plan phase. +~> **Note:** When `public_ip_prefix_id` references an `IPv6` Public IP Prefix, `nat_gateway_id` must reference a NAT Gateway with SKU `StandardV2`, and `public_ip_prefix_id` must reference an `IPv6` Public IP Prefix with SKU `StandardV2`. ## Attributes Reference In addition to the Arguments listed above - the following Attributes are exported: -* `id` - The (Terraform specific) ID of the Association between the NAT Gateway and the Public IP Prefix. +* `id` - The Terraform-specific ID of the NAT Gateway Public IP Prefix association. ## Timeouts The `timeouts` block allows you to specify [timeouts](https://developer.hashicorp.com/terraform/language/resources/configure#define-operation-timeouts) for certain actions: -* `create` - (Defaults to 30 minutes) Used when creating the association between the NAT Gateway and the Public IP Prefix. -* `read` - (Defaults to 5 minutes) Used when retrieving the association between the NAT Gateway and the Public IP Prefix. -* `delete` - (Defaults to 30 minutes) Used when deleting the association between the NAT Gateway and the Public IP Prefix. +* `create` - (Defaults to 30 minutes) Used when creating the NAT Gateway Public IP Prefix association. +* `read` - (Defaults to 5 minutes) Used when retrieving the NAT Gateway Public IP Prefix association. +* `delete` - (Defaults to 30 minutes) Used when deleting the NAT Gateway Public IP Prefix association. ## Import -Associations between NAT Gateway and Public IP Prefixes can be imported using the `resource id`, e.g. +A NAT Gateway Public IP Prefix association can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_nat_gateway_public_ip_prefix_association.example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/natGateways/gateway1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/publicIPPrefixes/myPublicIpPrefix1" +terraform import azurerm_nat_gateway_public_ip_prefix_association.example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/natGateways/natGateway1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefix1" ``` --> **Note:** This is a Terraform Specific ID in the format `{natGatewayID}|{publicIPPrefixID}` +-> **Note:** This is a Terraform-specific ID in the format `{natGatewayID}|{publicIPPrefixID}`. ## API Providers From 766824643b5364aac8425f80634e6a89d1f61ce9 Mon Sep 17 00:00:00 2001 From: teowa <104055472+teowa@users.noreply.github.com> Date: Fri, 17 Apr 2026 04:28:14 +0000 Subject: [PATCH 2/2] fix vendor & terrafmt --- ...lic_ip_prefix_association_resource_test.go | 78 +++---- .../2023-09-01/publicipprefixes/README.md | 121 ---------- .../2023-09-01/publicipprefixes/client.go | 26 --- .../2023-09-01/publicipprefixes/constants.go | 215 ------------------ .../publicipprefixes/id_publicipprefix.go | 130 ----------- .../publicipprefixes/method_createorupdate.go | 75 ------ .../publicipprefixes/method_delete.go | 71 ------ .../2023-09-01/publicipprefixes/method_get.go | 83 ------- .../publicipprefixes/method_list.go | 106 --------- .../publicipprefixes/method_listall.go | 106 --------- .../publicipprefixes/method_updatetags.go | 57 ----- .../publicipprefixes/model_iptag.go | 9 - .../publicipprefixes/model_natgateway.go | 20 -- .../model_natgatewaypropertiesformat.go | 13 -- .../publicipprefixes/model_natgatewaysku.go | 8 - .../publicipprefixes/model_publicipprefix.go | 22 -- .../model_publicipprefixpropertiesformat.go | 17 -- .../model_publicipprefixsku.go | 9 - .../model_referencedpublicipaddress.go | 8 - .../publicipprefixes/model_subresource.go | 8 - .../publicipprefixes/model_tagsobject.go | 8 - .../2023-09-01/publicipprefixes/predicates.go | 37 --- .../2023-09-01/publicipprefixes/version.go | 10 - vendor/modules.txt | 1 - 24 files changed, 39 insertions(+), 1199 deletions(-) delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_createorupdate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_listall.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_updatetags.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_iptag.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgateway.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaypropertiesformat.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaysku.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefix.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixpropertiesformat.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixsku.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_referencedpublicipaddress.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_subresource.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_tagsobject.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/version.go diff --git a/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go b/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go index 9040d411e529..b4b668043dfa 100644 --- a/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go +++ b/internal/services/network/nat_gateway_public_ip_prefix_association_resource_test.go @@ -202,7 +202,7 @@ func (r NatGatewayPublicIpPrefixAssociationResource) basic(data acceptance.TestD %[1]s resource "azurerm_nat_gateway" "test" { - name = "acctest-NatGateway-%[2]d" + name = "acctest-NatGateway-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name sku_name = "Standard" @@ -231,7 +231,7 @@ func (r NatGatewayPublicIpPrefixAssociationResource) updateNatGateway(data accep %[1]s resource "azurerm_nat_gateway" "test" { - name = "acctest-NatGateway-%[2]d" + name = "acctest-NatGateway-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name sku_name = "Standard" @@ -252,15 +252,15 @@ func (r NatGatewayPublicIpPrefixAssociationResource) ipv6(data acceptance.TestDa %[1]s resource "azurerm_nat_gateway" "test" { - name = "acctest-NatGateway-%[2]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - sku_name = "StandardV2" + name = "acctest-NatGateway-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "StandardV2" } resource "azurerm_nat_gateway_public_ip_prefix_association" "test" { - nat_gateway_id = azurerm_nat_gateway.test.id - public_ip_prefix_id = azurerm_public_ip_prefix.test.id + nat_gateway_id = azurerm_nat_gateway.test.id + public_ip_prefix_id = azurerm_public_ip_prefix.test.id } `, r.templateIPv6(data, string(publicipprefixes.PublicIPPrefixSkuNameStandardVTwo)), data.RandomInteger) } @@ -270,20 +270,20 @@ func (r NatGatewayPublicIpPrefixAssociationResource) multipleAssociations(data a %[1]s resource "azurerm_nat_gateway" "test" { - name = "acctest-NatGateway-%[2]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - sku_name = "StandardV2" + name = "acctest-NatGateway-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "StandardV2" } resource "azurerm_nat_gateway_public_ip_prefix_association" "test" { - nat_gateway_id = azurerm_nat_gateway.test.id - public_ip_prefix_id = azurerm_public_ip_prefix.test.id + nat_gateway_id = azurerm_nat_gateway.test.id + public_ip_prefix_id = azurerm_public_ip_prefix.test.id } resource "azurerm_nat_gateway_public_ip_prefix_association" "test2" { - nat_gateway_id = azurerm_nat_gateway.test.id - public_ip_prefix_id = azurerm_public_ip_prefix.test2.id + nat_gateway_id = azurerm_nat_gateway.test.id + public_ip_prefix_id = azurerm_public_ip_prefix.test2.id } `, r.templateDualStack(data), data.RandomInteger) } @@ -312,21 +312,21 @@ resource "azurerm_public_ip_prefix" "test" { func (NatGatewayPublicIpPrefixAssociationResource) templateIPv6(data acceptance.TestData, sku string) string { return fmt.Sprintf(` provider "azurerm" { - features {} + features {} } resource "azurerm_resource_group" "test" { - name = "acctestRG-ngpi-v6-%[1]d" - location = "%[2]s" + name = "acctestRG-ngpi-v6-%[1]d" + location = "%[2]s" } resource "azurerm_public_ip_prefix" "test" { - name = "acctestpublicIPPrefixV6-%[1]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - ip_version = "IPv6" - prefix_length = 127 - sku = "%[3]s" + name = "acctestpublicIPPrefixV6-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + ip_version = "IPv6" + prefix_length = 127 + sku = "%[3]s" } `, data.RandomInteger, data.Locations.Primary, sku) } @@ -334,29 +334,29 @@ resource "azurerm_public_ip_prefix" "test" { func (NatGatewayPublicIpPrefixAssociationResource) templateDualStack(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { - features {} + features {} } resource "azurerm_resource_group" "test" { - name = "acctestRG-ngpi-dual-%[1]d" - location = "%[2]s" + name = "acctestRG-ngpi-dual-%[1]d" + location = "%[2]s" } resource "azurerm_public_ip_prefix" "test" { - name = "acctestpublicIPPrefix-%[1]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - prefix_length = 30 - sku = "StandardV2" + name = "acctestpublicIPPrefix-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + prefix_length = 30 + sku = "StandardV2" } resource "azurerm_public_ip_prefix" "test2" { - name = "acctestpublicIPPrefixV6-%[1]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - ip_version = "IPv6" - prefix_length = 127 - sku = "StandardV2" + name = "acctestpublicIPPrefixV6-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + ip_version = "IPv6" + prefix_length = 127 + sku = "StandardV2" } `, data.RandomInteger, data.Locations.Primary) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/README.md deleted file mode 100644 index d94ade2a53cf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes` Documentation - -The `publicipprefixes` SDK allows for interaction with Azure Resource Manager `network` (API Version `2023-09-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes" -``` - - -### Client Initialization - -```go -client := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicIPPrefixesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") - -payload := publicipprefixes.PublicIPPrefix{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Delete` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Get` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") - -read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PublicIPPrefixesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPPrefixesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPPrefixesClient.UpdateTags` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") - -payload := publicipprefixes.TagsObject{ - // ... -} - - -read, err := client.UpdateTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/client.go deleted file mode 100644 index 78db89733876..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publicipprefixes - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixesClient struct { - Client *resourcemanager.Client -} - -func NewPublicIPPrefixesClientWithBaseURI(sdkApi sdkEnv.Api) (*PublicIPPrefixesClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "publicipprefixes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublicIPPrefixesClient: %+v", err) - } - - return &PublicIPPrefixesClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/constants.go deleted file mode 100644 index a8c1328b07bf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/constants.go +++ /dev/null @@ -1,215 +0,0 @@ -package publicipprefixes - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPPrefixSkuName string - -const ( - PublicIPPrefixSkuNameStandard PublicIPPrefixSkuName = "Standard" -) - -func PossibleValuesForPublicIPPrefixSkuName() []string { - return []string{ - string(PublicIPPrefixSkuNameStandard), - } -} - -func (s *PublicIPPrefixSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPPrefixSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPPrefixSkuName(input string) (*PublicIPPrefixSkuName, error) { - vals := map[string]PublicIPPrefixSkuName{ - "standard": PublicIPPrefixSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPPrefixSkuName(input) - return &out, nil -} - -type PublicIPPrefixSkuTier string - -const ( - PublicIPPrefixSkuTierGlobal PublicIPPrefixSkuTier = "Global" - PublicIPPrefixSkuTierRegional PublicIPPrefixSkuTier = "Regional" -) - -func PossibleValuesForPublicIPPrefixSkuTier() []string { - return []string{ - string(PublicIPPrefixSkuTierGlobal), - string(PublicIPPrefixSkuTierRegional), - } -} - -func (s *PublicIPPrefixSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPPrefixSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPPrefixSkuTier(input string) (*PublicIPPrefixSkuTier, error) { - vals := map[string]PublicIPPrefixSkuTier{ - "global": PublicIPPrefixSkuTierGlobal, - "regional": PublicIPPrefixSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPPrefixSkuTier(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go deleted file mode 100644 index 04e6e6d91d1b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go +++ /dev/null @@ -1,130 +0,0 @@ -package publicipprefixes - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&PublicIPPrefixId{}) -} - -var _ resourceids.ResourceId = &PublicIPPrefixId{} - -// PublicIPPrefixId is a struct representing the Resource ID for a Public IP Prefix -type PublicIPPrefixId struct { - SubscriptionId string - ResourceGroupName string - PublicIPPrefixName string -} - -// NewPublicIPPrefixID returns a new PublicIPPrefixId struct -func NewPublicIPPrefixID(subscriptionId string, resourceGroupName string, publicIPPrefixName string) PublicIPPrefixId { - return PublicIPPrefixId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PublicIPPrefixName: publicIPPrefixName, - } -} - -// ParsePublicIPPrefixID parses 'input' into a PublicIPPrefixId -func ParsePublicIPPrefixID(input string) (*PublicIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicIPPrefixId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicIPPrefixId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublicIPPrefixIDInsensitively parses 'input' case-insensitively into a PublicIPPrefixId -// note: this method should only be used for API response data and not user input -func ParsePublicIPPrefixIDInsensitively(input string) (*PublicIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicIPPrefixId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicIPPrefixId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublicIPPrefixId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.PublicIPPrefixName, ok = input.Parsed["publicIPPrefixName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publicIPPrefixName", input) - } - - return nil -} - -// ValidatePublicIPPrefixID checks that 'input' can be parsed as a Public IP Prefix ID -func ValidatePublicIPPrefixID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParsePublicIPPrefixID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Public IP Prefix ID -func (id PublicIPPrefixId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPPrefixes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PublicIPPrefixName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Public IP Prefix ID -func (id PublicIPPrefixId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPublicIPPrefixes", "publicIPPrefixes", "publicIPPrefixes"), - resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIPPrefixName"), - } -} - -// String returns a human-readable description of this Public IP Prefix ID -func (id PublicIPPrefixId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Public IP Prefix Name: %q", id.PublicIPPrefixName), - } - return fmt.Sprintf("Public IP Prefix (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_createorupdate.go deleted file mode 100644 index eb586e03d6c7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package publicipprefixes - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPPrefix -} - -// CreateOrUpdate ... -func (c PublicIPPrefixesClient) CreateOrUpdate(ctx context.Context, id PublicIPPrefixId, input PublicIPPrefix) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PublicIPPrefixesClient) CreateOrUpdateThenPoll(ctx context.Context, id PublicIPPrefixId, input PublicIPPrefix) error { - result, err := c.CreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_delete.go deleted file mode 100644 index 4ef74511d047..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package publicipprefixes - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c PublicIPPrefixesClient) Delete(ctx context.Context, id PublicIPPrefixId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c PublicIPPrefixesClient) DeleteThenPoll(ctx context.Context, id PublicIPPrefixId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_get.go deleted file mode 100644 index 4d05c32931a5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package publicipprefixes - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPPrefix -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PublicIPPrefixesClient) Get(ctx context.Context, id PublicIPPrefixId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - OptionsObject: options, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model PublicIPPrefix - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_list.go deleted file mode 100644 index 122a9df6f37a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_list.go +++ /dev/null @@ -1,106 +0,0 @@ -package publicipprefixes - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPPrefix -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPPrefix -} - -type ListCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *ListCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// List ... -func (c PublicIPPrefixesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &ListCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPPrefixes", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PublicIPPrefix `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c PublicIPPrefixesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PublicIPPrefixOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPPrefixesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PublicIPPrefixOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PublicIPPrefix, 0) - - resp, err := c.List(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_listall.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_listall.go deleted file mode 100644 index 4c49b47b3fef..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_listall.go +++ /dev/null @@ -1,106 +0,0 @@ -package publicipprefixes - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPPrefix -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPPrefix -} - -type ListAllCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *ListAllCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// ListAll ... -func (c PublicIPPrefixesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &ListAllCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPPrefixes", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PublicIPPrefix `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c PublicIPPrefixesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, PublicIPPrefixOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPPrefixesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PublicIPPrefixOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]PublicIPPrefix, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_updatetags.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_updatetags.go deleted file mode 100644 index 3111479b00a6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/method_updatetags.go +++ /dev/null @@ -1,57 +0,0 @@ -package publicipprefixes - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPPrefix -} - -// UpdateTags ... -func (c PublicIPPrefixesClient) UpdateTags(ctx context.Context, id PublicIPPrefixId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model PublicIPPrefix - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_iptag.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_iptag.go deleted file mode 100644 index e1bbbc73a6e2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPTag struct { - IPTagType *string `json:"ipTagType,omitempty"` - Tag *string `json:"tag,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgateway.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgateway.go deleted file mode 100644 index 170eeff68488..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package publicipprefixes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaypropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaypropertiesformat.go deleted file mode 100644 index 5c1f46d37373..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaysku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaysku.go deleted file mode 100644 index 465e471e9030..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefix.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefix.go deleted file mode 100644 index 6679bada47df..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefix.go +++ /dev/null @@ -1,22 +0,0 @@ -package publicipprefixes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefix struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPPrefixPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPPrefixSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixpropertiesformat.go deleted file mode 100644 index 32b58a818b38..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixpropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixPropertiesFormat struct { - CustomIPPrefix *SubResource `json:"customIPPrefix,omitempty"` - IPPrefix *string `json:"ipPrefix,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIpConfiguration,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - PrefixLength *int64 `json:"prefixLength,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAddresses *[]ReferencedPublicIPAddress `json:"publicIPAddresses,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixsku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixsku.go deleted file mode 100644 index 0737b92dee17..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_publicipprefixsku.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixSku struct { - Name *PublicIPPrefixSkuName `json:"name,omitempty"` - Tier *PublicIPPrefixSkuTier `json:"tier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_referencedpublicipaddress.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_referencedpublicipaddress.go deleted file mode 100644 index 26027a800a2b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_referencedpublicipaddress.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReferencedPublicIPAddress struct { - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_subresource.go deleted file mode 100644 index 53e3c780cbf1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_tagsobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_tagsobject.go deleted file mode 100644 index 6a82f86f28f9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TagsObject struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/predicates.go deleted file mode 100644 index 7deb3ca2bbf0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPPrefixOperationPredicate) Matches(input PublicIPPrefix) bool { - - if p.Etag != nil && (input.Etag == nil || *p.Etag != *input.Etag) { - return false - } - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.Location == nil || *p.Location != *input.Location) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/version.go deleted file mode 100644 index aa726511b652..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01" - -func userAgent() string { - return "hashicorp/go-azure-sdk/publicipprefixes/2023-09-01" -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 3a9577c4f3ca..e291c9815cd3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -765,7 +765,6 @@ github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/networksec github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/networkvirtualappliances github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/networkwatchers github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/privateendpoints -github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/publicipprefixes github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/routefilters github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/routetables github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/virtualwans