对流层创建别名当您托管具有相同名称的区域时的记录

时间:2017-06-04 05:05:13

标签: amazon-web-services amazon-cloudformation amazon-route53 troposphere

public class MyCustomJsonSerializerSettings // not a static class
{
    private static JsonSerializerSettings _jss;

    public static JsonSerializerSettings Jss
    {
        get { return _jss; }
        private set { _jss = value; }
    }

    static MyCustomJsonSerializerSettings()
    {
        _jss = new JsonSerializerSettings { ... };
    }

    private class FooToBarConverter : JsonConverter // note that it is contained within
                                                    // the class
    {
        ...
    }
}

在这个对流层代码中,我正在尝试为我的托管区域创建一个别名A记录,例如example.com。但我有2个具有相同名称的托管区域(托管区域ID将不同)。虽然我明确提到了托管区域ID,但是云形成并没有创建堆栈说“找到重复的托管区域”。我还尝试过提及托管区域ID而没有托管区域名称也失败了。

1 个答案:

答案 0 :(得分:0)

您是否也尝试在RecordSet中使用HostedZoneId而不是HostedZoneName?这应该有效 - 我们一直在Empire中创建具有相同名称的不同区域中的Alias记录,我们的代码也使用了Cloudformation(使用类似于对流层的垫片 - 所以我们称之为对流层)。你可以在这里看到:

https://github.com/remind101/empire/blob/ac27a91f3a5131b18700c350ca510d1befed7a51/scheduler/cloudformation/template.go#L647

在对流层做类似的事情应该可以正常工作 - 只需在RecordSet和AliasTarget对象中使用HostedZoneId。