-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Resource V2 SCC Findings Export to Big Query Folder Config (#1151…
…7) (#2736) [upstream:68282ea6e38b34150888bdff9bae1a27c73bb7f9] Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
f148618
commit d419980
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
...ogle/resources/services/securitycenterv2/securitycenterv2_folder_scc_big_query_exports.go
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,89 @@ | ||
// ---------------------------------------------------------------------------- | ||
// | ||
// *** AUTO GENERATED CODE *** Type: MMv1 *** | ||
// | ||
// ---------------------------------------------------------------------------- | ||
// | ||
// This file is automatically generated by Magic Modules and manual | ||
// changes will be clobbered when the file is regenerated. | ||
// | ||
// Please read more about how to change this file in | ||
// .github/CONTRIBUTING.md. | ||
// | ||
// ---------------------------------------------------------------------------- | ||
|
||
package securitycenterv2 | ||
|
||
import ( | ||
"reflect" | ||
|
||
"github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/cai" | ||
"github.com/hashicorp/terraform-provider-google-beta/google-beta/tpgresource" | ||
transport_tpg "github.com/hashicorp/terraform-provider-google-beta/google-beta/transport" | ||
) | ||
|
||
const SecurityCenterV2FolderSccBigQueryExportsAssetType string = "securitycenter.googleapis.com/FolderSccBigQueryExports" | ||
|
||
func ResourceConverterSecurityCenterV2FolderSccBigQueryExports() cai.ResourceConverter { | ||
return cai.ResourceConverter{ | ||
AssetType: SecurityCenterV2FolderSccBigQueryExportsAssetType, | ||
Convert: GetSecurityCenterV2FolderSccBigQueryExportsCaiObject, | ||
} | ||
} | ||
|
||
func GetSecurityCenterV2FolderSccBigQueryExportsCaiObject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) ([]cai.Asset, error) { | ||
name, err := cai.AssetName(d, config, "//securitycenter.googleapis.com/folders/{{folder}}/locations/{{location}}/bigQueryExports/{{big_query_export_id}}") | ||
if err != nil { | ||
return []cai.Asset{}, err | ||
} | ||
if obj, err := GetSecurityCenterV2FolderSccBigQueryExportsApiObject(d, config); err == nil { | ||
return []cai.Asset{{ | ||
Name: name, | ||
Type: SecurityCenterV2FolderSccBigQueryExportsAssetType, | ||
Resource: &cai.AssetResource{ | ||
Version: "v2", | ||
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/securitycenter/v2/rest", | ||
DiscoveryName: "FolderSccBigQueryExports", | ||
Data: obj, | ||
}, | ||
}}, nil | ||
} else { | ||
return []cai.Asset{}, err | ||
} | ||
} | ||
|
||
func GetSecurityCenterV2FolderSccBigQueryExportsApiObject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]interface{}, error) { | ||
obj := make(map[string]interface{}) | ||
descriptionProp, err := expandSecurityCenterV2FolderSccBigQueryExportsDescription(d.Get("description"), d, config) | ||
if err != nil { | ||
return nil, err | ||
} else if v, ok := d.GetOkExists("description"); !tpgresource.IsEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { | ||
obj["description"] = descriptionProp | ||
} | ||
datasetProp, err := expandSecurityCenterV2FolderSccBigQueryExportsDataset(d.Get("dataset"), d, config) | ||
if err != nil { | ||
return nil, err | ||
} else if v, ok := d.GetOkExists("dataset"); !tpgresource.IsEmptyValue(reflect.ValueOf(datasetProp)) && (ok || !reflect.DeepEqual(v, datasetProp)) { | ||
obj["dataset"] = datasetProp | ||
} | ||
filterProp, err := expandSecurityCenterV2FolderSccBigQueryExportsFilter(d.Get("filter"), d, config) | ||
if err != nil { | ||
return nil, err | ||
} else if v, ok := d.GetOkExists("filter"); !tpgresource.IsEmptyValue(reflect.ValueOf(filterProp)) && (ok || !reflect.DeepEqual(v, filterProp)) { | ||
obj["filter"] = filterProp | ||
} | ||
|
||
return obj, nil | ||
} | ||
|
||
func expandSecurityCenterV2FolderSccBigQueryExportsDescription(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { | ||
return v, nil | ||
} | ||
|
||
func expandSecurityCenterV2FolderSccBigQueryExportsDataset(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { | ||
return v, nil | ||
} | ||
|
||
func expandSecurityCenterV2FolderSccBigQueryExportsFilter(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { | ||
return v, nil | ||
} |