Skip to content

Add abrak_uuid in arvan_iaas_abrak resource as a readonly parameter #13

Open
m-yosefpor opened this issue Aug 25, 2022 · 1 comment
Open

Comments

@m-yosefpor
Copy link

m-yosefpor commented Aug 25, 2022

Right now it's not possible to get instance uuid directly from arvan_iaas_abrak resource and we need to define a data block with depends_on which is cumbersome. There should be an option like what arvan_iaas_subnet has for network_uuid to be able to get abarak_uuid directly from resource block.

After this, in network attach we can easily do:

resource "arvan_iaas_network_attach" "sample" {
    abrak_uuid = arvan_iaas_abrak.something.abrak_uuid
    network_uuid = arvan_iaas_subnet.something.network_uuid
    region = var.region

}

instead of :

data "arvan_iaas_abrak" "get_abrak_id" {
  depends_on = [
    arvan_iaas_abrak.something
  ]

  region = var.region
  name   = "something"
}

resource "arvan_iaas_network_attach" "sample" {
    abrak_uuid = data.get_abrak_id.id
    network_uuid = arvan_iaas_subnet.internal.network_uuid
    region = var.region
}
@m-yosefpor
Copy link
Author

m-yosefpor commented Aug 25, 2022

Although abrak_uuid is different from resource.id, but it's possible to attach networks with resouce.id as well. I think examples in this repo can be simplified:

resource "arvan_iaas_network_attach" "sample" {
    abrak_uuid = data.get_abrak_id.id
    network_uuid = arvan_iaas_subnet.internal.id
    region = var.region
}

this works!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant