Skip to content

Feature/waf onboard custom rule group - #1620

Open
Manuelvaas wants to merge 13 commits into
mainfrom
feature/waf-onboard-custom-rule-group
Open

Feature/waf onboard custom rule group#1620
Manuelvaas wants to merge 13 commits into
mainfrom
feature/waf-onboard-custom-rule-group

Conversation

@Manuelvaas

@Manuelvaas Manuelvaas commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

relates to STACKITTPR-748

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@Manuelvaas
Manuelvaas requested a review from a team as a code owner July 28, 2026 14:51

@SerseusWasTaken SerseusWasTaken left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

look pretty clean, but found an issue during testing:
Using this config:

resource "stackit_alb_waf_custom_rule_group" "custom_rule_group" {
  project_id = local.project_id
  name       = "some-name"
  rules = [
    {
      behavior = {
        action = "ACTION_DENY"
        log    = true
      }
      conditions = [
        {
          operator = {
            type  = "OPERATOR_VALIDATE_UTF8_ENCODING"
            value = "dummy"
          }
          variable = {
            type = "VARIABLE_RESPONSE_STATUS"
          }
        }
      ]
    }
  ]
}

terraform apply runs successfully, but after changing rules[0].behavior.log to false, i got this error:

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to stackit_alb_waf_custom_rule_group.custom_rule_group, provider "provider[\"registry.terraform.io/stackitcloud/stackit\"]" produced an unexpected new value: .rules[0].behavior.log: was cty.False, but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Comment thread stackit/internal/services/albwaf/custom_rule_group/resource.go
Comment thread stackit/internal/services/albwaf/custom_rule_group/resource.go Outdated
Comment thread stackit/internal/services/albwaf/custom_rule_group/resource.go Outdated
Comment thread stackit/internal/services/albwaf/custom_rule_group/resource.go Outdated
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit 1.17% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/custom_rule_group 32.43% (+32.43%) 🌟
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/managed_rule_set 8.37% (-0.59%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/custom_rule_group/datasource.go 0.00% (ø) 46 (+46) 0 46 (+46)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/custom_rule_group/resource.go 38.40% (+38.40%) 250 (+250) 96 (+96) 154 (+154) 🌟
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/managed_rule_set/datasource.go 0.00% (ø) 46 0 46
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/managed_rule_set/resource.go 10.83% (-0.62%) 157 (-9) 17 (-2) 140 (-7) 👎
github.com/stackitcloud/terraform-provider-stackit/stackit/provider.go 1.17% (ø) 171 2 169

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/albwaf_acc_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/custom_rule_group/resource_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/albwaf/managed_rule_set/resource_test.go

ctx = core.InitProviderContext(ctx)

projectId := model.ProjectId.ValueString()
customRuleGroupName := model.Name.ValueString()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should probably use getRegionWithOverride function like the create function does

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