Skip to content

Commit 6c1533c

Browse files
Principal Access Boundary - Promote Beta to GA (#12354) (#20475)
[upstream:23775a8fb013fd0d195e8f7ae9c5500ca7f7ef60] Signed-off-by: Modular Magician <[email protected]>
1 parent 322ef90 commit 6c1533c

29 files changed

+4278
-23
lines changed

.changelog/12354.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note: note
2+
iam3: promoted resources `google_iam_principal_access_boundary_policy`, `google_iam_organizations_policy_binding`, `google_iam_folders_policy_binding` and `google_iam_projects_policy_binding` to GA
3+
```

google/fwmodels/provider_model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ type ProviderModel struct {
100100
GkeonpremCustomEndpoint types.String `tfsdk:"gkeonprem_custom_endpoint"`
101101
HealthcareCustomEndpoint types.String `tfsdk:"healthcare_custom_endpoint"`
102102
IAM2CustomEndpoint types.String `tfsdk:"iam2_custom_endpoint"`
103+
IAM3CustomEndpoint types.String `tfsdk:"iam3_custom_endpoint"`
103104
IAMBetaCustomEndpoint types.String `tfsdk:"iam_beta_custom_endpoint"`
104105
IAMWorkforcePoolCustomEndpoint types.String `tfsdk:"iam_workforce_pool_custom_endpoint"`
105106
IapCustomEndpoint types.String `tfsdk:"iap_custom_endpoint"`

google/fwprovider/framework_provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
577577
transport_tpg.CustomEndpointValidator(),
578578
},
579579
},
580+
"iam3_custom_endpoint": &schema.StringAttribute{
581+
Optional: true,
582+
Validators: []validator.String{
583+
transport_tpg.CustomEndpointValidator(),
584+
},
585+
},
580586
"iam_beta_custom_endpoint": &schema.StringAttribute{
581587
Optional: true,
582588
Validators: []validator.String{

google/provider/provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,11 @@ func Provider() *schema.Provider {
498498
Optional: true,
499499
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
500500
},
501+
"iam3_custom_endpoint": {
502+
Type: schema.TypeString,
503+
Optional: true,
504+
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
505+
},
501506
"iam_beta_custom_endpoint": {
502507
Type: schema.TypeString,
503508
Optional: true,
@@ -1049,6 +1054,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
10491054
config.GkeonpremBasePath = d.Get("gkeonprem_custom_endpoint").(string)
10501055
config.HealthcareBasePath = d.Get("healthcare_custom_endpoint").(string)
10511056
config.IAM2BasePath = d.Get("iam2_custom_endpoint").(string)
1057+
config.IAM3BasePath = d.Get("iam3_custom_endpoint").(string)
10521058
config.IAMBetaBasePath = d.Get("iam_beta_custom_endpoint").(string)
10531059
config.IAMWorkforcePoolBasePath = d.Get("iam_workforce_pool_custom_endpoint").(string)
10541060
config.IapBasePath = d.Get("iap_custom_endpoint").(string)

google/provider/provider_mmv1_resources.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import (
7373
"github.com/hashicorp/terraform-provider-google/google/services/gkeonprem"
7474
"github.com/hashicorp/terraform-provider-google/google/services/healthcare"
7575
"github.com/hashicorp/terraform-provider-google/google/services/iam2"
76+
"github.com/hashicorp/terraform-provider-google/google/services/iam3"
7677
"github.com/hashicorp/terraform-provider-google/google/services/iambeta"
7778
"github.com/hashicorp/terraform-provider-google/google/services/iamworkforcepool"
7879
"github.com/hashicorp/terraform-provider-google/google/services/iap"
@@ -457,9 +458,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
457458
}
458459

459460
// Resources
460-
// Generated resources: 491
461+
// Generated resources: 495
461462
// Generated IAM resources: 261
462-
// Total generated resources: 752
463+
// Total generated resources: 756
463464
var generatedResources = map[string]*schema.Resource{
464465
"google_folder_access_approval_settings": accessapproval.ResourceAccessApprovalFolderSettings(),
465466
"google_organization_access_approval_settings": accessapproval.ResourceAccessApprovalOrganizationSettings(),
@@ -905,6 +906,10 @@ var generatedResources = map[string]*schema.Resource{
905906
"google_healthcare_workspace": healthcare.ResourceHealthcareWorkspace(),
906907
"google_iam_access_boundary_policy": iam2.ResourceIAM2AccessBoundaryPolicy(),
907908
"google_iam_deny_policy": iam2.ResourceIAM2DenyPolicy(),
909+
"google_iam_folders_policy_binding": iam3.ResourceIAM3FoldersPolicyBinding(),
910+
"google_iam_organizations_policy_binding": iam3.ResourceIAM3OrganizationsPolicyBinding(),
911+
"google_iam_principal_access_boundary_policy": iam3.ResourceIAM3PrincipalAccessBoundaryPolicy(),
912+
"google_iam_projects_policy_binding": iam3.ResourceIAM3ProjectsPolicyBinding(),
908913
"google_iam_workload_identity_pool": iambeta.ResourceIAMBetaWorkloadIdentityPool(),
909914
"google_iam_workload_identity_pool_provider": iambeta.ResourceIAMBetaWorkloadIdentityPoolProvider(),
910915
"google_iam_workforce_pool": iamworkforcepool.ResourceIAMWorkforcePoolWorkforcePool(),
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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 iam3
19+
20+
import (
21+
"encoding/json"
22+
"errors"
23+
"fmt"
24+
"time"
25+
26+
"github.com/hashicorp/terraform-provider-google/google/tpgresource"
27+
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
28+
)
29+
30+
type IAM3OperationWaiter struct {
31+
Config *transport_tpg.Config
32+
UserAgent string
33+
Project string
34+
tpgresource.CommonOperationWaiter
35+
}
36+
37+
func (w *IAM3OperationWaiter) QueryOp() (interface{}, error) {
38+
if w == nil {
39+
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
40+
}
41+
// Returns the proper get.
42+
url := fmt.Sprintf("%s%s", w.Config.IAM3BasePath, w.CommonOperationWaiter.Op.Name)
43+
44+
return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
45+
Config: w.Config,
46+
Method: "GET",
47+
Project: w.Project,
48+
RawURL: url,
49+
UserAgent: w.UserAgent,
50+
})
51+
}
52+
53+
func createIAM3Waiter(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string) (*IAM3OperationWaiter, error) {
54+
w := &IAM3OperationWaiter{
55+
Config: config,
56+
UserAgent: userAgent,
57+
Project: project,
58+
}
59+
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
60+
return nil, err
61+
}
62+
return w, nil
63+
}
64+
65+
// nolint: deadcode,unused
66+
func IAM3OperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
67+
w, err := createIAM3Waiter(config, op, project, activity, userAgent)
68+
if err != nil {
69+
return err
70+
}
71+
if err := tpgresource.OperationWait(w, activity, timeout, config.PollInterval); err != nil {
72+
return err
73+
}
74+
rawResponse := []byte(w.CommonOperationWaiter.Op.Response)
75+
if len(rawResponse) == 0 {
76+
return errors.New("`resource` not set in operation response")
77+
}
78+
return json.Unmarshal(rawResponse, response)
79+
}
80+
81+
func IAM3OperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
82+
if val, ok := op["name"]; !ok || val == "" {
83+
// This was a synchronous call - there is no operation to wait for.
84+
return nil
85+
}
86+
w, err := createIAM3Waiter(config, op, project, activity, userAgent)
87+
if err != nil {
88+
// If w is nil, the op was synchronous.
89+
return err
90+
}
91+
return tpgresource.OperationWait(w, activity, timeout, config.PollInterval)
92+
}

0 commit comments

Comments
 (0)