Skip to content

Commit

Permalink
Route 53: Fixed a problem where not all zones could be retrieved (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan authored Aug 29, 2024
1 parent 32550b8 commit 18a09ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion KeyVault.Acmebot/KeyVault.Acmebot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.Route53" Version="3.7.402" />
<PackageReference Include="AWSSDK.Route53" Version="3.7.402.1" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.ResourceManager.Dns" Version="1.1.1" />
<PackageReference Include="Azure.ResourceManager.PrivateDns" Version="1.1.1" />
Expand Down
17 changes: 15 additions & 2 deletions KeyVault.Acmebot/Providers/Route53Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,22 @@ public Route53Provider(Route53Options options)

public async Task<IReadOnlyList<DnsZone>> ListZonesAsync()
{
var zones = await _amazonRoute53Client.ListHostedZonesAsync();
var zones = new List<HostedZone>();

return zones.HostedZones.Select(x => new DnsZone(this) { Id = x.Id, Name = x.Name.TrimEnd('.') }).ToArray();
ListHostedZonesResponse response = null;

do
{
response = await _amazonRoute53Client.ListHostedZonesAsync(new ListHostedZonesRequest
{
Marker = response?.NextMarker
});

zones.AddRange(response.HostedZones);

} while (response.IsTruncated);

return zones.Select(x => new DnsZone(this) { Id = x.Id, Name = x.Name.TrimEnd('.') }).ToArray();
}

public Task CreateTxtRecordAsync(DnsZone zone, string relativeRecordName, IEnumerable<string> values)
Expand Down

0 comments on commit 18a09ac

Please sign in to comment.