Monday, 15 February 2010

php - Update TTL in existing Route53 Resource Record set -



php - Update TTL in existing Route53 Resource Record set -

i have few records in route53 account. want mass update ttl of them.

the logic i'm using records using "listresourcerecordsets" operation. create next alter object each record.

array( 'action' => 'upsert', 'resourcerecordset' => array( 'name' => old_cname, 'type' => 'a', 'ttl' => new_ttl, 'resourcerecords' => array(array( 'value' => old_ip )), ));

then send "changeresourcerecordsets" request alter objects created in lastly step.

route53 returning error validation errors: [changebatch][changes][0][change][action] must 1 of "create" or "delete" [changebatch][changes][1][change][action] must 1 of "create" or "delete" )

p.s. couldn't find upsert illustration changeresourcerecordsets call.

either update aws sdk later version supports upsert or first have delete record set(s) , add together them new changes.

upsert added in 2014: https://aws.amazon.com/blogs/aws/new-features-for-route-53-improved-health-checks-https-record-modification/ must have old sdk.

to without upsert:

array( 'action' => 'delete', 'resourcerecordset' => array( 'name' => old_cname, 'type' => 'a', 'ttl' => old_ttl, 'resourcerecords' => array(array( 'value' => old_ip )), ));

and then:

array( 'action' => 'create', 'resourcerecordset' => array( 'name' => old_cname, 'type' => 'a', 'ttl' => new_ttl, 'resourcerecords' => array(array( 'value' => old_ip )), ));

php amazon-web-services amazon-route53

No comments:

Post a Comment