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

alloydb bump to ga #13639

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
3 changes: 3 additions & 0 deletions .changelog/6991.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
google_alloydb_cluster (GA only)
```
62 changes: 62 additions & 0 deletions google/alloydb_operation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// ----------------------------------------------------------------------------
//
// *** 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 AlloydbOperationWaiter struct {
Config *Config
UserAgent string
Project string
CommonOperationWaiter
}

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

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

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

func alloydbOperationWaitTime(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 := createAlloydbWaiter(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)
}
4 changes: 4 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ type Config struct {
AccessApprovalBasePath string
AccessContextManagerBasePath string
ActiveDirectoryBasePath string
AlloydbBasePath string
ApigeeBasePath string
AppEngineBasePath string
ArtifactRegistryBasePath string
Expand Down Expand Up @@ -278,6 +279,7 @@ type Config struct {
const AccessApprovalBasePathKey = "AccessApproval"
const AccessContextManagerBasePathKey = "AccessContextManager"
const ActiveDirectoryBasePathKey = "ActiveDirectory"
const AlloydbBasePathKey = "Alloydb"
const ApigeeBasePathKey = "Apigee"
const AppEngineBasePathKey = "AppEngine"
const ArtifactRegistryBasePathKey = "ArtifactRegistry"
Expand Down Expand Up @@ -376,6 +378,7 @@ var DefaultBasePaths = map[string]string{
AccessApprovalBasePathKey: "https://accessapproval.googleapis.com/v1/",
AccessContextManagerBasePathKey: "https://accesscontextmanager.googleapis.com/v1/",
ActiveDirectoryBasePathKey: "https://managedidentities.googleapis.com/v1/",
AlloydbBasePathKey: "https://alloydb.googleapis.com/v1/",
ApigeeBasePathKey: "https://apigee.googleapis.com/v1/",
AppEngineBasePathKey: "https://appengine.googleapis.com/v1/",
ArtifactRegistryBasePathKey: "https://artifactregistry.googleapis.com/v1/",
Expand Down Expand Up @@ -1236,6 +1239,7 @@ func ConfigureBasePaths(c *Config) {
c.AccessApprovalBasePath = DefaultBasePaths[AccessApprovalBasePathKey]
c.AccessContextManagerBasePath = DefaultBasePaths[AccessContextManagerBasePathKey]
c.ActiveDirectoryBasePath = DefaultBasePaths[ActiveDirectoryBasePathKey]
c.AlloydbBasePath = DefaultBasePaths[AlloydbBasePathKey]
c.ApigeeBasePath = DefaultBasePaths[ApigeeBasePathKey]
c.AppEngineBasePath = DefaultBasePaths[AppEngineBasePathKey]
c.ArtifactRegistryBasePath = DefaultBasePaths[ArtifactRegistryBasePathKey]
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 @@ -21,6 +21,7 @@ func configureTestBasePaths(c *Config, url string) {
c.AccessApprovalBasePath = url
c.AccessContextManagerBasePath = url
c.ActiveDirectoryBasePath = url
c.AlloydbBasePath = url
c.ApigeeBasePath = url
c.AppEngineBasePath = url
c.ArtifactRegistryBasePath = url
Expand Down
16 changes: 14 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ func Provider() *schema.Provider {
"GOOGLE_ACTIVE_DIRECTORY_CUSTOM_ENDPOINT",
}, DefaultBasePaths[ActiveDirectoryBasePathKey]),
},
"alloydb_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_ALLOYDB_CUSTOM_ENDPOINT",
}, DefaultBasePaths[AlloydbBasePathKey]),
},
"apigee_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -981,9 +989,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 259
// Generated resources: 262
// Generated IAM resources: 168
// Total generated resources: 427
// Total generated resources: 430
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand All @@ -1008,6 +1016,9 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_access_context_manager_access_levels": resourceAccessContextManagerAccessLevels(),
"google_active_directory_domain": resourceActiveDirectoryDomain(),
"google_active_directory_domain_trust": resourceActiveDirectoryDomainTrust(),
"google_alloydb_cluster": resourceAlloydbCluster(),
"google_alloydb_instance": resourceAlloydbInstance(),
"google_alloydb_backup": resourceAlloydbBackup(),
"google_apigee_organization": resourceApigeeOrganization(),
"google_apigee_instance": resourceApigeeInstance(),
"google_apigee_environment": resourceApigeeEnvironment(),
Expand Down Expand Up @@ -1633,6 +1644,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.AccessApprovalBasePath = d.Get("access_approval_custom_endpoint").(string)
config.AccessContextManagerBasePath = d.Get("access_context_manager_custom_endpoint").(string)
config.ActiveDirectoryBasePath = d.Get("active_directory_custom_endpoint").(string)
config.AlloydbBasePath = d.Get("alloydb_custom_endpoint").(string)
config.ApigeeBasePath = d.Get("apigee_custom_endpoint").(string)
config.AppEngineBasePath = d.Get("app_engine_custom_endpoint").(string)
config.ArtifactRegistryBasePath = d.Get("artifact_registry_custom_endpoint").(string)
Expand Down
Loading