Closed yaakovfeldman closed 5 months ago
There the minimal IAM policy required: https://github.com/libdns/route53
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": [
"route53:ListResourceRecordSets",
"route53:GetChange",
"route53:ChangeResourceRecordSets"
],
"Resource": [
"arn:aws:route53:::hostedzone/Zone_Id",
"arn:aws:route53:::change/*"
]
},
{
"Sid": "",
"Effect": "Allow",
"Action": [
"route53:ListHostedZonesByName",
"route53:ListHostedZones"
],
"Resource": "*"
}
]
}
As you can see there the additional route53:GetChange access and the arn:aws:route53:::change/*
resource.
This is used when a non-documented wait_for_propagation option was set:
// Provider implements the libdns interfaces for Route53
type Provider struct {
MaxRetries int `json:"max_retries,omitempty"`
MaxWaitDur time.Duration `json:"max_wait_dur,omitempty"`
WaitForPropagation bool `json:"wait_for_propagation,omitempty"`
Region string `json:"region,omitempty"`
AWSProfile string `json:"aws_profile,omitempty"`
AccessKeyId string `json:"access_key_id,omitempty"`
SecretAccessKey string `json:"secret_access_key,omitempty"`
Token string `json:"token,omitempty"`
client *r53.Client
}
// Waiting for propagation if it's set in the provider config.
if p.WaitForPropagation {
changeInput := &r53.GetChangeInput{
Id: changeResult.ChangeInfo.Id,
}
// Wait for the RecordSetChange status to be "INSYNC"
waiter := r53.NewResourceRecordSetsChangedWaiter(p.client)
err = waiter.Wait(ctx, changeInput, p.MaxWaitDur)
if err != nil {
return err
}
}
Returns the current status of a change batch request. The status is one of the following values:
The documentation should probably mention the minimum IAM roles needed for route53 for this to work. The following worked for me (single hosted zone, wildcard subdomains) although it could surely be improved with eg conditional matching policies.
(Replace
ZZZZZZZZ
with your zone id)