Skip to content

Commit 1ac186a

Browse files
Add Resource OrganizationEventThreatDetectionCustomModule (#10769) (#7454)
[upstream:00dddb9762ed27beba42df87aa6f2a6a77b575c7] Signed-off-by: Modular Magician <[email protected]>
1 parent 0d82633 commit 1ac186a

11 files changed

+1693
-754
lines changed

google-beta/fwmodels/provider_model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ type ProviderModel struct {
138138
SecretManagerCustomEndpoint types.String `tfsdk:"secret_manager_custom_endpoint"`
139139
SecureSourceManagerCustomEndpoint types.String `tfsdk:"secure_source_manager_custom_endpoint"`
140140
SecurityCenterCustomEndpoint types.String `tfsdk:"security_center_custom_endpoint"`
141+
SecurityCenterManagementCustomEndpoint types.String `tfsdk:"security_center_management_custom_endpoint"`
141142
SecuritypostureCustomEndpoint types.String `tfsdk:"securityposture_custom_endpoint"`
142143
SecurityScannerCustomEndpoint types.String `tfsdk:"security_scanner_custom_endpoint"`
143144
ServiceDirectoryCustomEndpoint types.String `tfsdk:"service_directory_custom_endpoint"`

google-beta/fwprovider/framework_provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
805805
transport_tpg.CustomEndpointValidator(),
806806
},
807807
},
808+
"security_center_management_custom_endpoint": &schema.StringAttribute{
809+
Optional: true,
810+
Validators: []validator.String{
811+
transport_tpg.CustomEndpointValidator(),
812+
},
813+
},
808814
"securityposture_custom_endpoint": &schema.StringAttribute{
809815
Optional: true,
810816
Validators: []validator.String{

google-beta/fwtransport/framework_config.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ type FrameworkProviderConfig struct {
161161
SecretManagerBasePath string
162162
SecureSourceManagerBasePath string
163163
SecurityCenterBasePath string
164+
SecurityCenterManagementBasePath string
164165
SecuritypostureBasePath string
165166
SecurityScannerBasePath string
166167
ServiceDirectoryBasePath string
@@ -330,6 +331,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
330331
p.SecretManagerBasePath = data.SecretManagerCustomEndpoint.ValueString()
331332
p.SecureSourceManagerBasePath = data.SecureSourceManagerCustomEndpoint.ValueString()
332333
p.SecurityCenterBasePath = data.SecurityCenterCustomEndpoint.ValueString()
334+
p.SecurityCenterManagementBasePath = data.SecurityCenterManagementCustomEndpoint.ValueString()
333335
p.SecuritypostureBasePath = data.SecuritypostureCustomEndpoint.ValueString()
334336
p.SecurityScannerBasePath = data.SecurityScannerCustomEndpoint.ValueString()
335337
p.ServiceDirectoryBasePath = data.ServiceDirectoryCustomEndpoint.ValueString()
@@ -1357,6 +1359,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
13571359
data.SecurityCenterCustomEndpoint = types.StringValue(customEndpoint.(string))
13581360
}
13591361
}
1362+
if data.SecurityCenterManagementCustomEndpoint.IsNull() {
1363+
customEndpoint := transport_tpg.MultiEnvDefault([]string{
1364+
"GOOGLE_SECURITY_CENTER_MANAGEMENT_CUSTOM_ENDPOINT",
1365+
}, transport_tpg.DefaultBasePaths[transport_tpg.SecurityCenterManagementBasePathKey])
1366+
if customEndpoint != nil {
1367+
data.SecurityCenterManagementCustomEndpoint = types.StringValue(customEndpoint.(string))
1368+
}
1369+
}
13601370
if data.SecuritypostureCustomEndpoint.IsNull() {
13611371
customEndpoint := transport_tpg.MultiEnvDefault([]string{
13621372
"GOOGLE_SECURITYPOSTURE_CUSTOM_ENDPOINT",

google-beta/provider/provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,11 @@ func Provider() *schema.Provider {
694694
Optional: true,
695695
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
696696
},
697+
"security_center_management_custom_endpoint": {
698+
Type: schema.TypeString,
699+
Optional: true,
700+
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
701+
},
697702
"securityposture_custom_endpoint": {
698703
Type: schema.TypeString,
699704
Optional: true,
@@ -1097,6 +1102,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
10971102
config.SecretManagerBasePath = d.Get("secret_manager_custom_endpoint").(string)
10981103
config.SecureSourceManagerBasePath = d.Get("secure_source_manager_custom_endpoint").(string)
10991104
config.SecurityCenterBasePath = d.Get("security_center_custom_endpoint").(string)
1105+
config.SecurityCenterManagementBasePath = d.Get("security_center_management_custom_endpoint").(string)
11001106
config.SecuritypostureBasePath = d.Get("securityposture_custom_endpoint").(string)
11011107
config.SecurityScannerBasePath = d.Get("security_scanner_custom_endpoint").(string)
11021108
config.ServiceDirectoryBasePath = d.Get("service_directory_custom_endpoint").(string)

google-beta/provider/provider_mmv1_resources.go

Lines changed: 756 additions & 754 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)