-
Notifications
You must be signed in to change notification settings - Fork 108
synthetics icmp and browser monitors support #772
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
synthetics icmp and browser monitors support #772
Conversation
Error was from
|
internal/kibana/synthetics/schema.go
Outdated
stringvalidator.OneOf("on", "off", "only-on-failure"), | ||
}, | ||
Computed: true, | ||
Default: stringdefault.StaticString("on"), |
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.
From the docs:
If the attribute is computed and the value could be altered by other changes then a default should be avoided and a plan modifier should be used instead.
The same goes for the other Default
values in the schema.
I'm not sure if these need to be computed, but if they do we likely want something like:
PlanModifiers: []{stringplanmodifiers.UseStateForUnknown(), defaultModifier("on")}
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.
Thanks a lot, let me check. The issue I had - plan was different after creation, because API returns default value for this attribute, but I didn't set it.
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.
I"m sorry, it doesn't work. TF complains
Schema Using
Attribute Default For Non-Computed Attribute: Attribute "browser.screenshots"
must be computed when using default.
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.
Ok, I'll leave only computed then, as a sign that API defines values, if not set.
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.
FYI: according to hashicorp/terraform-plugin-framework#285 there is no default for plan modifier and UseStateForUnknown
should be enough. At least, I wasn't able to find default modifier in plugin framework. Please, let me know if I need to add it and how.
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.
@tobio , should be done, could you re-check?
Co-authored-by: Toby Brain <[email protected]>
FYI: auto-merge is on. |
implelents #610