Skip to content

Commit

Permalink
iam workload identity pool - promote to ga (#6241) (#12065)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jul 8, 2022
1 parent e5f609d commit 145a696
Show file tree
Hide file tree
Showing 12 changed files with 1,969 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .changelog/6241.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:new-resource
`google_iam_workload_identity_pool` (ga only)
```
```release-note:new-resource
`google_iam_workload_identity_pool_provider ` (ga only)
```
4 changes: 4 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ type Config struct {
GameServicesBasePath string
GKEHubBasePath string
HealthcareBasePath string
IAMBetaBasePath string
IapBasePath string
IdentityPlatformBasePath string
KMSBasePath string
Expand Down Expand Up @@ -294,6 +295,7 @@ const FirestoreBasePathKey = "Firestore"
const GameServicesBasePathKey = "GameServices"
const GKEHubBasePathKey = "GKEHub"
const HealthcareBasePathKey = "Healthcare"
const IAMBetaBasePathKey = "IAMBeta"
const IapBasePathKey = "Iap"
const IdentityPlatformBasePathKey = "IdentityPlatform"
const KMSBasePathKey = "KMS"
Expand Down Expand Up @@ -380,6 +382,7 @@ var DefaultBasePaths = map[string]string{
GameServicesBasePathKey: "https://gameservices.googleapis.com/v1/",
GKEHubBasePathKey: "https://gkehub.googleapis.com/v1/",
HealthcareBasePathKey: "https://healthcare.googleapis.com/v1/",
IAMBetaBasePathKey: "https://iam.googleapis.com/v/",
IapBasePathKey: "https://iap.googleapis.com/v1/",
IdentityPlatformBasePathKey: "https://identitytoolkit.googleapis.com/v2/",
KMSBasePathKey: "https://cloudkms.googleapis.com/v1/",
Expand Down Expand Up @@ -1228,6 +1231,7 @@ func ConfigureBasePaths(c *Config) {
c.GameServicesBasePath = DefaultBasePaths[GameServicesBasePathKey]
c.GKEHubBasePath = DefaultBasePaths[GKEHubBasePathKey]
c.HealthcareBasePath = DefaultBasePaths[HealthcareBasePathKey]
c.IAMBetaBasePath = DefaultBasePaths[IAMBetaBasePathKey]
c.IapBasePath = DefaultBasePaths[IapBasePathKey]
c.IdentityPlatformBasePath = DefaultBasePaths[IdentityPlatformBasePathKey]
c.KMSBasePath = DefaultBasePaths[KMSBasePathKey]
Expand Down
61 changes: 61 additions & 0 deletions google/iam_beta_operation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// ----------------------------------------------------------------------------
//
// *** 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 google

import (
"fmt"
"time"
)

type IAMBetaOperationWaiter struct {
Config *Config
UserAgent string
Project string
CommonOperationWaiter
}

func (w *IAMBetaOperationWaiter) QueryOp() (interface{}, error) {
if w == nil {
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
}
// Returns the proper get.
url := fmt.Sprintf("%s%s", w.Config.IAMBetaBasePath, w.CommonOperationWaiter.Op.Name)

return sendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
}

func createIAMBetaWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*IAMBetaOperationWaiter, error) {
w := &IAMBetaOperationWaiter{
Config: config,
UserAgent: userAgent,
Project: project,
}
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
return nil, err
}
return w, nil
}

func iAMBetaOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil
}
w, err := createIAMBetaWaiter(config, op, project, activity, userAgent)
if err != nil {
// If w is nil, the op was synchronous.
return err
}
return OperationWait(w, activity, timeout, config.PollInterval)
}
15 changes: 13 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,14 @@ func Provider() *schema.Provider {
"GOOGLE_HEALTHCARE_CUSTOM_ENDPOINT",
}, DefaultBasePaths[HealthcareBasePathKey]),
},
"iam_beta_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_IAM_BETA_CUSTOM_ENDPOINT",
}, DefaultBasePaths[IAMBetaBasePathKey]),
},
"iap_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -863,9 +871,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 224
// Generated resources: 226
// Generated IAM resources: 129
// Total generated resources: 353
// Total generated resources: 355
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -1097,6 +1105,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_healthcare_consent_store_iam_binding": ResourceIamBinding(HealthcareConsentStoreIamSchema, HealthcareConsentStoreIamUpdaterProducer, HealthcareConsentStoreIdParseFunc),
"google_healthcare_consent_store_iam_member": ResourceIamMember(HealthcareConsentStoreIamSchema, HealthcareConsentStoreIamUpdaterProducer, HealthcareConsentStoreIdParseFunc),
"google_healthcare_consent_store_iam_policy": ResourceIamPolicy(HealthcareConsentStoreIamSchema, HealthcareConsentStoreIamUpdaterProducer, HealthcareConsentStoreIdParseFunc),
"google_iam_workload_identity_pool": resourceIAMBetaWorkloadIdentityPool(),
"google_iam_workload_identity_pool_provider": resourceIAMBetaWorkloadIdentityPoolProvider(),
"google_iap_web_iam_binding": ResourceIamBinding(IapWebIamSchema, IapWebIamUpdaterProducer, IapWebIdParseFunc),
"google_iap_web_iam_member": ResourceIamMember(IapWebIamSchema, IapWebIamUpdaterProducer, IapWebIdParseFunc),
"google_iap_web_iam_policy": ResourceIamPolicy(IapWebIamSchema, IapWebIamUpdaterProducer, IapWebIdParseFunc),
Expand Down Expand Up @@ -1515,6 +1525,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.GameServicesBasePath = d.Get("game_services_custom_endpoint").(string)
config.GKEHubBasePath = d.Get("gke_hub_custom_endpoint").(string)
config.HealthcareBasePath = d.Get("healthcare_custom_endpoint").(string)
config.IAMBetaBasePath = d.Get("iam_beta_custom_endpoint").(string)
config.IapBasePath = d.Get("iap_custom_endpoint").(string)
config.IdentityPlatformBasePath = d.Get("identity_platform_custom_endpoint").(string)
config.KMSBasePath = d.Get("kms_custom_endpoint").(string)
Expand Down
Loading

0 comments on commit 145a696

Please sign in to comment.