Skip to content
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

Add new redirect APIs #307

Merged
merged 24 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bf3d8c2
Add new redirect APIs
fformica Jan 31, 2024
3ccefd0
Merge branch 'master' into master
fformica Mar 7, 2024
c4195d4
Update objects
fformica Mar 7, 2024
42f6a13
Merge branch 'ns1-terraform:master' into master
fformica Apr 3, 2024
93e4f95
Merge branch 'ns1-terraform:master' into master
fformica Apr 3, 2024
caaf957
Merge branch 'ns1-terraform:master' into master
fformica May 31, 2024
18e4121
Update ns1-go
fformica May 31, 2024
8fea570
Add changelog and new version
fformica Jun 5, 2024
0dab8a1
Add note in doc
fformica Jun 5, 2024
f8be1e2
Force to use the wildcard cert in test
fformica Jun 6, 2024
e7403a2
Fix tags update
fformica Jun 6, 2024
01b1b2b
Enabling import
fformica Jun 6, 2024
413fa87
Two more test scenarios and fixes for it
fformica Jun 7, 2024
aa04657
Making cert mandatory for HTTPS and removing no-cert test scenario
fformica Jun 7, 2024
787cde0
Make cert create/delete sync by active wait, and https_enabled read-only
fformica Jun 10, 2024
c84e759
Merge branch 'ns1-terraform:master' into master
fformica Jun 14, 2024
4cae82a
Add further active waits to align to remote changes
fformica Jun 14, 2024
5d76c91
Unit test fixes
fformica Jun 14, 2024
4f99db3
Move client to runtime
fformica Jun 14, 2024
774f077
Aligning create just in case
fformica Jun 14, 2024
26dffd4
Update release date
fformica Jun 14, 2024
3bb969d
Change tags into a set, make more fields in the cert read only
fformica Jun 17, 2024
c17f502
Remove slices package that isn't supported on older go
fformica Jun 17, 2024
1ae5400
Remove processing flag from docs as we're no longer exposing it on th…
fformica Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 2.3.0 (June 17, 2024)
ENHANCEMENTS
* Adds support for redirect endpoints
BUGFIX
* Lifting ordering constraint on regions in record resource

## 2.2.2 (May 21, 2024)
BUGFIX
* Lifting ordering constraint on ns1_notifylist notifications objects
* Documentation fix for `tags`

## 2.2.1 (April 3, 2024)
BUGFIX
* `ns1-go` client version bump to fix omitting tags
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.2
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
github.com/stretchr/testify v1.8.1
gopkg.in/ns1/ns1-go.v2 v2.9.1
gopkg.in/ns1/ns1-go.v2 v2.11.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/ns1/ns1-go.v2 v2.9.1 h1:3/QYzUazRCSE49d3sh1Q+X7IrDp/I7OqR/M7dKA0Oks=
gopkg.in/ns1/ns1-go.v2 v2.9.1/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc=
gopkg.in/ns1/ns1-go.v2 v2.11.0 h1:T+rMHhQsQ58bSgGZwX8INxU0sjDO7cWieX9xPr/UEY4=
gopkg.in/ns1/ns1-go.v2 v2.11.0/go.mod h1:pfaU0vECVP7DIOr453z03HXS6dFJpXdNRwOyRzwmPSc=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
2 changes: 1 addition & 1 deletion ns1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

var (
clientVersion = "2.2.2"
clientVersion = "2.3.0"
providerUserAgent = "tf-ns1" + "/" + clientVersion
defaultRetryMax = 3
)
Expand Down
17 changes: 17 additions & 0 deletions ns1/examples/redirect.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

resource "ns1_redirect_certificate" "example" {
domain = "*.example.com"
}

resource "ns1_redirect" "example" {
certificate_id = "${ns1_redirect_certificate.example.id}"
domain = "www.example.com"
path = "/from/path"
target = "https://url.com/target/path"
forwarding_mode = "all"
forwarding_type = "permanent"
https_enabled = true
https_forced = true
query_forwarding = true
tags = []
}
34 changes: 18 additions & 16 deletions ns1/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,24 @@ func Provider() *schema.Provider {
"ns1_monitoring_regions": dataSourceMonitoringRegions(),
},
ResourcesMap: map[string]*schema.Resource{
"ns1_zone": resourceZone(),
"ns1_record": recordResource(),
"ns1_datasource": dataSourceResource(),
"ns1_datafeed": dataFeedResource(),
"ns1_monitoringjob": monitoringJobResource(),
"ns1_notifylist": notifyListResource(),
"ns1_user": userResource(),
"ns1_apikey": apikeyResource(),
"ns1_team": teamResource(),
"ns1_application": resourceApplication(),
"ns1_pulsarjob": pulsarJobResource(),
"ns1_tsigkey": tsigKeyResource(),
"ns1_subnet": resourceSubnet(),
"ns1_dnsview": dnsView(),
"ns1_account_whitelist": accountWhitelistResource(),
"ns1_dataset": datasetResource(),
"ns1_zone": resourceZone(),
"ns1_record": recordResource(),
"ns1_datasource": dataSourceResource(),
"ns1_datafeed": dataFeedResource(),
"ns1_monitoringjob": monitoringJobResource(),
"ns1_notifylist": notifyListResource(),
"ns1_user": userResource(),
"ns1_apikey": apikeyResource(),
"ns1_team": teamResource(),
"ns1_application": resourceApplication(),
"ns1_pulsarjob": pulsarJobResource(),
"ns1_tsigkey": tsigKeyResource(),
"ns1_subnet": resourceSubnet(),
"ns1_dnsview": dnsView(),
"ns1_account_whitelist": accountWhitelistResource(),
"ns1_dataset": datasetResource(),
"ns1_redirect": redirectConfigResource(),
"ns1_redirect_certificate": redirectCertificateResource(),
},
ConfigureFunc: ns1Configure,
}
Expand Down
10 changes: 5 additions & 5 deletions ns1/resource_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1311,17 +1311,17 @@ resource "ns1_record" "it" {
domain = "test.${ns1_zone.test.zone}"
type = "CNAME"
ttl = 60

answers {
answer = "test1.${ns1_zone.test.zone}"
region = "cal"
}

regions {
name = "cal"
}
}

resource "ns1_zone" "test" {
zone = "terraform-test-%s.io"
}
Expand Down Expand Up @@ -1365,7 +1365,7 @@ resource "ns1_record" "it" {
type = "A"
answers {
answer = "1.2.3.4"

meta = {
up = true
subdivisions = jsonencode({
Expand Down Expand Up @@ -1397,7 +1397,7 @@ resource "ns1_monitoringjob" "test" {
name = "terraform-test-%s"
active = true
regions = [
"ams"
"nrt"
]
job_type = "http"
frequency = 60
Expand Down
Loading
Loading