Commit graph

48 commits

Author SHA1 Message Date
Tom Limoncelli 724d5ff6c7
ROUTE53: Fix R53_ALIAS creation failure (#938)
Fixes https://github.com/StackExchange/dnscontrol/issues/937

* Add integration test to repro https://github.com/StackExchange/dnscontrol/issues/937
* Reformat integration tests to be more readable.
* ROUTE53: Create CNAME/R53_ALIAS in best order
* Each R53_ALIAS_* should be its own change, not combined.
* Refactor and simplify (omg it has gotten ugly)
2020-11-12 00:30:40 -05:00
Tom Limoncelli ca30c9c34f
Rename provider handles to *Provider (#914) 2020-10-26 09:25:30 -04:00
Tom Limoncelli d56a8307f3
Be more consistent in API handle variable names (#911) 2020-10-25 12:58:43 -04:00
Tom Limoncelli de308c0952
Lint: Fix ST1005: error strings should not be capitalized (#834) 2020-08-30 19:52:37 -04:00
Mike Cochrane 59747a96f0
Cleanup: Bubble errors up from diff instead of panic (#799) (#817) 2020-08-20 15:49:00 -04:00
Blake Bourque ea328263c7
Route53 uses a custom record type for SPF (#787)
Much like OVH Route53 when queried returns SPF records as their own
type. This small change transcribes the SPF type to TXT

See: https://github.com/StackExchange/dnscontrol/issues/446
See: 644ba70e87/providers/ovh/ovhProvider.go (L169-L172)
2020-07-17 13:02:42 -04:00
Tom Limoncelli 541bb805da
linting (#777) 2020-07-06 20:18:24 -04:00
Tom Limoncelli 24b7d0641e Update github.com/StackExchange/dnscontrol/v2 2020-04-14 16:49:03 -04:00
Tom Limoncelli 24484f1e0c
move providers/diff to pkg/diff like we should have 2 years ago (#692)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-03-10 16:35:43 -04:00
Tom Limoncelli 3f68215841
GetNameservers is inconsistent across providers (#655)
* Warn if GetNameservers returns FQDN+dot strings
* Simplify logic that covers for the inconsistency
* Fix azuredns, gcloud, bind, route53
* Clean up cloudflare, digitalocean, dnsimple, gandi_v5, namedotcom
2020-03-01 10:33:24 -05:00
Tom Limoncelli 386275fde1
ROUTE53: Fully implement get-zones (#638)
* ROUTE53: Implement ListZones

* DNSIMPLE: Fix comment
2020-02-20 15:07:34 -05:00
Tom Limoncelli 87ad01d194
Add "get-zone" command (#613)
* Add GetZoneRecords to DNSProvider interface
* dnscontrol now uses ufave/cli/v2
* NEW: get-zones.md
* HasRecordTypeName should be a method on models.Records not models.DomainConfig
* Implement BIND's GetZoneRecords
* new WriteZoneFile implemented
* go mod vendor
* Update docs to use get-zone instead of convertzone
* Add CanGetZone capability and update all providers.
* Get all zones for a provider at once (#626)
* implement GetZoneRecords for cloudflare
* munge cloudflare ttls
* Implement GetZoneRecords for cloudflare (#625)

Co-authored-by: Craig Peterson <192540+captncraig@users.noreply.github.com>
2020-02-18 08:59:18 -05:00
Patrick Gaskin 6e8d5b59ab Fixed issues from go vet (#605)
* CloudFlare provider is missing quotes on a JSON struct tag.
* ACME package has a unnecessary JSON struct tag.
* Route53 provider has an unreachable return.
2020-01-28 12:10:58 -05:00
Patrick Gaskin 825ba2d081 Switch to Go 1.13 error wrapping (#604)
* Replaced errors.Wrap with fmt.Errorf (#589)

* Find:    errors\.Wrap\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)

* Replaced errors.Wrapf with fmt.Errorf (#589)

* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)
* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])(,[^)]+)\)
* Replace: fmt.Errorf($2: %w$3$4, $1)

* Replaced errors.Errorf with fmt.Errorf (#589)

* Find:    errors\.Errorf
  Replace: fmt.Errorf

* Cleaned up remaining imports

* Cleanup

* Regenerate provider support matrix

This was broken by #533 ... and it's now the third time this has been missed.
2020-01-28 11:06:56 -05:00
Patrick Gaskin 2f83aa9302 Internals: Switch to v2 go.mod, drop GOPATH, and fix Azure Pipelines (#595)
* Switched to v2 go.mod

Also set GO111MODULE=on in build stuff to always use Go modules
even when in GOPATH.

* Ensure go.mod, go.sum, and vendor are up to date

* Attempt to fix Azure pipelines

* Add set -e to properly fail on exit (it didn't seem to be
  propagating properly before).
* Set workingDirectory for GoFmt and GoGen (this might be why it
  fails unlike compile and unitests).

* Another attempt to fix Azure Pipelines

* Use the Go env template for all go-related jobs.

* Completely fixed Azure Pipelines

* Added a display name to GoFmt for consistency.
* Fixed diffs for GoFmt and GoGen.
* Show git status for checks.

* Drop GOPATH for tests

TODO: Do the same for integration tests.

* Drop GOPATH for integration tests

* Show more diffs

* Regenerate provider support matrix

This wasn't done in #590...
2020-01-28 10:42:31 -05:00
mm 7df73b187c ROUTE53: Messages don't display correctly in big batch mode (#580)
* fixed description for paginated r53 updates

Signed-off-by: marco.messerschmidt <marco.messerschmidt@zalando.de>

* fixed description for paginated r53 updates

Signed-off-by: marco.messerschmidt <marco.messerschmidt@zalando.de>

* Update route53Provider.go

reset batch site
2020-01-10 08:47:20 -05:00
Hugo Barros 0f396cd135 ROUTE53: Add AWS_PROFILE functionality (#567)
* Add AWS_PROFILE functionality for Route53 provider

* Document named profiles authentication option for Route53
2019-12-04 10:17:28 -05:00
Craig Peterson 364aac5073 fix format 2019-06-27 01:21:23 -04:00
Craig Peterson 394b9ccf41
respect max batch size for r53 (#509) 2019-06-26 23:45:34 -04:00
Riley Berton 82d4660816 ROUTE53/GCLOUD: Add Delegation/nameserver Sets (#448)
- Support DelegationSet for Route53 (create-domains only)
- Retry Route53 operations which fail for rate limits under large numbers of domains
- Support for name_server_set for GCloud (create-domains only)
- Docs for both
2019-02-19 12:30:39 -05:00
Craig Peterson d006f62f8f make sure key/value grouping always uses fqdn 2018-09-07 13:46:44 -04:00
ashleyhull-versent e616cd7979 Update route53Provider.go (#401) 2018-09-04 12:58:02 -04:00
Ed Bardsley 61c92c9215 Correctly group R53_ALIAS records during IncrementalDiff. (#399)
Previously, unnecessary corrections were possible if both an R53_ALIAS
pointing to an A record and to an AAAA record existed for the same label,
and map iteration over existing and desired found them in different orders.
(This is a common configuration for IPv6-enabled records.)

This commit:
 * mirrors key logic in the R53 provider
 * centralizes logic around keys in the models package
 * adds tests
2018-09-04 10:55:27 -04:00
Craig Peterson e680fb9a46 ROUTE53: Bug: fix corner case when deleting alias (#394) 2018-08-23 17:46:50 -04:00
Koen Rouwhorst 921fa98490 Include record set type in record key. (#336) 2018-06-25 14:15:21 -04:00
domelu 8db97d1132 BUG: ROUTE53 crashes if traffic flow policy records exist (#330)
* skip traffic policy records
2018-03-08 11:59:40 -05:00
Craig Peterson 19ca760072 fix for deleting wildcard from r53. includes failing integration test 2018-03-01 10:09:02 -05:00
Tom Limoncelli de4455942b
Refactor RecordConfig: Add getters/setters (#314)
* Replace RecordConfig.Name and .NameFQDN with getters and setters.
* Replace RecordConfig.Target with getters and setters.
* Eliminate the CombinedTarget concept.
* Add RecordConfig.PopulateFromString to reduce code in all providers.
* encode and decode name.com txt records (#315)
* Replace fmt.Errorf with errors.Errorf
2018-02-15 12:02:50 -05:00
Brice Figureau 4c80526860 Fix R53_ALIAS not being registered as custom type (#310) (#311)
Apparently I've forgot to register the R53_ALIAS custom record
type, thus preventing to use R53_ALIAS in a js file.
The integration still worked fine because they probably don't run
the validation.
2018-02-01 07:39:11 -05:00
Brice Figureau 7b8d608019 ROUTE53: Support Route53's ALIAS record type (#239) (#301)
* Stable comparison of metadata (#239)

Iterating over a map in Go never produces twice the same ordering.
Thus when comparing two metadata map with more than one key, the
`differ` is always finding differences.

To properly compare records metadata, we need to iterate the maps
in a deterministic way.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>

* Support for Route53 ALIAS record type (#239)

Route53 ALIAS doesn't behave like a regular ALIAS, and is much more
limited as its target can only be some specific AWS resources or
another record in the same zone.

According to #239, this change adds a new directive R53_ALIAS which
implements this specific alias. This record type can only be used
with the Route53 provider.

This directive usage looks like this:
```js
D("example.com", REGISTRAR, DnsProvider("ROUTE53"),
R53_ALIAS("foo1", "A", "bar") // record in same zone
R53_ALIAS("foo2", "A",
  "blahblah.elasticloadbalancing.us-west-1.amazonaws.com",
   R53_ZONE('Z368ELLRRE2KJ0')) // ELB in us-west-1

```

Unfortunately, Route53 requires indicating the hosted zone id
where the target is defined (those are listed in AWS documentation,
see the R53_ALIAS documentation for links).
2018-01-16 05:53:12 -05:00
Tom Limoncelli b7c251190f
Vet and Lint the entire system (#296)
* govet and golint corrections
2018-01-09 12:53:16 -05:00
Tom Limoncelli de88bfe8b7
Add support for TXT records with multiple strings (BIND, ROUTE53) (#293)
* BIND: Support TXT records with multiple strings (#289)
* ROUTE53: Add support for TXT records with multiple strings (#292)
2018-01-04 19:19:35 -05:00
Craig Peterson ccf28349ce
Update aws libs and remove waiter (#276)
* update r53 library. Remove waiter code

* live update provider request section

* remove debug
2017-11-27 10:22:08 -05:00
Tom Limoncelli e7472f76f3 Downcase DNS names (#253)
* Downcase DNS names
* Document opinions
2017-11-07 14:12:17 -08:00
Craig Peterson 7b51f6dc55 clarify r53 alias situation 2017-09-15 13:52:10 -04:00
Craig Peterson 3a90435357 Create a dynamic provider features matrix (#201)
* adding simple provider feature matrix generator

* filling out matrix

* clean output

* dead code

* explanatory text

* explanatory text

* typo

* move stuff around

* clean

* editing
2017-09-14 16:13:17 -04:00
Koen Rouwhorst 0798e4eb0e Route 53 provider now supports CAA (#193) 2017-09-02 07:31:51 -07:00
Norm MacLennan 7f01a8c9ad #68 Registrar support for Route53 provider (#155)
* Added registrar support to Route53 provider
* ran gofmt on route53Provider
* Caveat: If you use r53 is a Registrar but not as a Dns Service Provider, DNSControl may be DNS-related API calls that you do not have IAM permissions to do.
2017-08-05 07:56:42 -07:00
Tom Limoncelli caa71c4031 Mark RecordConfig when Target contains multiple embedded fields. 2017-07-20 18:59:09 -04:00
Tom Limoncelli d55b20ecdb Add SRV Record Type (#136)
* Add support for SRV records for NAMEDOTCOM and ROUTE53.
* Improve docs
* Rename RR() to ToRR().
* Rename RecordConfig Priority to MxPreference (affects json IR data)
2017-07-19 15:53:40 -04:00
Norm MacLennan d1fba2c236 Route53 provider: pass the right correction message based on action (#151) 2017-07-14 16:03:04 -04:00
Tom Limoncelli e563c53658 PTR should handle "Classless in-addr.arpa delegation" RFC2317 (#149)
* Handle IPv4 "Classless in-addr.arpa delegation" RFC2317 (partial).
* Validate PTR name when in RFC2317 "Classless in-addr.arpa delegation" domains.
* Update docs
* Set CanUsePTR for Route53 and Google CloudDNS.
* BIND: Replace "/" with "_" in filenames.
2017-07-10 19:24:55 -04:00
Mathieu Herbert 95705e7f2d Allow more flexibility in configuring Route53 (#93)
* providers/route53/route53Provider.go

* fix fmt

* check credentials, add Route53 fetch zones in init section and add check if delegation set is present or nil
2017-05-03 11:30:05 -06:00
Craig Peterson 7073b8f989 getting tests setup for r53. Not mixing deletes and other changes in same changeset. 2017-03-22 13:08:23 -06:00
Craig Peterson 12f006441b Refactoring diff package interface (#22)
* initial refactoring of diffing

* making cloudflare and others compile

* gandi and gcloud. no idea if gandi works anymore.

* r53

* namedotcom wasn't working.
2017-01-11 12:38:07 -07:00
Craig Peterson 20bf7ef43b Seperate create-domains command (#21)
* removing auto-create from gcloud

* adding create-domains command

* implement DomainCreator for r53
2017-01-03 13:26:08 -07:00
Craig Peterson 1ea80d5347 Nameserver overhaul (#17)
* go changes to support nameservers_from

* clear nameservers before giving to dsp.

* work

* work

* nameserver updates.

* remove unused

* name.com stinks at NS records.

* whitespace

* removing web(belongs in own repo). First sketch of DSP vs NAMESERVER_FROM

* add DEFAULTS to replace defaultDsps.

* initial gcloud provider. Simple records work.

* namedotcom can do subdomain ns records now.

* fix for mx and txt

* kill dsp acronym
2016-12-16 13:10:27 -07:00
Craig Peterson ef0bbf53af migrate code for github 2016-08-22 18:31:50 -06:00