How can I get the public IP of an RDS instance the same way we do with the ec2 module (register: ec2/with_items: ec2.instances / {{ item.public_ip }} ) ?
You might also want to look at the ec2_facts module, which should work with an RDS instance I think. Also, the ec2 inventory script should return this information and it would be in the host variables.
Thanks James but I believe in my case will be more efficient and faster to get the ip right after the RDS creation from register: new_database_facts if available.
I’m interested in determining the IP (and other facts) of a created RDS instance as well. When I create an RDS instance, I use the “wait: no” option because creating the instance takes a LONG time:
But I’d like to get the IP so I can create a Route53 entry, then use that later when I install software on the instance using this RDS.
Is there a way to retrieve this info? If not in this run – where “wait: no” would likely provide no means for the play to ask AWS for the RDS IP – then in a subsequent play?
Then let me rephrase the question: how can I get the endpoint name after creation, so I can use it to configure parameters on my app server with subsequent ansible plays?
It would see the endpoint is accessible by “your_registered_var.endpoint”, but if you specify “wait: no”, then you don’t get that information because the endpoint is only available once RDS is available, not directly after the first API call.