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

Azure Orbital Contact Profile - adding a channel should not require deleting the contact profile #25078

Closed
1 task done
rmelick-muon opened this issue Feb 28, 2024 · 4 comments · Fixed by #25129
Closed
1 task done

Comments

@rmelick-muon
Copy link

rmelick-muon commented Feb 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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 and review the contribution guide to help.

Terraform Version

1.3.9

AzureRM Provider Version

3.93.0

Affected Resource(s)/Data Source(s)

azurerm_orbital_contact_profile

Terraform Configuration Files

Original terraform configuration

resource "azurerm_resource_group" "modify-channels" {
  name     = "tests"
  location = "westus2"
}

resource "azurerm_virtual_network" "modify-channels" {
  name                = "modify-channels-vnet"
  resource_group_name = azurerm_resource_group.modify-channels.name
  location            = azurerm_resource_group.modify-channels.location

  address_space = [
    "192.168.1.0/24",
  ]
}

resource "azurerm_subnet" "modify-channels" {
  name                 = "modify-channels-subnet"
  resource_group_name  = azurerm_resource_group.modify-channels.name
  virtual_network_name = azurerm_virtual_network.modify-channels.name

  address_prefixes = [
    "192.168.1.0/24"
  ]


  delegation {
    name = "Microsoft.Orbital.orbitalGateways"
    service_delegation {
      name = "Microsoft.Orbital/orbitalGateways"
      actions = [
        "Microsoft.Network/publicIPAddresses/join/action",
        "Microsoft.Network/virtualNetworks/subnets/join/action",
        "Microsoft.Network/virtualNetworks/read",
        "Microsoft.Network/publicIPAddresses/read"
      ]
    }
  }
}

resource "azurerm_orbital_contact_profile" "modify-channels" {
  name                              = "ModifyChannels"
  resource_group_name               = azurerm_resource_group.modify-channels.name
  location                          = "westus2"
  minimum_variable_contact_duration = "PT1M"
  minimum_elevation_degrees         = 5
  auto_tracking                     = "disabled"

  links {
    name         = "Test-Downlink"
    direction    = "Downlink"
    polarization = "RHCP"
    channels {
      name                 = "Channel1"
      center_frequency_mhz = 8160
      bandwidth_mhz        = 15
      end_point {
        end_point_name = "test"
        ip_address     = "192.168.1.1"
        port           = "50000"
        protocol       = "UDP"
      }
    }

#    channels {
#      name                 = "Channel2"
#      center_frequency_mhz = 8060
#      bandwidth_mhz        = 15
#      end_point {
#        end_point_name = "test"
#        ip_address     = "192.168.1.1"
#        port           = "50001"
#        protocol       = "UDP"
#      }
#    }
  }

  network_configuration_subnet_id = azurerm_subnet.modify-channels.id
  event_hub_uri = "XXX"
}

Terraform config that adds a new channel to the Contact Profile

resource "azurerm_resource_group" "modify-channels" {
  name     = "tests"
  location = "westus2"
}

resource "azurerm_virtual_network" "modify-channels" {
  name                = "modify-channels-vnet"
  resource_group_name = azurerm_resource_group.modify-channels.name
  location            = azurerm_resource_group.modify-channels.location

  address_space = [
    "192.168.1.0/24",
  ]
}

resource "azurerm_subnet" "modify-channels" {
  name                 = "modify-channels-subnet"
  resource_group_name  = azurerm_resource_group.modify-channels.name
  virtual_network_name = azurerm_virtual_network.modify-channels.name

  address_prefixes = [
    "192.168.1.0/24"
  ]


  delegation {
    name = "Microsoft.Orbital.orbitalGateways"
    service_delegation {
      name = "Microsoft.Orbital/orbitalGateways"
      actions = [
        "Microsoft.Network/publicIPAddresses/join/action",
        "Microsoft.Network/virtualNetworks/subnets/join/action",
        "Microsoft.Network/virtualNetworks/read",
        "Microsoft.Network/publicIPAddresses/read"
      ]
    }
  }
}

resource "azurerm_orbital_contact_profile" "modify-channels" {
  name                              = "ModifyChannels"
  resource_group_name               = azurerm_resource_group.modify-channels.name
  location                          = "westus2"
  minimum_variable_contact_duration = "PT1M"
  minimum_elevation_degrees         = 5
  auto_tracking                     = "disabled"

  links {
    name         = "Test-Downlink"
    direction    = "Downlink"
    polarization = "RHCP"
    channels {
      name                 = "Channel1"
      center_frequency_mhz = 8160
      bandwidth_mhz        = 15
      end_point {
        end_point_name = "test"
        ip_address     = "192.168.1.1"
        port           = "50000"
        protocol       = "UDP"
      }
    }

    channels {
      name                 = "Channel2"
      center_frequency_mhz = 8060
      bandwidth_mhz        = 15
      end_point {
        end_point_name = "test"
        ip_address     = "192.168.1.1"
        port           = "50001"
        protocol       = "UDP"
      }
    }
  }

  network_configuration_subnet_id = azurerm_subnet.modify-channels.id
  event_hub_uri = "XXX"
}

Debug Output/Panic Output

Here is the output of terraform plan

Terraform will perform the following actions:

  # module.XXX.azurerm_orbital_contact_profile.modify-channels must be replaced
-/+ resource "azurerm_orbital_contact_profile" "modify-channels" {
      ~ id                                = "/subscriptions/XXX/resourceGroups/tests/providers/Microsoft.Orbital/contactProfiles/ModifyChannels" -> (known after apply)
        name                              = "ModifyChannels"
      - tags                              = {} -> null
        # (7 unchanged attributes hidden)

      ~ links {
            name         = "Test-Downlink"
            # (2 unchanged attributes hidden)

          ~ channels { # forces replacement
                name                 = "Channel1"
                # (2 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }
          + channels { # forces replacement
              + bandwidth_mhz        = 15
              + center_frequency_mhz = 8060
              + name                 = "Channel2"

              + end_point {
                  + end_point_name = "test"
                  + ip_address     = "192.168.1.1"
                  + port           = "50001"
                  + protocol       = "UDP"
                }
            }
        }
    }

Plan: 1 to add, 0 to change, 1 to destroy.

Expected Behaviour

Adding an additional channel should not require deleting the contact profile. The API has a way to update the contact profile. And, from the Azure portal I am able to add a new channel without deleting the contact profile.
Screenshot 2024-02-28 at 6 53 40 AM
Screenshot 2024-02-28 at 6 53 29 AM

Actual Behaviour

The terraform plan showed that it needed to delete the contact profile before it could add a channel.

Steps to Reproduce

  1. terraform plan

Important Factoids

No response

References

No response

@rmelick-muon
Copy link
Author

Terraform needing to delete the contact profile is an issue, because you cannot delete a contact profile if you have ever used that profile to conduct a Contact in the past (unless you also delete all of those past Contact objects)

@ziyeqf
Copy link
Contributor

ziyeqf commented Mar 4, 2024

Hi @rmelick-muon, thanks for reporting.

I have opened a PR for this(#25129), once it merged & released it should be fixed.

Thanks

@rmelick-muon
Copy link
Author

Thanks @ziyeqf! Looking forward to testing once it's released :)

@github-actions github-actions bot added this to the v3.95.0 milestone Mar 5, 2024
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 Apr 20, 2024
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.

3 participants