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

AD Domain resource added #6866

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/3735.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_active_directory_domain`
```
72 changes: 72 additions & 0 deletions google/active_directory_operation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
//
// ----------------------------------------------------------------------------
//
// 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 (
"encoding/json"
"fmt"
"time"
)

type ActiveDirectoryOperationWaiter struct {
Config *Config
Project string
CommonOperationWaiter
}

func (w *ActiveDirectoryOperationWaiter) 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("https://managedidentities.googleapis.com/v1/%s", w.CommonOperationWaiter.Op.Name)
return sendRequest(w.Config, "GET", w.Project, url, nil)
}

func createActiveDirectoryWaiter(config *Config, op map[string]interface{}, project, activity string) (*ActiveDirectoryOperationWaiter, error) {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil, nil
}
w := &ActiveDirectoryOperationWaiter{
Config: config,
Project: project,
}
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
return nil, err
}
return w, nil
}

// nolint: deadcode,unused
func activeDirectoryOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity string, timeout time.Duration) error {
w, err := createActiveDirectoryWaiter(config, op, project, activity)
if err != nil || w == nil {
// If w is nil, the op was synchronous.
return err
}
if err := OperationWait(w, activity, timeout, config.PollInterval); err != nil {
return err
}
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
}

func activeDirectoryOperationWaitTime(config *Config, op map[string]interface{}, project, activity string, timeout time.Duration) error {
w, err := createActiveDirectoryWaiter(config, op, project, activity)
if err != nil || w == nil {
// If w is nil, the op was synchronous.
return err
}
return OperationWait(w, activity, timeout, config.PollInterval)
}
3 changes: 3 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type Config struct {
tokenSource oauth2.TokenSource

AccessContextManagerBasePath string
ActiveDirectoryBasePath string
AppEngineBasePath string
BigQueryBasePath string
BigqueryDataTransferBasePath string
Expand Down Expand Up @@ -224,6 +225,7 @@ type Config struct {

// Generated product base paths
var AccessContextManagerDefaultBasePath = "https://accesscontextmanager.googleapis.com/v1/"
var ActiveDirectoryDefaultBasePath = "https://managedidentities.googleapis.com/v1/"
var AppEngineDefaultBasePath = "https://appengine.googleapis.com/v1/"
var BigQueryDefaultBasePath = "https://www.googleapis.com/bigquery/v2/"
var BigqueryDataTransferDefaultBasePath = "https://bigquerydatatransfer.googleapis.com/v1/"
Expand Down Expand Up @@ -767,6 +769,7 @@ func removeBasePathVersion(url string) string {
func ConfigureBasePaths(c *Config) {
// Generated Products
c.AccessContextManagerBasePath = AccessContextManagerDefaultBasePath
c.ActiveDirectoryBasePath = ActiveDirectoryDefaultBasePath
c.AppEngineBasePath = AppEngineDefaultBasePath
c.BigQueryBasePath = BigQueryDefaultBasePath
c.BigqueryDataTransferBasePath = BigqueryDataTransferDefaultBasePath
Expand Down
14 changes: 12 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ func Provider() terraform.ResourceProvider {
"GOOGLE_ACCESS_CONTEXT_MANAGER_CUSTOM_ENDPOINT",
}, AccessContextManagerDefaultBasePath),
},
"active_directory_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_ACTIVE_DIRECTORY_CUSTOM_ENDPOINT",
}, ActiveDirectoryDefaultBasePath),
},
"app_engine_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -590,9 +598,9 @@ func Provider() terraform.ResourceProvider {
return provider
}

// Generated resources: 143
// Generated resources: 144
// Generated IAM resources: 57
// Total generated resources: 200
// Total generated resources: 201
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand All @@ -605,6 +613,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_access_context_manager_access_level": resourceAccessContextManagerAccessLevel(),
"google_access_context_manager_service_perimeter": resourceAccessContextManagerServicePerimeter(),
"google_access_context_manager_service_perimeter_resource": resourceAccessContextManagerServicePerimeterResource(),
"google_active_directory_domain": resourceActiveDirectoryDomain(),
"google_app_engine_domain_mapping": resourceAppEngineDomainMapping(),
"google_app_engine_firewall_rule": resourceAppEngineFirewallRule(),
"google_app_engine_standard_app_version": resourceAppEngineStandardAppVersion(),
Expand Down Expand Up @@ -971,6 +980,7 @@ func providerConfigure(d *schema.ResourceData, p *schema.Provider, terraformVers

// Generated products
config.AccessContextManagerBasePath = d.Get("access_context_manager_custom_endpoint").(string)
config.ActiveDirectoryBasePath = d.Get("active_directory_custom_endpoint").(string)
config.AppEngineBasePath = d.Get("app_engine_custom_endpoint").(string)
config.BigQueryBasePath = d.Get("big_query_custom_endpoint").(string)
config.BigqueryDataTransferBasePath = d.Get("bigquery_data_transfer_custom_endpoint").(string)
Expand Down
Loading