Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/iac/adapters/terraform/azure/database/adapt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func Test_Adapt(t *testing.T) {
terraform: `
resource "azurerm_postgresql_flexible_server" "example" {
name = "example-flexible"
version = "17"

public_network_access_enabled = true
}
Expand Down Expand Up @@ -274,6 +275,7 @@ func Test_Adapt(t *testing.T) {
},
},
},
Version: iacTypes.StringTest("17"),
Config: database.PostgresSQLConfig{
LogConnections: iacTypes.BoolTest(true),
LogCheckpoints: iacTypes.BoolTest(true),
Expand Down
3 changes: 2 additions & 1 deletion pkg/iac/adapters/terraform/azure/database/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ func adaptPostgreSQLFlexibleServer(resource *terraform.Block, module *terraform.
AsBoolValueOrDefault(true, resource),
FirewallRules: firewallRules,
},
Config: config,
Version: resource.GetAttribute("version").AsStringValueOrDefault("", resource),
Config: config,
GeoRedundantBackupEnabled: resource.GetAttribute("geo_redundant_backup_enabled").
AsBoolValueOrDefault(false, resource),

Expand Down
1 change: 1 addition & 0 deletions pkg/iac/providers/azure/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type MySQLServer struct {
type PostgreSQLServer struct {
Metadata iacTypes.Metadata
Server
Version iacTypes.StringValue
Config PostgresSQLConfig
GeoRedundantBackupEnabled iacTypes.BoolValue
ThreatDetectionPolicy ThreatDetectionPolicy
Expand Down
4 changes: 4 additions & 0 deletions pkg/iac/rego/schemas/cloud.json
Original file line number Diff line number Diff line change
Expand Up @@ -5151,6 +5151,10 @@
"threatdetectionpolicy": {
"type": "object",
"$ref": "#/definitions/github.com.aquasecurity.trivy.pkg.iac.providers.azure.database.ThreatDetectionPolicy"
},
"version": {
"type": "object",
"$ref": "#/definitions/github.com.aquasecurity.trivy.pkg.iac.types.StringValue"
}
}
},
Expand Down