Skip to content

Commit

Permalink
Notifcation config (#10817) (#18594)
Browse files Browse the repository at this point in the history
[upstream:eff19adf97250c0d62e8c417e9d7cefb60203f35]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jun 27, 2024
1 parent 8ed3269 commit e5527c4
Show file tree
Hide file tree
Showing 15 changed files with 1,059 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/10817.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_scc_v2_organization_notification_config`
```
5 changes: 5 additions & 0 deletions .teamcity/components/inputs/services_beta.kt
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,11 @@ var ServicesListBeta = mapOf(
"displayName" to "Securitycentermanagement",
"path" to "./google-beta/services/securitycentermanagement"
),
"securitycenterv2" to mapOf(
"name" to "securitycenterv2",
"displayName" to "securitycenterv2",
"path" to "./google-beta/services/securitycenterv2"
),
"securityposture" to mapOf(
"name" to "securityposture",
"displayName" to "Securityposture",
Expand Down
5 changes: 5 additions & 0 deletions .teamcity/components/inputs/services_ga.kt
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ var ServicesListGa = mapOf(
"displayName" to "Securitycentermanagement",
"path" to "./google/services/securitycentermanagement"
),
"securitycenterv2" to mapOf(
"name" to "securitycenterv2",
"displayName" to "securitycenterv2",
"path" to "./google/services/securitycenterv2"
),
"securityposture" to mapOf(
"name" to "securityposture",
"displayName" to "Securityposture",
Expand Down
1 change: 1 addition & 0 deletions google/fwmodels/provider_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ type ProviderModel struct {
SecureSourceManagerCustomEndpoint types.String `tfsdk:"secure_source_manager_custom_endpoint"`
SecurityCenterCustomEndpoint types.String `tfsdk:"security_center_custom_endpoint"`
SecurityCenterManagementCustomEndpoint types.String `tfsdk:"security_center_management_custom_endpoint"`
SecurityCenterV2CustomEndpoint types.String `tfsdk:"security_center_v2_custom_endpoint"`
SecuritypostureCustomEndpoint types.String `tfsdk:"securityposture_custom_endpoint"`
ServiceManagementCustomEndpoint types.String `tfsdk:"service_management_custom_endpoint"`
ServiceNetworkingCustomEndpoint types.String `tfsdk:"service_networking_custom_endpoint"`
Expand Down
6 changes: 6 additions & 0 deletions google/fwprovider/framework_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
transport_tpg.CustomEndpointValidator(),
},
},
"security_center_v2_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
transport_tpg.CustomEndpointValidator(),
},
},
"securityposture_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
Expand Down
10 changes: 10 additions & 0 deletions google/fwtransport/framework_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ type FrameworkProviderConfig struct {
SecureSourceManagerBasePath string
SecurityCenterBasePath string
SecurityCenterManagementBasePath string
SecurityCenterV2BasePath string
SecuritypostureBasePath string
ServiceManagementBasePath string
ServiceNetworkingBasePath string
Expand Down Expand Up @@ -309,6 +310,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
p.SecureSourceManagerBasePath = data.SecureSourceManagerCustomEndpoint.ValueString()
p.SecurityCenterBasePath = data.SecurityCenterCustomEndpoint.ValueString()
p.SecurityCenterManagementBasePath = data.SecurityCenterManagementCustomEndpoint.ValueString()
p.SecurityCenterV2BasePath = data.SecurityCenterV2CustomEndpoint.ValueString()
p.SecuritypostureBasePath = data.SecuritypostureCustomEndpoint.ValueString()
p.ServiceManagementBasePath = data.ServiceManagementCustomEndpoint.ValueString()
p.ServiceNetworkingBasePath = data.ServiceNetworkingCustomEndpoint.ValueString()
Expand Down Expand Up @@ -1261,6 +1263,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
data.SecurityCenterManagementCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.SecurityCenterV2CustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_SECURITY_CENTER_V2_CUSTOM_ENDPOINT",
}, transport_tpg.DefaultBasePaths[transport_tpg.SecurityCenterV2BasePathKey])
if customEndpoint != nil {
data.SecurityCenterV2CustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.SecuritypostureCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_SECURITYPOSTURE_CUSTOM_ENDPOINT",
Expand Down
6 changes: 6 additions & 0 deletions google/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ func Provider() *schema.Provider {
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"security_center_v2_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"securityposture_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -1027,6 +1032,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.SecureSourceManagerBasePath = d.Get("secure_source_manager_custom_endpoint").(string)
config.SecurityCenterBasePath = d.Get("security_center_custom_endpoint").(string)
config.SecurityCenterManagementBasePath = d.Get("security_center_management_custom_endpoint").(string)
config.SecurityCenterV2BasePath = d.Get("security_center_v2_custom_endpoint").(string)
config.SecuritypostureBasePath = d.Get("securityposture_custom_endpoint").(string)
config.ServiceManagementBasePath = d.Get("service_management_custom_endpoint").(string)
config.ServiceNetworkingBasePath = d.Get("service_networking_custom_endpoint").(string)
Expand Down
6 changes: 4 additions & 2 deletions google/provider/provider_mmv1_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import (
"github.com/hashicorp/terraform-provider-google/google/services/securesourcemanager"
"github.com/hashicorp/terraform-provider-google/google/services/securitycenter"
"github.com/hashicorp/terraform-provider-google/google/services/securitycentermanagement"
"github.com/hashicorp/terraform-provider-google/google/services/securitycenterv2"
"github.com/hashicorp/terraform-provider-google/google/services/securityposture"
"github.com/hashicorp/terraform-provider-google/google/services/servicemanagement"
"github.com/hashicorp/terraform-provider-google/google/services/servicenetworking"
Expand Down Expand Up @@ -416,9 +417,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
}

// Resources
// Generated resources: 430
// Generated resources: 431
// Generated IAM resources: 252
// Total generated resources: 682
// Total generated resources: 683
var generatedResources = map[string]*schema.Resource{
"google_folder_access_approval_settings": accessapproval.ResourceAccessApprovalFolderSettings(),
"google_organization_access_approval_settings": accessapproval.ResourceAccessApprovalOrganizationSettings(),
Expand Down Expand Up @@ -1016,6 +1017,7 @@ var generatedResources = map[string]*schema.Resource{
"google_scc_management_organization_event_threat_detection_custom_module": securitycentermanagement.ResourceSecurityCenterManagementOrganizationEventThreatDetectionCustomModule(),
"google_scc_management_organization_security_health_analytics_custom_module": securitycentermanagement.ResourceSecurityCenterManagementOrganizationSecurityHealthAnalyticsCustomModule(),
"google_scc_management_project_security_health_analytics_custom_module": securitycentermanagement.ResourceSecurityCenterManagementProjectSecurityHealthAnalyticsCustomModule(),
"google_scc_v2_organization_notification_config": securitycenterv2.ResourceSecurityCenterV2OrganizationNotificationConfig(),
"google_securityposture_posture": securityposture.ResourceSecurityposturePosture(),
"google_securityposture_posture_deployment": securityposture.ResourceSecurityposturePostureDeployment(),
"google_endpoints_service_iam_binding": tpgiamresource.ResourceIamBinding(servicemanagement.ServiceManagementServiceIamSchema, servicemanagement.ServiceManagementServiceIamUpdaterProducer, servicemanagement.ServiceManagementServiceIdParseFunc),
Expand Down
Loading

0 comments on commit e5527c4

Please sign in to comment.