Skip to content

Commit 0010423

Browse files
cloudsecuritycompliace: add google_cloud_security_compliance_framework_deployment resource (#15361) (#25138)
[upstream:a467303aaee80a71934927ff8d085de3f8a1c9d9] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 50e2b4e commit 0010423

7 files changed

+2423
-2
lines changed

.changelog/15361.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_cloud_security_compliance_framework_deployment`
3+
```

google/provider/provider_mmv1_resources.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
581581
}
582582

583583
// Resources
584-
// Generated resources: 679
584+
// Generated resources: 680
585585
// Generated IAM resources: 318
586-
// Total generated resources: 997
586+
// Total generated resources: 998
587587
var generatedResources = map[string]*schema.Resource{
588588
"google_folder_access_approval_settings": accessapproval.ResourceAccessApprovalFolderSettings(),
589589
"google_organization_access_approval_settings": accessapproval.ResourceAccessApprovalOrganizationSettings(),
@@ -802,6 +802,7 @@ var generatedResources = map[string]*schema.Resource{
802802
"google_cloud_scheduler_job": cloudscheduler.ResourceCloudSchedulerJob(),
803803
"google_cloud_security_compliance_cloud_control": cloudsecuritycompliance.ResourceCloudSecurityComplianceCloudControl(),
804804
"google_cloud_security_compliance_framework": cloudsecuritycompliance.ResourceCloudSecurityComplianceFramework(),
805+
"google_cloud_security_compliance_framework_deployment": cloudsecuritycompliance.ResourceCloudSecurityComplianceFrameworkDeployment(),
805806
"google_cloud_tasks_queue": cloudtasks.ResourceCloudTasksQueue(),
806807
"google_cloud_tasks_queue_iam_binding": tpgiamresource.ResourceIamBinding(cloudtasks.CloudTasksQueueIamSchema, cloudtasks.CloudTasksQueueIamUpdaterProducer, cloudtasks.CloudTasksQueueIdParseFunc),
807808
"google_cloud_tasks_queue_iam_member": tpgiamresource.ResourceIamMember(cloudtasks.CloudTasksQueueIamSchema, cloudtasks.CloudTasksQueueIamUpdaterProducer, cloudtasks.CloudTasksQueueIdParseFunc),
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
// ----------------------------------------------------------------------------
5+
//
6+
// *** AUTO GENERATED CODE *** Type: MMv1 ***
7+
//
8+
// ----------------------------------------------------------------------------
9+
//
10+
// This file is automatically generated by Magic Modules and manual
11+
// changes will be clobbered when the file is regenerated.
12+
//
13+
// Please read more about how to change this file in
14+
// .github/CONTRIBUTING.md.
15+
//
16+
// ----------------------------------------------------------------------------
17+
18+
package cloudsecuritycompliance
19+
20+
import (
21+
"encoding/json"
22+
"errors"
23+
"fmt"
24+
"log"
25+
"strings"
26+
"time"
27+
28+
"github.com/hashicorp/terraform-provider-google/google/tpgresource"
29+
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
30+
31+
"google.golang.org/api/googleapi"
32+
)
33+
34+
var (
35+
_ = json.Marshal
36+
_ = errors.New
37+
_ = fmt.Sprintf
38+
_ = log.Print
39+
_ = strings.Trim
40+
_ = time.Now
41+
_ = tpgresource.SetLabels
42+
_ = transport_tpg.Config{}
43+
_ = googleapi.Error{}
44+
)
45+
46+
type CloudSecurityComplianceOperationWaiter struct {
47+
Config *transport_tpg.Config
48+
UserAgent string
49+
tpgresource.CommonOperationWaiter
50+
}
51+
52+
func (w *CloudSecurityComplianceOperationWaiter) QueryOp() (interface{}, error) {
53+
if w == nil {
54+
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
55+
}
56+
// Returns the proper get.
57+
url := fmt.Sprintf("%s%s", w.Config.CloudSecurityComplianceBasePath, w.CommonOperationWaiter.Op.Name)
58+
59+
return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
60+
Config: w.Config,
61+
Method: "GET",
62+
RawURL: url,
63+
UserAgent: w.UserAgent,
64+
})
65+
}
66+
67+
func createCloudSecurityComplianceWaiter(config *transport_tpg.Config, op map[string]interface{}, activity, userAgent string) (*CloudSecurityComplianceOperationWaiter, error) {
68+
w := &CloudSecurityComplianceOperationWaiter{
69+
Config: config,
70+
UserAgent: userAgent,
71+
}
72+
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
73+
return nil, err
74+
}
75+
return w, nil
76+
}
77+
78+
// nolint: deadcode,unused
79+
func CloudSecurityComplianceOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
80+
w, err := createCloudSecurityComplianceWaiter(config, op, activity, userAgent)
81+
if err != nil {
82+
return err
83+
}
84+
if err := tpgresource.OperationWait(w, activity, timeout, config.PollInterval); err != nil {
85+
return err
86+
}
87+
rawResponse := []byte(w.CommonOperationWaiter.Op.Response)
88+
if len(rawResponse) == 0 {
89+
return errors.New("`resource` not set in operation response")
90+
}
91+
return json.Unmarshal(rawResponse, response)
92+
}
93+
94+
func CloudSecurityComplianceOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
95+
if val, ok := op["name"]; !ok || val == "" {
96+
// This was a synchronous call - there is no operation to wait for.
97+
return nil
98+
}
99+
w, err := createCloudSecurityComplianceWaiter(config, op, activity, userAgent)
100+
if err != nil {
101+
// If w is nil, the op was synchronous.
102+
return err
103+
}
104+
return tpgresource.OperationWait(w, activity, timeout, config.PollInterval)
105+
}

0 commit comments

Comments
 (0)