Expose IPv6 and IPv4 assigned addresses as computed properties #13
Open
bltavares wants to merge 1 commit intocormacrelf:masterfrom
Open
Expose IPv6 and IPv4 assigned addresses as computed properties #13bltavares wants to merge 1 commit intocormacrelf:masterfrom
bltavares wants to merge 1 commit intocormacrelf:masterfrom
Conversation
7b98b58 to
681e299
Compare
Currently, the `ip_assignments` has a list of the IPs that ZeroTier provided to the member from its assignment pool. It contains a mix of IPv4 and IPv6 addresses. There is some scenarios where having the distiction of wheter it is an IPv4 or IPv6 changes which resource to create. For example using DNS records we are only allowed to create `AAAA` records in the presence of IPv6 addresses, and `A` records to IPv4. Filtering this information on Terraform is cumbersome, using the filter on list operations, while it is much easier to provide this information through the provider. This commit create two extra computed properties, `ipv6_assignments` and `ipv4_assignments`, which separates each address assignment as expected. The `ipv6_assignments` does not include RFC4139 nor 6PLANE addresses as they are always computed on the `member` resource level, even if the `network` is configured to not use those addresses, and their information is not returned by the controller API as an assigned address either.
681e299 to
04cb3d4
Compare
Open
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the
ip_assignmentshas a list of the IPs that ZeroTierprovided to the member from its assignment pool. It contains a mix of
IPv4 and IPv6 addresses.
There is some scenarios where having the distiction of wheter it is an
IPv4 or IPv6 changes which resource to create. For example using DNS
records we are only allowed to create
AAAArecords in the presence ofIPv6 addresses, and
Arecords to IPv4.Filtering this information on Terraform is cumbersome, using the filter
on list operations, while it is much easier to provide this information
through the provider.
This commit create two extra computed properties,
ipv6_assignmentsandipv4_assignments, which separates each address assignment as expected.The
ipv6_assignmentsdoes not include RFC4139 nor 6PLANE addresses asthey are always computed on the
memberresource level, even if thenetworkis configured to not use those addresses, and theirinformation is not returned by the controller API as an assigned
address either.