-
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 for V2 SCC Findings Exports to Big Query Organization Co…
…nfig (#11428) (#2687) [upstream:fc331844a15843473edf0704ba5ed1814759b296] Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
7237d2a
commit 1dec779
Showing
3 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
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
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
99 changes: 99 additions & 0 deletions
99
...esources/services/securitycenterv2/securitycenterv2_organization_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,99 @@ | ||
// ---------------------------------------------------------------------------- | ||
// | ||
// *** 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 SecurityCenterV2OrganizationSccBigQueryExportsAssetType string = "securitycenter.googleapis.com/OrganizationSccBigQueryExports" | ||
|
||
func ResourceConverterSecurityCenterV2OrganizationSccBigQueryExports() cai.ResourceConverter { | ||
return cai.ResourceConverter{ | ||
AssetType: SecurityCenterV2OrganizationSccBigQueryExportsAssetType, | ||
Convert: GetSecurityCenterV2OrganizationSccBigQueryExportsCaiObject, | ||
} | ||
} | ||
|
||
func GetSecurityCenterV2OrganizationSccBigQueryExportsCaiObject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) ([]cai.Asset, error) { | ||
name, err := cai.AssetName(d, config, "//securitycenter.googleapis.com/organizations/{{organization}}/locations/{{location}}/bigQueryExports/{{big_query_export_id}}") | ||
if err != nil { | ||
return []cai.Asset{}, err | ||
} | ||
if obj, err := GetSecurityCenterV2OrganizationSccBigQueryExportsApiObject(d, config); err == nil { | ||
return []cai.Asset{{ | ||
Name: name, | ||
Type: SecurityCenterV2OrganizationSccBigQueryExportsAssetType, | ||
Resource: &cai.AssetResource{ | ||
Version: "v2", | ||
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/securitycenter/v2/rest", | ||
DiscoveryName: "OrganizationSccBigQueryExports", | ||
Data: obj, | ||
}, | ||
}}, nil | ||
} else { | ||
return []cai.Asset{}, err | ||
} | ||
} | ||
|
||
func GetSecurityCenterV2OrganizationSccBigQueryExportsApiObject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]interface{}, error) { | ||
obj := make(map[string]interface{}) | ||
nameProp, err := expandSecurityCenterV2OrganizationSccBigQueryExportsName(d.Get("name"), d, config) | ||
if err != nil { | ||
return nil, err | ||
} else if v, ok := d.GetOkExists("name"); !tpgresource.IsEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) { | ||
obj["name"] = nameProp | ||
} | ||
descriptionProp, err := expandSecurityCenterV2OrganizationSccBigQueryExportsDescription(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 := expandSecurityCenterV2OrganizationSccBigQueryExportsDataset(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 := expandSecurityCenterV2OrganizationSccBigQueryExportsFilter(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 expandSecurityCenterV2OrganizationSccBigQueryExportsName(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { | ||
return v, nil | ||
} | ||
|
||
func expandSecurityCenterV2OrganizationSccBigQueryExportsDescription(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { | ||
return v, nil | ||
} | ||
|
||
func expandSecurityCenterV2OrganizationSccBigQueryExportsDataset(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { | ||
return v, nil | ||
} | ||
|
||
func expandSecurityCenterV2OrganizationSccBigQueryExportsFilter(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { | ||
return v, nil | ||
} |