Skip to content
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

ibm_cis_healthcheck | TCP Monitor bugs with default values #5925

Open
MaAd12345 opened this issue Jan 17, 2025 · 0 comments
Open

ibm_cis_healthcheck | TCP Monitor bugs with default values #5925

MaAd12345 opened this issue Jan 17, 2025 · 0 comments
Labels
service/Internet Services Issues related to Cloud Internet Service (CIS)

Comments

@MaAd12345
Copy link

Description

When creating a TCP health check monitor (type = "tcp"), the provider causes constant drift for two settings that are not applicable to TCP monitors but have default values in the provider:

  1. path defaults to "/" but is not applicable for TCP checks
  2. method defaults to "GET" but TCP checks use "connection_established" internally
  ~ resource "ibm_cis_healthcheck" "healthcheck" {
        id               = "<redacted>"
      ~ method           = "connection_established" -> "GET"
      + path             = "/"

This results in every terraform plan showing changes that can never be applied successfully. Unfortunately, this makes a lot of “noise” if you want to apply a real changes.

Technical Details

I guess the issue has two root causes:

  1. The schema defines defaults that only make sense for HTTP(S) monitors but not for TCP:
cisGLBHealthCheckPath: {
    Type:         schema.TypeString,
    Description:  "path",
    Optional:     true,
    Default:      "/",  // This default causes drift for TCP
    ValidateFunc: validate.ValidateURLPath,
},
cisGLBHealthCheckMethod: {
    Type:         schema.TypeString,
    Description:  "method",
    Optional:     true,
    Default:      "GET",  // This default causes drift for TCP
    ValidateFunc: validate.InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckMethod),
},

Expected Behavior

For TCP monitors:

  • path should not have a default value when type = "tcp"
  • method should either accept "connection_established" or be completely optional for TCP monitors

The schema should be conditional based on the monitor type to avoid setting HTTP(S)-specific defaults for TCP monitors.

@github-actions github-actions bot added the service/Internet Services Issues related to Cloud Internet Service (CIS) label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Internet Services Issues related to Cloud Internet Service (CIS)
Projects
None yet
Development

No branches or pull requests

1 participant