terraform-provider-ovh icon indicating copy to clipboard operation
terraform-provider-ovh copied to clipboard

feat: implement name server resource for domains

Open PhilippeVienne opened this issue 7 months ago • 1 comments

Sure, here's the completed PR template with the provided diff details:

Description

This pull request implements a new feature: the name server resource for domains. Using the /nameServers/update endpoint, this change allows users to update the Name Servers (NS) of a domain registered at OVHCloud. This resource requires a new testing resource of a Domain where the NS can be changed. The changes have been tested on a separate account with a restricted token to ensure proper functionality.

The following files have been updated:

  • README.md: Added OVH_DOMAIN_TEST environment variable for testing.
  • provider.go: Registered the new ovh_domain_name_servers resource.
  • provider_test.go: Included a check for OVH_DOMAIN_TEST.
  • resource_domain_name_servers.go: Implementation of the new resource.
  • resource_domain_name_servers_test.go: Test cases for the new resource.

Fixes #146 (issue)

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Improvement (improve existing resource(s) or datasource(s))
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation update

How Has This Been Tested?

The changes have been tested on a separate account with a restricted token. The following tests were conducted to verify the new functionality:

  • [x] Test A: make testacc TESTARGS="-run TestAccDomainNameServers_Basic" – This test verifies the basic functionality of updating the Name Servers for a domain.

Test Configuration:

  • Terraform version: terraform version: Terraform v1.8.3
  • Existing HCL configuration you used:
resource "ovh_domain_name_servers" "foobar" {
	  domain = "terraform-test.ovh"
	  server {
	  	  host = "dns104.ovh.net"
	  }
	  server {
	  	  host = "ns104.ovh.net"
	  }
}

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings or issues
  • [x] I have added acceptance tests that prove my fix is effective or that my feature works
  • [x] New and existing acceptance tests pass locally with my changes
  • [x] I ran successfully go mod vendor if I added or modify go.mod file

PhilippeVienne avatar Jun 26 '24 13:06 PhilippeVienne