Reputation: 4393
I am able to perform actions such as updating the value of a record set in Route 53, but can't find an api to rename an existing record set using python boto3. The Name
parameter in the documentation is the Name
of the record set which we want to change. How do I specify the new name for the record set?
See: boto3: change_resource_record_sets()
Upvotes: 1
Views: 960
Reputation: 270294
It would appear that the Name
is the unique identifier of the Record Set.
Therefore, there is no capability to change the name.
You will need to create a new Record Set with the different name.
Upvotes: 3
Reputation: 68715
From one of my record files, which I used to update the route53 recordset. Hope it helps
try:
route53 = boto3.client('route53')
route53.change_resource_record_sets(
HostedZoneId = hosted_zone_id,
ChangeBatch={
'Changes': [
{
'Action': 'UPSERT',
'ResourceRecordSet': {
'Name': record_name,
'Type': 'A',
'ResourceRecords': [
{
'Value': ipForRecord
}
],
'TTL': 300
}
}
]
}
)
except Exception as e:
print 'Exception while updating cloud 53 record'
print e
Upvotes: 2