我有這個Python + boto3。此代碼運行正常,並創建一個名爲test的託管區域。然而,當我用一個新名稱test2再次運行相同的代碼塊時,我還必須將CallerReference更改爲一些唯一值,在下面的代碼中它將從awsbuilder5到awsbuilder6等。 如果我不這樣做是,我得到這個錯誤:爲什麼每次通話都必須更改CallerReference?
An error occurred (HostedZoneAlreadyExists) when calling the CreateHostedZone operation: A hosted zone has already been created with the specified caller reference.
代碼是在這裏:
response = client.create_hosted_zone (
Name = 'test',
VPC={
'VPCRegion': 'us-east-1',
'VPCId': 'vpc-958122f0'
},
CallerReference='awsbuilder5',
HostedZoneConfig={
'Comment': 'Test',
}
)