Comments (8)
As mentioned, the LinodeGo wrapper will need support for UpdateIPAddress
.
I'm thinking the resource would be linode_rdns
, and it would take a name and a list of IP addresses.
// hypothetical resource - it may not be possible, or efficient, to discover all of the addresses associated with a RDNS name.
// If this approach was taken, address would need to be a TypeSet to avoid the ordering problems of TypeList
resource "linode_rdns" "www" {
rdns = "www.example.com"
addresses = [ "${linode_instance.www.ip_address}", "${linode_instance.www.ipv6}" ]
}
or perhaps
// hypothetical resource - closely aligns to the RDNS API endpoint fields. One address per resource.
resource "linode_rdns" "www" {
rdns = "www.example.com"
address = "${linode_instance.www.ip_address}"
}
resource "linode_rdns" "www-v6" {
rdns = "www.example.com"
address = "${linode_instance.www.ipv6}"
}
or perhaps
// hypothetical resource - Two fields to represent the two addresses a Linode typically has. This is weak because there may still be a need for additional addresses to be use the same RDNS name
resource "linode_rdns" "www" {
rdns = "www.example.com"
address = "${linode_instance.www.ip_address}" // or call this address_ipv4
address_ipv6 = "${linode_instance.www.ipv6}"
}
I'm leaning towards the first or second approach.
This wouldn't be a direct 1-to-1 with the API, but I think it would be problematic to try to shoe horn an attribute like rdns
in to linode_instance
since:
- changing the RDNS doesn't really affect the instance
- you may want to apply the name to something that is not an instance IP
- you can choose to apply the RDNS name to either or both of the IPv4 and IPv6 addresses
from terraform-provider-linode.
RDNS support was added to LinodeGo in linode/linodego#66
This can move forward.
from terraform-provider-linode.
Is there a timeline for when the Reverse DNS support will be shipped?
from terraform-provider-linode.
@hielee The short answer is that I don't have a timeline for this.
Feedback like this is a key motivator that there is interest in a feature. @rmcintosh happened to ask me if this was a feature of the Terraform provider today too.
This now holds a much more central position on my personal radar.
PRs always welcome. I think I can find time in the next 30 days to work on this.
This thread will hold me accountable. 🤞
from terraform-provider-linode.
I was thinking about an alternate approach that aligns with the /v4/networking/ips
space, which includes RDNS, IPv4 sharing, IPv4 assignment, and address details (such as routing address).
This would be a linode_address
resource, and would combine the features of:
GET /networking/ips/{address}
(address details)POST /networking/ips
(assign additional IP to Linode)PUT /networking/ips/{address}
(set RDNS)POST /networking/ipv4/assign
(assign/move IP address)POST /networking/ipv4/share
(floating IP support, multiple Linodes can bring up a specific set of IP addresses (but in practice, only one instance at a time can use any particular address))
It could look like this:
linode_address
address
optional/computed- When provided this resource will represent an existing IP address. It may be used to update the RDNS value, or establish sharing the address with a set of Linodes or reassign the address to a specific Linode (this means both a primary linode_id and a shareable list of linode_ids would be needed as fields)
- When not provided, this is a request to create a add a new IP address to the Linode specified by
linode_id
(sharing could be established using thelinode_ids
field (should this prefixed?sharing_
?))
rnds
optional/computed- When set with a value, the RDNS name to assign to this address
- When set and empty, clears the RDNS name of this address
public
optional/computed (bool) Public or Private, needed when creating a new address, but also returned/computed when getting the details of an existing addresstype
optional/computed 'ipv4' or 'ipv6', this is a required field when adding an IP address, but it is also computed when retrieving details of an address
The other fields that would be provided would align with those provided by GET /networking/ips/{address}
Taking advantage of the API design and aligning these properties and functions with a related resource feels idiomatic for Terraform.
But, I don't know if this is a sound design for a Terraform resource. The data
resource aspect of this seems like a code smell. By data
resource aspect, I mean the ability to provide an existing address and have a resource that doesn't create something, but instead is populated with the values of something that already exists.
Another concern is that this resource would encompass nearly all IPv4 and some IPv6 API methods. Trying to shoehorn the remaining IPv6 features into this one resource is tempting, but I'm not convinced that they can be made to fit. Especially because these remaining endpoints deal with ranges/pools of IPv6 addresses.
from terraform-provider-linode.
@dave-lew99 would this approach suite your needs?
from terraform-provider-linode.
Swapping IP addresses may interfere with parallel provisioning steps and might require rebooting nodes to apply the desired changes. Floating IPs (IP Failover, IP Sharing) don't require a swap so it should be safe in a Terraform setting.
The IP donor node may need to be accessed/provisioned over IPv6.
from terraform-provider-linode.
I'm not too famlier with the Linode platform and it's particular behaviour, but yes that sounds like it would work for us.
On other platforms we create a floating IP allocation in terraform, then have create_before_destroy set on the instance - causing the new instance to be launched and have the IP assigned to the new instance before the old one is destroyed.
I suppose we could also use a load balancer - this would allow us to keep the same IP/DNS config and zero downtime, but it's additional cost and complexity.
from terraform-provider-linode.
Related Issues (20)
- [Feature]: Add the ability to assign a firewall to a NodeBalancer using Terraform HOT 1
- [Bug]: Panic when deleting disk after new one is created HOT 2
- [Bug]: StackScript creation error => You don't have permission to access "http://api.linode.com/v4/linode/stackscripts" HOT 3
- [Bug]: Cannot find `linode_nodebalancer_node` when updating in place HOT 3
- [Feature]: Support "force delete" for bucket HOT 2
- [Bug]: Inconsistent plan HOT 2
- [Bug]: `group` attribute not being removed HOT 2
- [Bug]: No proper error handling for invalid requests HOT 1
- [Feature]: Add tags to LKE pool HOT 5
- [Bug]: v2.17.0 not published to Terraform Registry HOT 2
- [Bug]: Unable to use `linode_lke_node_pool` with `linode_lke_cluster` HOT 2
- [Bug]: Stackscript RFC3339 error HOT 1
- [Bug]: Terraform is deleting the cluster node pools on every apply HOT 6
- [Bug]: linode_instance_config keep reverting to booted=false HOT 3
- [Feature]: LKE improvements - Basic use cases HOT 2
- [Feature]: Export "private_ipv4" attribute of the Nodebalancer resource HOT 1
- [Bug]: Changing node type in linode_lke_node_pool does not trigger a replacement HOT 1
- [Bug]: Resource linode_instance_shared_ips update fails when linode_id attribute changes HOT 1
- [Bug]: failed to get control plane ACL for LKE cluster XXXXXX: [404] Not found HOT 2
- [Bug]: blocker -- checksum list has unexpected SHA-256 hash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-linode.