Skip to content

Add individual address attributes to tailscale_device data source #657

@ehassett

Description

@ehassett

Is your feature request related to a problem? Please describe.

I am unable to easily get a specific address from the tailscale_device data source as all addresses are returned in a list(string).

I need to specifically get the IPv4 address. At the moment I have a workaround although it's clunky.
I'm using OpenTofu so I'm doing (regex would work too of course):

[for ip in data.tailscale_device.foo.addresses : ip if can(cidrcontains(local.tailscale_cidr, ip))][0]

Describe the solution you'd like

I would like to see separate attributes for IPv4 and IPv6 such as ipv4_address and ipv6_address would be nice. The short and long hostnames are already available on the data source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions