We have few autoscaling groups in AWS and new instances are created frequently. We are using a declarative Jenkins pipeline to publish the build artifacts to those server using publish over ssh plugin by selecting the server from drop down. We have configured the ssh servers in jenkins gloabl configuration by providing the server names and ips. We have also added the public key of jenkins to all our aws server (along with launch templates) so that jenkins can ssh to all servers without any issues.
Now, we want to dynamically modify the IPs of ssh servers in jenkins global config as soon as new instances are launched in aws autoscaling groups. How can we achieve this? We aren;t using any scripts or any jenkins files. We are jenkins 2.414.2 version.
We want to achieve auto update of the IPs in jenkins global ssh config.