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

Some data sources not supported for azurerm #621

Closed
shahbhavya85 opened this issue Dec 12, 2017 · 6 comments
Closed

Some data sources not supported for azurerm #621

shahbhavya85 opened this issue Dec 12, 2017 · 6 comments

Comments

@shahbhavya85
Copy link

Terraform Version

Terraform v0.10.8

Affected Resource(s)

  • azurerm_network_security_group
  • azurerm_virtual_network
  • azurerm_subnet

Trying to use data source for above resources and it fails.

Error: data.azurerm_network_security_group.test: Provider doesn't support data source: azurerm_network_security_group
Error: data.azurerm_subnet.test: "address_prefix": this field cannot be set
Error: data.azurerm_virtual_network.test: Provider doesn't support data source: azurerm_virtual_network

@tombuildsstuff
Copy link
Contributor

Hey @shahbhavya85

Thanks for opening this issue :)

To answer each question in-line:

Error: data.azurerm_network_security_group.test: Provider doesn't support data source: azurerm_network_security_group

This is a good spot and I've opened #623 which includes a new data source for Network Security Groups - which should land in the next release

Error: data.azurerm_subnet.test: "address_prefix": this field cannot be set

The address_prefix field is returned from this data source when a name/resource group name are specified - are you looking to be able to filter on this field? So that we can understand this further - would it be possible to share the use-case here?

Error: data.azurerm_virtual_network.test: Provider doesn't support data source: azurerm_virtual_network

Support for this was merged in #533 which will be going out in the next release

Thanks!

@shahbhavya85
Copy link
Author

Thanks for quick around!

I found the error what I was doing wrong. Instead of using resource.azurerm_subnet.test was using data.azurerm_subnet.test. Updated and it resolved the issue for me.

@tombuildsstuff
Copy link
Contributor

@shahbhavya85 awesome - thanks for confirming that. I've just released v1.0.0 of the AzureRM Provider which includes support for the network security group data source.

Given that I believe this issue is resolved and I'm going to close this issue for the moment; but please feel free to re-open it if you're still having issues and we'll take another look :)

Thanks!

@shahbhavya85
Copy link
Author

@tombuildsstuff Awesome!!

@AhmedAZafar
Copy link

AhmedAZafar commented Mar 25, 2019

Hi same issue when using provider 1.22.0.

My terraform file contains:

provider "azurerm" {
    version = "=1.22.0"
}

resource "azurerm_resource_group" "test_resource_group" {
    name = "test_resource_group"
    location = "North Europe"
}

resource "azurerm_network_security_group" "test_network_security_group" {
    name = "test_network_security_group"
    location = "${azurerm_resource_group.test_resource_group.location}"
    resource_group_name = "${azurerm_resource_group.test_resource_group.name}"
}

resource "azurerm_virutal_network" "test_network" {
    name = "test_network"
    resource_group_name = "${azurerm_resource_group.test_resource_group.name}"
    location = "${azurerm_resource_group.test_resource_group.location}"
    address_space = ["10.0.0.0/16"]
}

Getting the following error:

Screenshot 2019-03-25 at 15 33 00

Any help would be greatly appreciated

@tombuildsstuff
Copy link
Contributor

@AhmedAZafar the data source is azurerm_virtual_network and not azurerm_virutal_network (mis-spelling) 😄

Since this issue's been resolved for over a year now I'm going to lock this issue for the moment; however please open a new issue if that doesn't work for you and we'll take another look.

Thanks!

@hashicorp hashicorp locked as resolved and limited conversation to collaborators Mar 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants