Skip to content

Commit

Permalink
Add new Healthcheck regions (IBM-Cloud#3827)
Browse files Browse the repository at this point in the history
* Removed Healthcheck regions validator

* Removed Healthcheck regions validator

Co-authored-by: Malar K <malark@Malars-MacBook-Pro.local>
  • Loading branch information
2 people authored and SunithaGudisagarIBM1 committed Sep 14, 2022
1 parent f517473 commit 9cf8983
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
1 change: 0 additions & 1 deletion ibm/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,6 @@ func Validator() validate.ValidatorDict {
"ibm_is_vpn_gateway": vpc.ResourceIBMISVPNGatewayValidator(),
"ibm_kms_key_rings": kms.ResourceIBMKeyRingValidator(),
"ibm_dns_glb_monitor": dnsservices.ResourceIBMPrivateDNSGLBMonitorValidator(),
"ibm_dns_glb_pool": dnsservices.ResourceIBMPrivateDNSGLBPoolValidator(),
"ibm_dns_custom_resolver_forwarding_rule": dnsservices.ResourceIBMPrivateDNSForwardingRuleValidator(),
"ibm_schematics_action": schematics.ResourceIBMSchematicsActionValidator(),
"ibm_schematics_job": schematics.ResourceIBMSchematicsJobValidator(),
Expand Down
23 changes: 3 additions & 20 deletions ibm/service/dnsservices/resource_ibm_private_dns_glb_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate"
"github.com/IBM/go-sdk-core/v5/core"
dns "github.com/IBM/networking-go-sdk/dnssvcsv1"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down Expand Up @@ -146,10 +145,9 @@ func ResourceIBMPrivateDNSGLBPool() *schema.Resource {
Description: "The notification channel,It is a webhook url",
},
pdnsGlbPoolRegion: {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validate.InvokeValidator(ibmDNSGlbPool, pdnsGlbPoolRegion),
Description: "Health check region of VSIs",
Type: schema.TypeString,
Optional: true,
Description: "Health check region of VSIs",
},
pdnsGlbPoolSubnet: {
Type: schema.TypeList,
Expand All @@ -173,21 +171,6 @@ func ResourceIBMPrivateDNSGLBPool() *schema.Resource {
}
}

func ResourceIBMPrivateDNSGLBPoolValidator() *validate.ResourceValidator {
regions := "us-south,us-east,eu-gb,eu-du,au-syd,jp-tok"

validateSchema := make([]validate.ValidateSchema, 0)
validateSchema = append(validateSchema,
validate.ValidateSchema{
Identifier: pdnsGlbPoolRegion,
ValidateFunctionIdentifier: validate.ValidateAllowedStringValue,
Type: validate.TypeString,
Required: true,
AllowedValues: regions})
dnsPoolValidator := validate.ResourceValidator{ResourceName: ibmDNSGlbPool, Schema: validateSchema}
return &dnsPoolValidator
}

func resourceIBMPrivateDNSGLBPoolCreate(d *schema.ResourceData, meta interface{}) error {
sess, err := meta.(conns.ClientSession).PrivateDNSClientSession()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/dns_glb_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Review the argument reference that you can specify for your resource.
- `description` - (Optional, String) Descriptive text of the origin server.
- `enabled`- (Required, Bool) Whether the origin server is enabled.
- `healthy_origins_threshold`- (Required, Integer) The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.
- `healthcheck_region` - (Optional, String) Health check region of VSIs. Allowable values are `us-south`,`us-east`, `eu-gb`, `eu-du`, `au-syd`, `jp-tok`.
- `healthcheck_region` - (Optional, String) Health check region of VSIs. Examples: `us-south`,`us-east`, `eu-gb`, `eu-de`, `au-syd`, `jp-tok`, `jp-osa`, `ca-tor`, `br-sao`.
- `healthcheck_subnets` - (List, Optional) The health check subnet CRN of VSIs.
- `instance_id` - (Required, Forces new resource, String) The GUID of the private DNS on which zone has to be created.
- `monitor` - (Optional, String) The ID of the Load Balancer monitor to be associated to this pool.
Expand Down

0 comments on commit 9cf8983

Please sign in to comment.