@@ -886,6 +886,27 @@ func TestAWSApplyChanges(t *testing.T) {
886
886
TTL : aws .Int64 (defaultTTL ),
887
887
ResourceRecords : []route53types.ResourceRecord {{Value : aws .String ("2606:4700:4700::1111" )}, {Value : aws .String ("2606:4700:4700::1001" )}},
888
888
},
889
+ {
890
+ Name : aws .String ("delete-test-geoproximity.zone-2.ext-dns-test-2.teapot.zalan.do." ),
891
+ Type : route53types .RRTypeA ,
892
+ TTL : aws .Int64 (defaultTTL ),
893
+ ResourceRecords : []route53types.ResourceRecord {{Value : aws .String ("1.2.3.4" )}},
894
+ SetIdentifier : aws .String ("geoproximity-delete" ),
895
+ GeoProximityLocation : & route53types.GeoProximityLocation {
896
+ AWSRegion : aws .String ("us-west-2" ),
897
+ Bias : aws .Int32 (10 ),
898
+ },
899
+ },
900
+ {
901
+ Name : aws .String ("update-test-geoproximity.zone-1.ext-dns-test-2.teapot.zalan.do." ),
902
+ Type : route53types .RRTypeA ,
903
+ TTL : aws .Int64 (defaultTTL ),
904
+ ResourceRecords : []route53types.ResourceRecord {{Value : aws .String ("1.2.3.4" )}},
905
+ SetIdentifier : aws .String ("geoproximity-update" ),
906
+ GeoProximityLocation : & route53types.GeoProximityLocation {
907
+ LocalZoneGroup : aws .String ("usw2-lax1-az2" ),
908
+ },
909
+ },
889
910
{
890
911
Name : aws .String ("weighted-to-simple.zone-1.ext-dns-test-2.teapot.zalan.do." ),
891
912
Type : route53types .RRTypeA ,
@@ -956,6 +977,13 @@ func TestAWSApplyChanges(t *testing.T) {
956
977
endpoint .NewEndpoint ("create-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "8.8.8.8" , "8.8.4.4" ),
957
978
endpoint .NewEndpoint ("create-test-multiple-aaaa.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeAAAA , "2606:4700:4700::1111" , "2606:4700:4700::1001" ),
958
979
endpoint .NewEndpoint ("create-test-mx.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeMX , "10 mailhost1.foo.elb.amazonaws.com" ),
980
+ endpoint .NewEndpoint ("create-test-geoproximity-region.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "8.8.8.8" ).
981
+ WithSetIdentifier ("geoproximity-region" ).
982
+ WithProviderSpecific (providerSpecificGeoProximityLocationAWSRegion , "us-west-2" ).
983
+ WithProviderSpecific (providerSpecificGeoProximityLocationBias , "10" ),
984
+ endpoint .NewEndpoint ("create-test-geoproximity-coordinates.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "8.8.8.8" ).
985
+ WithSetIdentifier ("geoproximity-coordinates" ).
986
+ WithProviderSpecific (providerSpecificGeoProximityLocationCoordinates , "60,60" ),
959
987
}
960
988
961
989
currentRecords := []* endpoint.Endpoint {
@@ -971,6 +999,9 @@ func TestAWSApplyChanges(t *testing.T) {
971
999
endpoint .NewEndpoint ("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeAAAA , "bar.elb.amazonaws.com" ).WithProviderSpecific (providerSpecificAlias , "true" ),
972
1000
endpoint .NewEndpoint ("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "8.8.8.8" , "8.8.4.4" ),
973
1001
endpoint .NewEndpoint ("update-test-multiple-aaaa.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeAAAA , "2606:4700:4700::1111" , "2606:4700:4700::1001" ),
1002
+ endpoint .NewEndpoint ("update-test-geoproximity.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ).
1003
+ WithSetIdentifier ("geoproximity-update" ).
1004
+ WithProviderSpecific (providerSpecificGeoProximityLocationLocalZoneGroup , "usw2-lax1-az2" ),
974
1005
endpoint .NewEndpoint ("weighted-to-simple.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ).WithSetIdentifier ("weighted-to-simple" ).WithProviderSpecific (providerSpecificWeight , "10" ),
975
1006
endpoint .NewEndpoint ("simple-to-weighted.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ),
976
1007
endpoint .NewEndpoint ("policy-change.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ).WithSetIdentifier ("policy-change" ).WithProviderSpecific (providerSpecificWeight , "10" ),
@@ -992,6 +1023,9 @@ func TestAWSApplyChanges(t *testing.T) {
992
1023
endpoint .NewEndpoint ("update-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeAAAA , "baz.elb.amazonaws.com" ).WithProviderSpecific (providerSpecificAlias , "true" ),
993
1024
endpoint .NewEndpoint ("update-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" , "4.3.2.1" ),
994
1025
endpoint .NewEndpoint ("update-test-multiple-aaaa.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeAAAA , "2606:4700:4700::1001" , "2606:4700:4700::1111" ),
1026
+ endpoint .NewEndpoint ("update-test-geoproximity.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ).
1027
+ WithSetIdentifier ("geoproximity-update" ).
1028
+ WithProviderSpecific (providerSpecificGeoProximityLocationLocalZoneGroup , "usw2-phx2-az1" ),
995
1029
endpoint .NewEndpoint ("weighted-to-simple.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ),
996
1030
endpoint .NewEndpoint ("simple-to-weighted.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ).WithSetIdentifier ("simple-to-weighted" ).WithProviderSpecific (providerSpecificWeight , "10" ),
997
1031
endpoint .NewEndpoint ("policy-change.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ).WithSetIdentifier ("policy-change" ).WithProviderSpecific (providerSpecificRegion , "us-east-1" ),
@@ -1010,6 +1044,7 @@ func TestAWSApplyChanges(t *testing.T) {
1010
1044
endpoint .NewEndpoint ("delete-test-cname-alias.zone-1.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeAAAA , "qux.elb.amazonaws.com" ).WithProviderSpecific (providerSpecificAlias , "true" ),
1011
1045
endpoint .NewEndpoint ("delete-test-multiple.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" , "4.3.2.1" ),
1012
1046
endpoint .NewEndpoint ("delete-test-multiple-aaaa.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeAAAA , "2606:4700:4700::1111" , "2606:4700:4700::1001" ),
1047
+ endpoint .NewEndpoint ("delete-test-geoproximity.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeA , "1.2.3.4" ).WithSetIdentifier ("geoproximity-delete" ).WithProviderSpecific (providerSpecificGeoProximityLocationAWSRegion , "us-west-2" ).WithProviderSpecific (providerSpecificGeoProximityLocationBias , "10" ),
1013
1048
endpoint .NewEndpoint ("delete-test-mx.zone-2.ext-dns-test-2.teapot.zalan.do" , endpoint .RecordTypeMX , "30 mailhost1.foo.elb.amazonaws.com" ),
1014
1049
}
1015
1050
@@ -1159,6 +1194,40 @@ func TestAWSApplyChanges(t *testing.T) {
1159
1194
TTL : aws .Int64 (defaultTTL ),
1160
1195
ResourceRecords : []route53types.ResourceRecord {{Value : aws .String ("10 mailhost1.foo.elb.amazonaws.com" )}},
1161
1196
},
1197
+ {
1198
+ Name : aws .String ("create-test-geoproximity-region.zone-1.ext-dns-test-2.teapot.zalan.do." ),
1199
+ Type : route53types .RRTypeA ,
1200
+ TTL : aws .Int64 (defaultTTL ),
1201
+ ResourceRecords : []route53types.ResourceRecord {{Value : aws .String ("8.8.8.8" )}},
1202
+ SetIdentifier : aws .String ("geoproximity-region" ),
1203
+ GeoProximityLocation : & route53types.GeoProximityLocation {
1204
+ AWSRegion : aws .String ("us-west-2" ),
1205
+ Bias : aws .Int32 (10 ),
1206
+ },
1207
+ },
1208
+ {
1209
+ Name : aws .String ("update-test-geoproximity.zone-1.ext-dns-test-2.teapot.zalan.do." ),
1210
+ Type : route53types .RRTypeA ,
1211
+ TTL : aws .Int64 (defaultTTL ),
1212
+ ResourceRecords : []route53types.ResourceRecord {{Value : aws .String ("1.2.3.4" )}},
1213
+ SetIdentifier : aws .String ("geoproximity-update" ),
1214
+ GeoProximityLocation : & route53types.GeoProximityLocation {
1215
+ LocalZoneGroup : aws .String ("usw2-phx2-az1" ),
1216
+ },
1217
+ },
1218
+ {
1219
+ Name : aws .String ("create-test-geoproximity-coordinates.zone-1.ext-dns-test-2.teapot.zalan.do." ),
1220
+ Type : route53types .RRTypeA ,
1221
+ TTL : aws .Int64 (defaultTTL ),
1222
+ ResourceRecords : []route53types.ResourceRecord {{Value : aws .String ("8.8.8.8" )}},
1223
+ SetIdentifier : aws .String ("geoproximity-coordinates" ),
1224
+ GeoProximityLocation : & route53types.GeoProximityLocation {
1225
+ Coordinates : & route53types.Coordinates {
1226
+ Latitude : aws .String ("60" ),
1227
+ Longitude : aws .String ("60" ),
1228
+ },
1229
+ },
1230
+ },
1162
1231
})
1163
1232
validateRecords (t , listAWSRecords (t , provider .clients [defaultAWSProfile ], "/hostedzone/zone-2.ext-dns-test-2.teapot.zalan.do." ), []route53types.ResourceRecordSet {
1164
1233
{
0 commit comments