IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 667 forks source link

ibm_is_subnet is missing subnet ID that is present in ibm_is_subnets #3545

Open Nashluffy opened 2 years ago

Nashluffy commented 2 years ago

Community Note

Description

The data source ibm_is_subnet should include the subnet ID. It seems the ID is available from the API, it's just not present in the attributes. For example, I have the subnet name but I need to find it's ID, I cannot currently do that.

 Nash $ ic is subnet ....worker-1 --output json | jq -r '.id'
0737-140bb607-.....

New or Affected Resource(s)

data.ibm_is_subnet

Potential Terraform Configuration

data "ibm_is_subnet" "example" {
  name = "example-vpc"
}

References

deepaksibm commented 2 years ago

Hi @Nashluffy ,

data source for subnet contains ID attribute.

data "ibm_is_subnet" "subnet" {
    identifier = "*******"
}

this fetches the details of the subnet and also has the attribute 'id' which contains the subnet ID are you referring to a different data source or resource ?

Nashluffy commented 2 years ago

Perhaps the docs are out of date then? I don't see an id attribute for this data source. My use case is that I want to fetch the ID of a subnet given I only have the name.

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/is_subnet#attribute-reference

deepaksibm commented 2 years ago

@Nashluffy id is in the list of attributes https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/is_subnet#id

deepaksibm commented 1 year ago

Hi @Nashluffy are we good to close this issue ?