-
Notifications
You must be signed in to change notification settings - Fork 671
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
Custom resolver parameter for high availablity #3190
Conversation
@@ -81,6 +83,12 @@ func resouceIBMPrivateDNSCustomResolver() *schema.Resource { | |||
Default: true, | |||
Description: "Whether the custom resolver is enabled", | |||
}, | |||
pdnsCRHighAvailability: { | |||
Type: schema.TypeBool, | |||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we set Forcenew to true since this can't be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the Changes
var customResolverID, crn string | ||
|
||
g := strings.SplitN(d.Id(), ":", -1) | ||
if len(g) > 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this logic added to check len(g) ....i think ID is only combination of two only .
In which scenarios its convertTfToCisThreeVar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for location its combination of 3 and in resolver it will be combination only 2
|
||
if _, ok := d.GetOkExists(pdnsCustomReolverEnabled); ok { | ||
optCr := sess.NewUpdateCustomResolverOptions(instanceID, resolverID) | ||
optCr.SetEnabled(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we seeting always to "false" .What if cr_enabled is set to true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While adding Custom Resolver Location to the Custom resolver we Get an error message
Error: Error creating the custom resolver location Not allowed to create enabled location while custom resolver is enabled.:{
Hence i am disabling the Custom resolver Every
time before Adding the Location
return diag.FromErr(fmt.Errorf("Error Disable and Update the custom resolver %s:%s", errEnabled, resp)) | ||
} | ||
} else { | ||
// Disable the Cutsom Resolver Location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this else block because immediatley next we are disbaling the resolver location right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Custom resolver in Disabled and there were two Locations, 1st we can delete but the last healthy location we cannot delete so i am disabling the location
@@ -53,6 +71,8 @@ Review the argument reference that you can specify for your resource. | |||
* `resolver_id` - (Required, String) The unique identifier of a custom resolver. | |||
* `subnet_crn` - (Required, String) The subnet CRN of the VPC. | |||
* `enabled` - (Optional, Bool) The custom resolver location will enable. | |||
* `cr_enabled` - (Optional, Bool) The custom resolver will enable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give default values for bool variables if defined in schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
|
||
data "ibm_resource_group" "rg" { | ||
is_default=true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format all examples in doc section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
Community Note
Relates OR Closes #0000
Output from acceptance testing: