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

Remove Disk Analyser Config from GCP Connector #236

Merged
merged 11 commits into from
Jan 6, 2025
2 changes: 2 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:
with:
go-version-file: 'go.mod'
cache: true
- name: Setup terraform
uses: hashicorp/setup-terraform@v3
- run: go generate ./...
- name: git diff
run: |
Expand Down
3 changes: 0 additions & 3 deletions docs/resources/connector_gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ resource "wiz_connector_gcp" "example" {
"excludedProjects" : [],
"includedFolders" : [],
"excludedFolders" : [],
"diskAnalyzerInFlightDisabled" : false,
"auditLogMonitorEnabled" : false
}
)
Expand All @@ -47,7 +46,6 @@ resource "wiz_connector_gcp" "example" {
"excludedProjects" : [],
"includedFolders" : [],
"excludedFolders" : [],
"diskAnalyzerInFlightDisabled" : false,
"auditLogMonitorEnabled" : false
}
)
Expand All @@ -71,7 +69,6 @@ resource "wiz_connector_gcp" "example" {
### Read-Only

- `audit_log_monitor_enabled` (Boolean) Whether audit log monitor is enabled. Note an advanced license is required.
- `disk_analyzer_inflight_disabled` (Boolean) If using Outpost, whether disk analyzer inflight scanning is disabled.
- `events_pub_sub_subscription_id` (String) If using Wiz Cloud Events, the Pub/Sub Subscription ID.
- `events_topic_name` (String) If using Wiz Cloud Events, the Topic Name in format `projects/<project_id>/topics/<topic_id>`.
- `excluded_folders` (List of String) The GCP folders excluded by the connector.
Expand Down
2 changes: 0 additions & 2 deletions examples/resources/wiz_connector_gcp/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ resource "wiz_connector_gcp" "example" {
"excludedProjects" : [],
"includedFolders" : [],
"excludedFolders" : [],
"diskAnalyzerInFlightDisabled" : false,
"auditLogMonitorEnabled" : false
}
)
Expand All @@ -32,7 +31,6 @@ resource "wiz_connector_gcp" "example" {
"excludedProjects" : [],
"includedFolders" : [],
"excludedFolders" : [],
"diskAnalyzerInFlightDisabled" : false,
"auditLogMonitorEnabled" : false
}
)
Expand Down
8 changes: 1 addition & 7 deletions internal/acceptance/resource_connector_gcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ func TestAccResourceWizConnectorGcp_basic(t *testing.T) {
"enabled",
"true",
),
resource.TestCheckResourceAttr(
"wiz_connector_gcp.foo",
"disk_analyzer_inflight_disabled",
"false",
),
resource.TestCheckResourceAttr(
"wiz_connector_gcp.foo",
"extra_config",
"{\"auditLogMonitorEnabled\":false,\"diskAnalyzerInFlightDisabled\":false,\"excludedFolders\":[],\"excludedProjects\":[],\"includedFolders\":[],\"projects\":[]}",
"{\"auditLogMonitorEnabled\":false,\"excludedFolders\":[],\"excludedProjects\":[],\"includedFolders\":[],\"projects\":[]}",
),
),
},
Expand All @@ -74,7 +69,6 @@ func testResourceWizConnectorGcpBasic(rName string) string {
"excludedProjects" : [],
"includedFolders" : [],
"excludedFolders" : [],
"diskAnalyzerInFlightDisabled" : false,
"auditLogMonitorEnabled" : false,
}
)
Expand Down
11 changes: 1 addition & 10 deletions internal/provider/resource_connector_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ func resourceWizConnectorGcp() *schema.Resource {
Description: "Whether audit log monitor is enabled. Note an advanced license is required.",
Computed: true,
},
"disk_analyzer_inflight_disabled": {
Type: schema.TypeBool,
Description: "If using Outpost, whether disk analyzer inflight scanning is disabled.",
Computed: true,
},

"events_topic_name": {
Type: schema.TypeString,
Description: "If using Wiz Cloud Events, the Topic Name in format `projects/<project_id>/topics/<topic_id>`.",
Expand Down Expand Up @@ -210,7 +206,6 @@ func resourceWizConnectorGcpRead(ctx context.Context, d *schema.ResourceData, m
config {
... on ConnectorConfigGCP {
auditLogMonitorEnabled
diskAnalyzerInFlightDisabled
includedFolders
excludedFolders
excludedProjects
Expand Down Expand Up @@ -289,10 +284,6 @@ func resourceWizConnectorGcpRead(ctx context.Context, d *schema.ResourceData, m
if err != nil {
return append(diags, diag.FromErr(err)...)
}
err = d.Set("disk_analyzer_inflight_disabled", connectorConfig.DiskAnalyzerInFlightDisabled)
if err != nil {
return append(diags, diag.FromErr(err)...)
}
err = d.Set("audit_log_monitor_enabled", connectorConfig.AuditLogMonitorEnabled)
if err != nil {
return append(diags, diag.FromErr(err)...)
Expand Down
41 changes: 20 additions & 21 deletions internal/wiz/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,27 +635,26 @@ type OutpostAWSConfig struct {

// ConnectorConfigGCP struct -- updates
type ConnectorConfigGCP struct {
AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
AuthURI string `json:"auth_uri"`
AuditLogMonitorEnabled bool `json:"auditLogMonitorEnabled"`
AuditLogsConfig ConnectorConfigGCPAuditLogs `json:"auditLogsConfig"`
ClientEmail string `json:"client_email"`
ClientID string `json:"client_id"`
ClientX509CertURL string `json:"client_x509_cert_url"`
DelegateUser string `json:"delegateUser"`
DiskAnalyzerInFlightDisabled bool `json:"diskAnalyzerInFlightDisabled"`
ExcludedFolders []string `json:"excludedFolders"`
ExcludedProjects []string `json:"excludedProjects"`
FolderID string `json:"folder_id"`
IncludedFolders []string `json:"includedFolders"`
IsManagedIdentity bool `json:"isManagedIdentity"`
OrganizationID string `json:"organization_id"`
PrivateKey string `json:"private_key"`
PrivateKeyID string `json:"private_key_id"`
ProjectID string `json:"project_id"`
Projects []string `json:"projects"`
TokenURI string `json:"token_uri"`
Type string `json:"type"`
AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
AuthURI string `json:"auth_uri"`
AuditLogMonitorEnabled bool `json:"auditLogMonitorEnabled"`
AuditLogsConfig ConnectorConfigGCPAuditLogs `json:"auditLogsConfig"`
ClientEmail string `json:"client_email"`
ClientID string `json:"client_id"`
ClientX509CertURL string `json:"client_x509_cert_url"`
DelegateUser string `json:"delegateUser"`
ExcludedFolders []string `json:"excludedFolders"`
ExcludedProjects []string `json:"excludedProjects"`
FolderID string `json:"folder_id"`
IncludedFolders []string `json:"includedFolders"`
IsManagedIdentity bool `json:"isManagedIdentity"`
OrganizationID string `json:"organization_id"`
PrivateKey string `json:"private_key"`
PrivateKeyID string `json:"private_key_id"`
ProjectID string `json:"project_id"`
Projects []string `json:"projects"`
TokenURI string `json:"token_uri"`
Type string `json:"type"`
}

// ConnectorConfigGCPAuditLogs struct -- updates
Expand Down
Loading