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

New resource/data source: azurerm_sentinel_alert_rule_ms_security_incident #6606

Merged

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Apr 24, 2020

This PR implement one of the alert rule resource required in #6448.

Test Result

💤 😡 2 via 🦉 v1.14.2 make testacc TEST=./azurerm/internal/services/sentinel/tests TESTARGS="-run='TestAccAzureRMSentinelAlertRuleMsSecurityIncident_'"
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
TF_ACC=1 go test ./azurerm/internal/services/sentinel/tests -v -run='TestAccAzureRMSentinelAlertRuleMsSecurityIncident_' -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureRMSentinelAlertRuleMsSecurityIncident_basic
=== PAUSE TestAccAzureRMSentinelAlertRuleMsSecurityIncident_basic
=== RUN   TestAccAzureRMSentinelAlertRuleMsSecurityIncident_complete
=== PAUSE TestAccAzureRMSentinelAlertRuleMsSecurityIncident_complete
=== RUN   TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update
=== PAUSE TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update
=== RUN   TestAccAzureRMSentinelAlertRuleMsSecurityIncident_requiresImport
=== PAUSE TestAccAzureRMSentinelAlertRuleMsSecurityIncident_requiresImport
=== CONT  TestAccAzureRMSentinelAlertRuleMsSecurityIncident_basic
=== CONT  TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update
=== CONT  TestAccAzureRMSentinelAlertRuleMsSecurityIncident_requiresImport
=== CONT  TestAccAzureRMSentinelAlertRuleMsSecurityIncident_complete
--- PASS: TestAccAzureRMSentinelAlertRuleMsSecurityIncident_complete (151.06s)
--- PASS: TestAccAzureRMSentinelAlertRuleMsSecurityIncident_basic (214.84s)
--- PASS: TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update (355.88s)
--- PASS: TestAccAzureRMSentinelAlertRuleMsSecurityIncident_requiresImport (366.84s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/tests      366.876s

💤 😡 2 via 🦉 v1.14.2 make testacc TEST=./azurerm/internal/services/sentinel/tests TESTARGS="-run='TestAccDataSourceSentinelAlertRuleMsSecurityIncident_'"
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
TF_ACC=1 go test ./azurerm/internal/services/sentinel/tests -v -run='TestAccDataSourceSentinelAlertRuleMsSecurityIncident_' -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccDataSourceSentinelAlertRuleMsSecurityIncident_basic
=== PAUSE TestAccDataSourceSentinelAlertRuleMsSecurityIncident_basic
=== CONT  TestAccDataSourceSentinelAlertRuleMsSecurityIncident_basic
--- PASS: TestAccDataSourceSentinelAlertRuleMsSecurityIncident_basic (175.45s)
PASS

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @magodo, this looks pretty good! Just a couple minor things and I think we can get it in

"text_whitelist": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Copy link
Member

Choose a reason for hiding this comment

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

Can we add additional validation here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will add a StringIsNotEmpty as validation.


~> **NOTE** At least one of the severity filters need to be set.

---

This comment was marked as resolved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file is generated via make scaffold-website. This span line seems used to split required attributes and optional attributes. Do you mind check if this is really redundant? If so, then I think I can submit another PR to remove this span line from the tooling.

Copy link
Member

Choose a reason for hiding this comment

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

Ahhh, I see. We add the span line when defining what attributes go into blocks so I believe it should be removed here.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, after chatting internally, it seems like this is the way we're moving going forward. Apologies for calling it out!

@magodo
Copy link
Collaborator Author

magodo commented Apr 27, 2020

@mbfrahry Thank you for your comment! I have updated code accordingly, except for the change in document file, wanna get your confirmation.

Test Result

💤 via 🦉 v1.14.2 make testacc TEST=./azurerm/internal/services/sentinel/tests TESTARGS="-run='TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update'"
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
TF_ACC=1 go test ./azurerm/internal/services/sentinel/tests -v -run='TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update' -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update
=== PAUSE TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update
=== CONT  TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update
--- PASS: TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update (307.07s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/tests      307.082s

@magodo magodo requested a review from mbfrahry April 27, 2020 01:41
@magodo magodo force-pushed the sentinel_alert_rule_ms_security_incident branch from 23361c6 to 70ba52e Compare April 27, 2020 04:09
@magodo
Copy link
Collaborator Author

magodo commented Apr 27, 2020

I re-base my commits onto master branch to make the CI pass.

@mbfrahry mbfrahry changed the title New resource/data source: azurerm_sentinel_alert_rule_ms_security_incident New resource/data source: azurerm_sentinel_alert_rule_ms_security_incident Apr 27, 2020
@mbfrahry mbfrahry added this to the v2.8.0 milestone Apr 27, 2020
@mbfrahry mbfrahry merged commit 232b14e into hashicorp:master Apr 27, 2020
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM!

@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.8.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.8.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented May 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants