Skip to content

Instantly share code, notes, and snippets.

@fracek
Created May 9, 2020 15:15
Show Gist options
  • Save fracek/a94ff73d42b8f1aa180abe885982f7a4 to your computer and use it in GitHub Desktop.
Save fracek/a94ff73d42b8f1aa180abe885982f7a4 to your computer and use it in GitHub Desktop.
var dkimRecords = new ArrayList();
for (int i = 0; i < 1; i++)
{
dkimRecords.Add(new Record($"{name}-dkim-token-{i}", new RecordArgs
{
ZoneId = zone.ZoneId,
Name = domainDkim.DkimTokens.Apply(tokens =>
domainDkim.Domain.Apply(domain =>
$"{tokens[i]}._domainkey.{domain}")),
Type = "CNAME",
Ttl = 600,
Records =
{
domainDkim.DkimTokens.Apply(tokens =>
$"{tokens[i]}.dkim.amazonses.com")
}
}, new CustomResourceOptions
{
Parent = this,
}));
}
var dkimRecords = domainDkim.DkimTokens.Apply(tokens =>
tokens.Select((token, idx) =>
new Record($"{name}-dkim-token-{idx}", new RecordArgs
{
ZoneId = zone.ZoneId,
Name = domainDkim.Domain.Apply(domain => $"{token}._domainkey.{domain}"),
Type = "CNAME",
Ttl = 600,
Records = {$"{token}.dkim.amazonses.com"}
}, new CustomResourceOptions
{
Parent = this,
})));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment