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

azurerm_mssql_server_microsoft_support_auditing_policy - New resource #18609

Merged
merged 17 commits into from
Oct 31, 2022

Conversation

aristosvo
Copy link
Collaborator

Fixes #18607

@github-actions github-actions bot added documentation service/mssql Microsoft SQL Server labels Oct 3, 2022
@aristosvo aristosvo force-pushed the mssql/ms-support-audit branch from 1f33ede to d466f2a Compare October 3, 2022 10:02
@aristosvo aristosvo force-pushed the mssql/ms-support-audit branch from e715878 to 59212d1 Compare October 3, 2022 13:44
Aris van Ommeren added 2 commits October 3, 2022 19:19
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @aristosvo - 1 small comment

@aristosvo aristosvo changed the title azurerm_mssql_server_extended_auditing_policy - Support for microsoft_support_audit_enabled azurerm_mssql_server_microsoft_support_auditing_policy - New resource Oct 4, 2022
@aristosvo aristosvo requested a review from katbyte October 4, 2022 06:44
@aristosvo
Copy link
Collaborator Author

Comment resolved!

@katbyte
Copy link
Collaborator

katbyte commented Oct 13, 2022

Looks like you missed a couple properties in the tests:
image

Copy link
Collaborator Author

@aristosvo aristosvo left a comment

Choose a reason for hiding this comment

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

Forgotten test cases

Copy link
Collaborator Author

@aristosvo aristosvo left a comment

Choose a reason for hiding this comment

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

Docs updates

@aristosvo
Copy link
Collaborator Author

aristosvo commented Oct 13, 2022

Looks like you missed a couple properties in the tests:

image

@katbyte Thanks, I must've been sleeping!!😴 I'll blame my son for this who keeps me up at night 😅

Copy link
Collaborator Author

@aristosvo aristosvo left a comment

Choose a reason for hiding this comment

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

Docs fix

@aristosvo aristosvo removed the request for review from katbyte October 17, 2022 05:46
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @aristosvo - i think the exist test function needs to account for case:

------- Stdout: -------
=== RUN   TestAccMsSqlServerMicrosoftSupportAuditingPolicy_requiresImport
=== PAUSE TestAccMsSqlServerMicrosoftSupportAuditingPolicy_requiresImport
=== CONT  TestAccMsSqlServerMicrosoftSupportAuditingPolicy_requiresImport
    testcase.go:110: Step 1/2 error: Check failed: Check 1/1 error: running exists func for "azurerm_mssql_server_microsoft_support_auditing_policy.test": ID was missing the `extendedAuditingSettings` element
--- FAIL: TestAccMsSqlServerMicrosoftSupportAuditingPolicy_requiresImport (320.82s)
FAIL

and a typo fixed:

------- Stdout: -------
=== RUN   TestAccMsSqlServerMicrosoftSupportAuditingPolicy_complete
=== PAUSE TestAccMsSqlServerMicrosoftSupportAuditingPolicy_complete
=== CONT  TestAccMsSqlServerMicrosoftSupportAuditingPolicy_complete
    testcase.go:110: Step 1/2 error: Error running pre-apply refresh: exit status 1
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 34, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          34:   storage_account_access_key_is_secondary = false
        
        An argument named "storage_account_access_key_is_secondary" is not expected
        here.
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 35, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          35:   retention_in_days                       = 6
        
        An argument named "retention_in_days" is not expected here.
--- FAIL: TestAccMsSqlServerMicrosoftSupportAuditingPolicy_complete (7.84s)
FAIL

then this should be good!

@katbyte
Copy link
Collaborator

katbyte commented Oct 26, 2022

still getting a test failure 🤔

------- Stdout: -------
=== RUN   TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update
=== PAUSE TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update
=== CONT  TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update
    testcase.go:110: Step 7/8 error: Error running pre-apply refresh: exit status 1
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 42, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          42:   storage_account_access_key_is_secondary = true
        
        An argument named "storage_account_access_key_is_secondary" is not expected
        here.
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 43, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          43:   retention_in_days                       = 3
        
        An argument named "retention_in_days" is not expected here.
    testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 42, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          42:   storage_account_access_key_is_secondary = true
        
        An argument named "storage_account_access_key_is_secondary" is not expected
        here.
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 43, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          43:   retention_in_days                       = 3
        
        An argument named "retention_in_days" is not expected here.
--- FAIL: TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update (533.36s)
FAIL

Aris van Ommeren added 2 commits October 31, 2022 09:44
@aristosvo
Copy link
Collaborator Author

still getting a test failure 🤔

------- Stdout: -------
=== RUN   TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update
=== PAUSE TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update
=== CONT  TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update
    testcase.go:110: Step 7/8 error: Error running pre-apply refresh: exit status 1
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 42, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          42:   storage_account_access_key_is_secondary = true
        
        An argument named "storage_account_access_key_is_secondary" is not expected
        here.
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 43, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          43:   retention_in_days                       = 3
        
        An argument named "retention_in_days" is not expected here.
    testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 42, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          42:   storage_account_access_key_is_secondary = true
        
        An argument named "storage_account_access_key_is_secondary" is not expected
        here.
        
        Error: Unsupported argument
        
          on terraform_plugin_test.tf line 43, in resource "azurerm_mssql_server_microsoft_support_auditing_policy" "test":
          43:   retention_in_days                       = 3
        
        An argument named "retention_in_days" is not expected here.
--- FAIL: TestAccMsSqlServerMicrosoftSupportAuditingPolicy_update (533.36s)
FAIL

Sorry, that's a bit sloppy. Fixed!
Screenshot 2022-10-31 at 11 59 15

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Looks good now! thanks @aristosvo

@katbyte katbyte merged commit d12cec1 into hashicorp:main Oct 31, 2022
katbyte added a commit that referenced this pull request Oct 31, 2022
@github-actions github-actions bot added this to the v3.30.0 milestone Oct 31, 2022
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

This functionality has been released in v3.30.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Dec 5, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation service/mssql Microsoft SQL Server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for enable ms-support auditing
2 participants