Route53 backend should be global (#5414)
This commit is contained in:
parent
d2e6fa4cdb
commit
4e9fba5f28
@ -249,7 +249,7 @@ class RecordSet(CloudFormationModel):
|
||||
|
||||
def delete(self, account_id, region): # pylint: disable=unused-argument
|
||||
"""Not exposed as part of the Route 53 API - used for CloudFormation"""
|
||||
backend = route53_backends[account_id][region]
|
||||
backend = route53_backends[account_id]["global"]
|
||||
hosted_zone = backend.get_hosted_zone_by_name(self.hosted_zone_name)
|
||||
if not hosted_zone:
|
||||
hosted_zone = backend.get_hosted_zone(self.hosted_zone_id)
|
||||
|
@ -224,3 +224,21 @@ def test_route53_with_update():
|
||||
|
||||
record_set = rrsets[0]
|
||||
record_set["ResourceRecords"][0]["Value"].should.equal("my_other.example.com")
|
||||
|
||||
|
||||
@mock_cloudformation
|
||||
@mock_route53
|
||||
def test_delete_route53_recordset():
|
||||
|
||||
cf = boto3.client("cloudformation", region_name="us-west-1")
|
||||
|
||||
# given a stack with a record set
|
||||
stack_name = "test_stack_recordset_delete"
|
||||
template_json = json.dumps(route53_health_check.template)
|
||||
|
||||
cf.create_stack(StackName=stack_name, TemplateBody=template_json)
|
||||
|
||||
# when the stack is deleted
|
||||
cf.delete_stack(StackName=stack_name)
|
||||
|
||||
# then it should not error
|
||||
|
Loading…
Reference in New Issue
Block a user