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

Deprecation warning favors unknown resource #17859

Closed
1 task done
wernerfred opened this issue Aug 3, 2022 · 6 comments
Closed
1 task done

Deprecation warning favors unknown resource #17859

wernerfred opened this issue Aug 3, 2022 · 6 comments
Labels

Comments

@wernerfred
Copy link
Contributor

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

Terraform Version

1.2.5

AzureRM Provider Version

3.15.1

Affected Resource(s)/Data Source(s)

azurerm_security_center_server_vulnerability_assessment

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_virtual_network" "example" {
  name                = "example-vnet"
  resource_group_name = azurerm_resource_group.example.name
  address_space       = ["192.168.1.0/24"]
  location            = azurerm_resource_group.example.location
}

resource "azurerm_subnet" "example" {
  name                 = "example-subnet"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefixes     = ["192.168.1.0/24"]
}

resource "azurerm_network_interface" "example" {
  name                = "example-nic"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  ip_configuration {
    name                          = "vm-example"
    subnet_id                     = azurerm_subnet.example.id
    private_ip_address_allocation = "Dynamic"
  }
}

resource "azurerm_linux_virtual_machine" "example" {
  name                = "example-vm"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  size                            = "Standard_B1s"
  admin_username                  = "testadmin"
  admin_password                  = "Password1234!"
  disable_password_authentication = false

  source_image_reference {
    publisher = "OpenLogic"
    offer     = "CentOS"
    sku       = "7.5"
    version   = "latest"
  }

  os_disk {
    caching              = "ReadWrite"
    storage_account_type = "Standard_LRS"
  }

  network_interface_ids = [azurerm_network_interface.example.id]
}

resource "azurerm_security_center_server_vulnerability_assessment" "example" {
  virtual_machine_id = azurerm_linux_virtual_machine.example.id
}

Debug Output/Panic Output

╷
│ Warning: Deprecated Resource
│ 
│   with module.defaults.azurerm_security_center_server_vulnerability_assessment.this,
│   on ../../main.tf line 380, in resource "azurerm_security_center_server_vulnerability_assessment" "this":
│  380: resource "azurerm_security_center_server_vulnerability_assessment" "this" {
│ 
│ This resource has been deprecated in favour of the
│ 'azurerm_security_center_vm_server_vulnerability_assessment' resource and
│ will be removed in v4.0 of the AzureRM Provider
╵

Expected Behaviour

The deprecation warning should reference an existing resource. For example instead of azurerm_security_center_server_vulnerability_assessment use azurerm_security_center_server_vulnerability_assessment_virtual_machine

Actual Behaviour

The deprecation warning shows that one should use azurerm_security_center_vm_server_vulnerability_assessment which isn't available in the registry/provider

Steps to Reproduce

No response

Important Factoids

No response

References

#15747

@wernerfred wernerfred added the bug label Aug 3, 2022
@github-actions github-actions bot removed the bug label Aug 3, 2022
@liuwuliuyun
Copy link
Contributor

Hi @wernerfred , could you try azurerm_security_center_server_vulnerability_assessment_virtual_machine to see if it fits your request? Here is the link https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/security_center_server_vulnerability_assessment_virtual_machine

Maybe we dont need to add a new resource but to modify the deprecation warning.

@liuwuliuyun
Copy link
Contributor

liuwuliuyun commented Aug 4, 2022

Since we haven't supported Hybrid Virtual Machines yet (#15990). I think we could modify doc and warning line in code to say 'This resource has been deprecated in favour of the 'azurerm_security_center_server_vulnerability_assessment_virtual_machine' resource'

@liuwuliuyun
Copy link
Contributor

PR raised to fix this: #17874

@wernerfred
Copy link
Contributor Author

wernerfred commented Aug 4, 2022

Hi @wernerfred , could you try azurerm_security_center_server_vulnerability_assessment_virtual_machine to see if it fits your request? Here is the link https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/security_center_server_vulnerability_assessment_virtual_machine

Maybe we dont need to add a new resource but to modify the deprecation warning.

The new resource azurerm_security_center_server_vulnerability_assessment_virtual_machine behaves same way as azurerm_security_center_server_vulnerability_assessment. Both resources looks exactly same with only 1 difference that hybrid_machine_id was removed in new resource. (Which is expected)

So your linked PR that changes the description is the best solution!

Thx for fast response and action

@rcskosir
Copy link
Contributor

rcskosir commented Jun 5, 2023

@wernerfred Thanks for taking the time to submit this issue. It looks like this has been resolved as of #17874. As such, I am going to mark this issue as closed.

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 May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants