-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example for Microsoft.Sql_servers_auditingSettings@2022-05-01-pre…
…view (#759)
- Loading branch information
1 parent
8f1734b
commit c27391a
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
examples/Microsoft.Sql_servers_auditingSettings@2022-05-01-preview/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
terraform { | ||
required_providers { | ||
azapi = { | ||
source = "Azure/azapi" | ||
} | ||
} | ||
} | ||
|
||
provider "azapi" { | ||
skip_provider_registration = false | ||
} | ||
|
||
variable "resource_name" { | ||
type = string | ||
default = "acctest0001" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
default = "eastus" | ||
} | ||
|
||
resource "azapi_resource" "resourceGroup" { | ||
type = "Microsoft.Resources/resourceGroups@2020-06-01" | ||
name = var.resource_name | ||
location = var.location | ||
} | ||
|
||
resource "azapi_resource" "server" { | ||
type = "Microsoft.Sql/servers@2022-05-01-preview" | ||
parent_id = azapi_resource.resourceGroup.id | ||
name = var.resource_name | ||
location = var.location | ||
body = { | ||
properties = { | ||
administratorLogin = "mradministrator" | ||
administratorLoginPassword = "thisIsDog11" | ||
minimalTlsVersion = "1.2" | ||
publicNetworkAccess = "Enabled" | ||
restrictOutboundNetworkAccess = "Disabled" | ||
version = "12.0" | ||
} | ||
} | ||
schema_validation_enabled = false | ||
response_export_values = ["*"] | ||
} | ||
|
||
resource "azapi_update_resource" "auditingSettings" { | ||
type = "Microsoft.Sql/servers/auditingSettings@2022-05-01-preview" | ||
name = "default" | ||
parent_id = azapi_resource.server.id | ||
body = { | ||
properties = { | ||
auditActionsAndGroups = [ | ||
"FAILED_DATABASE_AUTHENTICATION_GROUP", | ||
"SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP" | ||
] | ||
isAzureMonitorTargetEnabled = true | ||
state = "Enabled" | ||
} | ||
} | ||
} |