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

feat(cfw): add resource CFW alarm configuration #6246

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

profoundwu
Copy link
Contributor

@profoundwu profoundwu commented Jan 22, 2025

What this PR does / why we need it:
add resource CFW alarm
Which issue this PR fixes:
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)
fixes #xxx

Special notes for your reviewer:

Release note:

1. add resource CFW alarm

PR Checklist

  • Tests added/passed.
make testacc TEST="./huaweicloud/services/acceptance/cfw" TESTARGS="-run TestAccResourceAlarmConfig_basi c"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/cfw -v -run TestAccResourceAlarmConfig_basic -timeout 360m -parallel 4
=== RUN   TestAccResourceAlarmConfig_basic
=== PAUSE TestAccResourceAlarmConfig_basic
=== CONT  TestAccResourceAlarmConfig_basic
--- PASS: TestAccResourceAlarmConfig_basic (62.60s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/cfw       62.660s
  • Documentation updated.

  • Schema updated.

  • CheckDeleted.

    • a. During query operation (Read Context)
      aa. Resource not found
      image

      ab. Related resources (parent resources) not found
      image

    • b. During delete/disassociate/unbind operation (Delete Context)
      ba. Resource not found
      image

    bb. Related resources (parent resources) not found
    image

@profoundwu profoundwu force-pushed the feat_cfw_alarm branch 5 times, most recently from 58dd36b to f6d904b Compare January 22, 2025 06:39
@profoundwu profoundwu force-pushed the feat_cfw_alarm branch 2 times, most recently from 854c589 to 2068665 Compare January 22, 2025 10:57
@houpeng80
Copy link
Collaborator

/lgtm

@github-ci-robot github-ci-robot added the LGTM /lgtm label Jan 23, 2025
Manages a CFW alarm resource within HuaweiCloud.
---

# huaweicloud_cfw_alarm
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# huaweicloud_cfw_alarm
# huaweicloud_cfw_alarm_config

Comment on lines 226 to 229
_, err = GetAlarm(deleteAlarmClient, fwInstanceID, alarmType)
if err != nil {
return common.CheckDeletedDiag(d, err, "error retrieving CFW alarm")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

when delete the resource, terraform will call Read func first, so we don't need to check it here

Suggested change
_, err = GetAlarm(deleteAlarmClient, fwInstanceID, alarmType)
if err != nil {
return common.CheckDeletedDiag(d, err, "error retrieving CFW alarm")
}

Comment on lines 67 to 68
+ If `alarm_type` is **1**, the value of `severity` can be **0**, **1**, or **2**.
+ If `alarm_type` is **2**, the value of `severity` must be **3**.
Copy link
Collaborator

Choose a reason for hiding this comment

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

waht 0, 1, 2, 3 indicate?

Type: schema.TypeString,
Required: true,
Description: `Specifies the alarm URN.`,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing parameter

"enable_force_new": {
				Type:         schema.TypeString,
				Optional:     true,
				ValidateFunc: validation.StringInSlice([]string{"true", "false"}, false),
				Description:  utils.SchemaDesc("", utils.SchemaDescInput{Internal: true}),
			},

@github-ci-robot github-ci-robot removed the LGTM /lgtm label Jan 23, 2025
@profoundwu profoundwu changed the title feat(cfw): add resource CFW alarm feat(cfw): add resource CFW alarm configuration Jan 23, 2025
@Jason-Zhang9309
Copy link
Collaborator

/approve

@github-ci-robot github-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2025
@Jason-Zhang9309
Copy link
Collaborator

/lgtm

Copy link
Collaborator

@github-ci-robot github-ci-robot left a comment

Choose a reason for hiding this comment

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

This PR has been approved by: @Jason-Zhang9309

/approve

@github-ci-robot github-ci-robot added the LGTM /lgtm label Jan 23, 2025
@github-ci-robot github-ci-robot merged commit 1782939 into huaweicloud:master Jan 23, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. feature LGTM /lgtm size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants