Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote Workforce Pool resources to GA from beta #13299

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changelog/7001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:new-resource
`google_iam_workforce_pool` (ga only)
```
```release-note:new-resource
`google_iam_workforce_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 @@ -219,6 +219,7 @@ type Config struct {
GKEHubBasePath string
HealthcareBasePath string
IAMBetaBasePath string
IAMWorkforcePoolBasePath string
IapBasePath string
IdentityPlatformBasePath string
KMSBasePath string
Expand Down Expand Up @@ -318,6 +319,7 @@ const GameServicesBasePathKey = "GameServices"
const GKEHubBasePathKey = "GKEHub"
const HealthcareBasePathKey = "Healthcare"
const IAMBetaBasePathKey = "IAMBeta"
const IAMWorkforcePoolBasePathKey = "IAMWorkforcePool"
const IapBasePathKey = "Iap"
const IdentityPlatformBasePathKey = "IdentityPlatform"
const KMSBasePathKey = "KMS"
Expand Down Expand Up @@ -411,6 +413,7 @@ var DefaultBasePaths = map[string]string{
GKEHubBasePathKey: "https://gkehub.googleapis.com/v1/",
HealthcareBasePathKey: "https://healthcare.googleapis.com/v1/",
IAMBetaBasePathKey: "https://iam.googleapis.com/v1/",
IAMWorkforcePoolBasePathKey: "https://iam.googleapis.com/v1/",
IapBasePathKey: "https://iap.googleapis.com/v1/",
IdentityPlatformBasePathKey: "https://identitytoolkit.googleapis.com/v2/",
KMSBasePathKey: "https://cloudkms.googleapis.com/v1/",
Expand Down Expand Up @@ -1266,6 +1269,7 @@ func ConfigureBasePaths(c *Config) {
c.GKEHubBasePath = DefaultBasePaths[GKEHubBasePathKey]
c.HealthcareBasePath = DefaultBasePaths[HealthcareBasePathKey]
c.IAMBetaBasePath = DefaultBasePaths[IAMBetaBasePathKey]
c.IAMWorkforcePoolBasePath = DefaultBasePaths[IAMWorkforcePoolBasePathKey]
c.IapBasePath = DefaultBasePaths[IapBasePathKey]
c.IdentityPlatformBasePath = DefaultBasePaths[IdentityPlatformBasePathKey]
c.KMSBasePath = DefaultBasePaths[KMSBasePathKey]
Expand Down
1 change: 1 addition & 0 deletions google/config_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func configureTestBasePaths(c *Config, url string) {
c.GKEHubBasePath = url
c.HealthcareBasePath = url
c.IAMBetaBasePath = url
c.IAMWorkforcePoolBasePath = url
c.IapBasePath = url
c.IdentityPlatformBasePath = url
c.KMSBasePath = url
Expand Down
60 changes: 60 additions & 0 deletions google/iam_workforce_pool_operation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// ----------------------------------------------------------------------------
//
// *** 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 IAMWorkforcePoolOperationWaiter struct {
Config *Config
UserAgent string
CommonOperationWaiter
}

func (w *IAMWorkforcePoolOperationWaiter) 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.IAMWorkforcePoolBasePath, w.CommonOperationWaiter.Op.Name)

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

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

func iAMWorkforcePoolOperationWaitTime(config *Config, op map[string]interface{}, 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 := createIAMWorkforcePoolWaiter(config, op, 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 @@ -533,6 +533,14 @@ func Provider() *schema.Provider {
"GOOGLE_IAM_BETA_CUSTOM_ENDPOINT",
}, DefaultBasePaths[IAMBetaBasePathKey]),
},
"iam_workforce_pool_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_IAM_WORKFORCE_POOL_CUSTOM_ENDPOINT",
}, DefaultBasePaths[IAMWorkforcePoolBasePathKey]),
},
"iap_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -936,9 +944,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 251
// Generated resources: 253
// Generated IAM resources: 156
// Total generated resources: 407
// Total generated resources: 409
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -1201,6 +1209,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_healthcare_consent_store_iam_policy": ResourceIamPolicy(HealthcareConsentStoreIamSchema, HealthcareConsentStoreIamUpdaterProducer, HealthcareConsentStoreIdParseFunc),
"google_iam_workload_identity_pool": resourceIAMBetaWorkloadIdentityPool(),
"google_iam_workload_identity_pool_provider": resourceIAMBetaWorkloadIdentityPoolProvider(),
"google_iam_workforce_pool": resourceIAMWorkforcePoolWorkforcePool(),
"google_iam_workforce_pool_provider": resourceIAMWorkforcePoolWorkforcePoolProvider(),
"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 @@ -1612,6 +1622,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
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.IAMWorkforcePoolBasePath = d.Get("iam_workforce_pool_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