Skip to content

add subnet usedefault public dns #789

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

Merged
merged 3 commits into from
Dec 19, 2024
Merged

Conversation

Tiboau
Copy link
Contributor

@Tiboau Tiboau commented Dec 18, 2024

Description

Add use_default_public_dns_resolver in subnetv2

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • 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?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

  • Terraform version: terraform version: Terraform vx.y.z
  • Existing HCL configuration you used:
resource "ovh_cloud_project_network_private_subnet_v2" "subnet" {
  network_id        = "aaa-vvv-bbb-ccc"
  name              = "my_private_subnet"
  region            = "BHS5"
  dns_nameservers   = ["1.1.1.1"]
  cidr              = "192.168.168.0/24"
  dhcp              = true
  enable_gateway_ip = true
  use_default_public_dns_resolver = false
}
 # ovh_cloud_project_network_private_subnet_v2.subnet will be created
  + resource "ovh_cloud_project_network_private_subnet_v2" "subnet" {
      + cidr                            = "192.168.168.0/24"
      + dhcp                            = true
      + dns_nameservers                 = [
          + "1.1.1.1",
        ]
      + enable_gateway_ip               = true
      + gateway_ip                      = (known after apply)
      + id                              = (known after apply)
      + name                            = "my_private_subnet"
      + network_id                      = "aaa-vvv-bbb-ccc"
      + region                          = "BHS5"
      + service_name                    = "xxx"
      + use_default_public_dns_resolver = false
    }

@Tiboau Tiboau force-pushed the fix-subnet-usedefault branch 2 times, most recently from 7b23b69 to 5b16a66 Compare December 18, 2024 14:55
return fmt.Sprintf("PCPNSCreateOpts[name: %s, cidr:%s, ipVersion: %d, allocationPools: %+v, dnsNameServers: %s, hostRoutes: %+v, enableDHCP: %t, gatewayIP: %v, enableGatewayIP: %t]",
p.Name, p.Cidr, p.IpVersion, p.AllocationPools, p.DnsNameServers, p.HostRoutes, p.EnableDHCP, p.GatewayIp, p.EnableGatewayIP)
return fmt.Sprintf("PCPNSCreateOpts[name: %s, cidr:%s, ipVersion: %d, allocationPools: %+v, dnsNameServers: %s, hostRoutes: %+v, enableDHCP: %t, gatewayIP: %v, enableGatewayIP: %t, useDefaultPublicDNSResolver: %t]",
p.Name, p.Cidr, p.IpVersion, p.AllocationPools, p.DnsNameServers, p.HostRoutes, p.EnableDHCP, p.GatewayIp, p.EnableGatewayIP, *p.UseDefaultPublicDNSResolver)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will panic if *bool is nil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api can receive nil or boolean

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but it doesn't change the fact that *p.UseDefaultPublicDNSResolver can panic if p.UseDefaultPublicDNSResolver is nil

@Tiboau Tiboau force-pushed the fix-subnet-usedefault branch from 5b16a66 to 296aa08 Compare December 19, 2024 08:57
@amstuta amstuta merged commit d62f00c into ovh:master Dec 19, 2024
pascalinthecloud pushed a commit to pascalinthecloud/terraform-provider-ovh that referenced this pull request Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants