-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dns record fixes + expansion #29
Conversation
benjvi
commented
Feb 26, 2018
- Adds "data" input so that users can specify SRV, LOC records (fixes Cloudflare - SRV DNS records #2 )
- Adds some computed api fields to give users more context ('created_on', 'modified_on','proxiable','metadata')
- Force recreation on domain changes + removes redundant zone_id lookups (this will help with, but not resolve 'terraform plan' crashes due to the rate limit in the CloudFlare API (1200 requests per 300 seconds) #21 )
- Set id blank when record is not found ( fixes Cloudflare record throwing Invalid dns record identifier #7 )
- Allow CAA records through validation ( fixes Add CAA to the valid DNS record types #26 )
- Now runs tests in parallel
beebdcf
to
60a6ea7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Two nitpicks that are not required
log.Printf("[WARN] Removing record from state because it's not found in API") | ||
d.SetId("") | ||
return nil | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need for else here because of the return.
if err!= nil {
if stringsContains .... {
///
d.SetId("")
return nil
}
return err
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in hashicorp@f01532c
d.Set("created_on", record.CreatedOn.Format(time.RFC3339Nano)) | ||
d.Set("data", expandStringMap(record.Data)) | ||
d.Set("modified_on", record.ModifiedOn.Format(time.RFC3339Nano)) | ||
d.Set("metadata", expandStringMap(record.Meta)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For non-scalar values (Maps, Lists, Sets), please check the error:
if err := d.Set("metadata", expandStringMap(record.Meta)); err != nil {
log.Printf("[WARN] Error setting metadata: %s", err)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in hashicorp@f01532c
@catsby it's nice to hear, that #2 is fixed, but i am still getting errors while creating SRV records:
Should I await until next provider release or I could get last revision and build provider on my own and use it as a custom provider? Thanks in advance! |
Hey @EpiqSty – while the fix has been merged, there has been no new release since then. Here's a list of things coming in the next release: You are welcome to pull down the master branch of this repository and build the provider yourself! This requires Go 1.9 setup on your system, but after cloning the repository simply run |
@catsby , thanks for the quick reply! Do you know anything about release plans? I mean for manual usage upgrading from sources is kind of OK, but as we are using terraform in CI/CD environment that will requires adjustment of Jenkins jobs in order to get custom provider on the Jenkins slaves and so on. So, this is a question about the release date, basically ;) If it in the near future (several weeks) we could create such records locally ( using custom provider builded from sources) and push tfstates to our terraform repo. But if we should wait for the next release several months, probably we should choose the option of using custom providers directly on the jenkins slaves. |
I do not know the release date, other than "as soon as possible". There are some other PRs and features that I believe are requested in the next release. The release date is optimistically 0-7 days, pessimistically 2-3 weeks. I cannot promise either of those, though 😄 |
well, it's good enough - thanks ;) |
@catsby I have tested creation of SRV records with latest version, build from sources, but get the same error.
Unfortunately , Cloudflare API itself has no proper documentation about fields required for creating SRV records.
|
Looks like I found the way how to define it:
I left "value" commented just in order to mention, that SRV definition with "value" only, ends up with error "Invalid or missing data for %s record", but the same record, defined as data structure works well. |