Closed chetanph closed 2 years ago
Hi @chetanph, I think you're taking terraform id
, that is why it's hard for you to work with it. The resource attributes come on an item
struct, you can take id and name parameters. I'm going let you an example. Let know us if this work for you.
resource "ciscoise_device_administration_authentication_rules" "policy_set_asa_authc_rule_default" {
parameters {
policy_id = ciscoise_device_administration_policy_set.asa.item[0].id <----- this is where UUID is required
identity_source_name = "Internal Users"
if_auth_fail = "REJECT"
if_process_fail = "DROP"
if_user_not_found = "REJECT"
rule {
name = "Default"
state = "enabled"
default = "true"
}
}
}
NOTE
In terraform.tfstate you can see more details included on resource
Thanks @fmunozmiranda! For both id
and name
, accessing them via resource.item[0]
works fine.
Happy to help.
Is your feature request related to a problem? Please describe. No
Describe the solution you'd like Would like the ability to refer to
id
andname
of a resource directly rather than having to parseid
string for UUID and name.Consider this policy set:
Once a policy set is created, its UUID is then required to create authentication and authorization rules.
In current design, once a resource is created, it's
id
is returned in a format like"id:=05d9d6fd-f30b-45f2-900f-577948283817\\name:=ASA Firewalls"
.It'd be better to return
id
as just the UUID andname
as resource's name, e.g. this will work really well if it was possible.Similarly, if
name
for a managed resource needs to be referred in other place e.g.It'd be idea to work with
ciscoise_network_device_group.location_rcdn.name
andciscoise_network_device.device_type_firewall.name
.Describe alternatives you've considered
Alternatives used for
id
:ciscoise_device_administration_policy_set.asa.parameters[0].id
but this is alwaysnull
id
to JSON and the decode it.This is quite ugly and will need to be done for every policy set and other similar instances where
id
of a managed resource needs to be referred in other places. You can suggest better alternatives too. But ideally would just like to refer usingresource.id
Alternative used for
name
:ciscoise_device_administration_policy_set.asa.parameters[0].name