i looking for a method to get the status of a record (A-NAME) just created with route53. This is the code:
changes = ResourceRecordSets(conn, "ZONEID")
change = changes.add_change("STRING FOR ADD NEW SUBDOMAIN")
change.add_value(MY_IP)
action = changes.commit()
j=json.loads(json.dumps(action))
status = j['ChangeResourceRecordSetsResponse']['ChangeInfo']['Status']
while status == 'PENDING':
time.sleep(5)
action.update() #THIS ACTION RETURN "NONE" and not update the previous state
Obviously if print the status variable it result always "PENDING"
Can anyone help me? Thanks in advance.
I went through the same problem and this is how I have solved.
Assuming that you have the ID of the A Record and it's C2T9LA0WQGXVUX in the
us-west-1
region, then we have:The response will be something like:
So, you can get the status with: