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

add certificate manager back in #11685

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/6004.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:new-resource
`google_certificate_manager_certificate`
```
```release-note:new-resource
`google_certificate_manager_dns_authorization`
```
61 changes: 61 additions & 0 deletions google/certificate_manager_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 CertificateManagerOperationWaiter struct {
Config *Config
UserAgent string
Project string
CommonOperationWaiter
}

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

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

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

func certificateManagerOperationWaitTime(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 := createCertificateManagerWaiter(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 @@ -171,6 +171,7 @@ type Config struct {
BigtableBasePath string
BillingBasePath string
BinaryAuthorizationBasePath string
CertificateManagerBasePath string
CloudAssetBasePath string
CloudBuildBasePath string
CloudFunctionsBasePath string
Expand Down Expand Up @@ -271,6 +272,7 @@ const BigqueryReservationBasePathKey = "BigqueryReservation"
const BigtableBasePathKey = "Bigtable"
const BillingBasePathKey = "Billing"
const BinaryAuthorizationBasePathKey = "BinaryAuthorization"
const CertificateManagerBasePathKey = "CertificateManager"
const CloudAssetBasePathKey = "CloudAsset"
const CloudBuildBasePathKey = "CloudBuild"
const CloudFunctionsBasePathKey = "CloudFunctions"
Expand Down Expand Up @@ -353,6 +355,7 @@ var DefaultBasePaths = map[string]string{
BigtableBasePathKey: "https://bigtableadmin.googleapis.com/v2/",
BillingBasePathKey: "https://billingbudgets.googleapis.com/v1/",
BinaryAuthorizationBasePathKey: "https://binaryauthorization.googleapis.com/v1/",
CertificateManagerBasePathKey: "https://certificatemanager.googleapis.com/v1/",
CloudAssetBasePathKey: "https://cloudasset.googleapis.com/v1/",
CloudBuildBasePathKey: "https://cloudbuild.googleapis.com/v1/",
CloudFunctionsBasePathKey: "https://cloudfunctions.googleapis.com/v1/",
Expand Down Expand Up @@ -1197,6 +1200,7 @@ func ConfigureBasePaths(c *Config) {
c.BigtableBasePath = DefaultBasePaths[BigtableBasePathKey]
c.BillingBasePath = DefaultBasePaths[BillingBasePathKey]
c.BinaryAuthorizationBasePath = DefaultBasePaths[BinaryAuthorizationBasePathKey]
c.CertificateManagerBasePath = DefaultBasePaths[CertificateManagerBasePathKey]
c.CloudAssetBasePath = DefaultBasePaths[CloudAssetBasePathKey]
c.CloudBuildBasePath = DefaultBasePaths[CloudBuildBasePathKey]
c.CloudFunctionsBasePath = DefaultBasePaths[CloudFunctionsBasePathKey]
Expand Down
15 changes: 13 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ func Provider() *schema.Provider {
"GOOGLE_BINARY_AUTHORIZATION_CUSTOM_ENDPOINT",
}, DefaultBasePaths[BinaryAuthorizationBasePathKey]),
},
"certificate_manager_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_CERTIFICATE_MANAGER_CUSTOM_ENDPOINT",
}, DefaultBasePaths[CertificateManagerBasePathKey]),
},
"cloud_asset_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -831,9 +839,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 217
// Generated resources: 219
// Generated IAM resources: 108
// Total generated resources: 325
// Total generated resources: 327
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -891,6 +899,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_binary_authorization_attestor_iam_member": ResourceIamMember(BinaryAuthorizationAttestorIamSchema, BinaryAuthorizationAttestorIamUpdaterProducer, BinaryAuthorizationAttestorIdParseFunc),
"google_binary_authorization_attestor_iam_policy": ResourceIamPolicy(BinaryAuthorizationAttestorIamSchema, BinaryAuthorizationAttestorIamUpdaterProducer, BinaryAuthorizationAttestorIdParseFunc),
"google_binary_authorization_policy": resourceBinaryAuthorizationPolicy(),
"google_certificate_manager_dns_authorization": resourceCertificateManagerDnsAuthorization(),
"google_certificate_manager_certificate": resourceCertificateManagerCertificate(),
"google_cloud_asset_project_feed": resourceCloudAssetProjectFeed(),
"google_cloud_asset_folder_feed": resourceCloudAssetFolderFeed(),
"google_cloud_asset_organization_feed": resourceCloudAssetOrganizationFeed(),
Expand Down Expand Up @@ -1423,6 +1433,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.BigtableBasePath = d.Get("bigtable_custom_endpoint").(string)
config.BillingBasePath = d.Get("billing_custom_endpoint").(string)
config.BinaryAuthorizationBasePath = d.Get("binary_authorization_custom_endpoint").(string)
config.CertificateManagerBasePath = d.Get("certificate_manager_custom_endpoint").(string)
config.CloudAssetBasePath = d.Get("cloud_asset_custom_endpoint").(string)
config.CloudBuildBasePath = d.Get("cloud_build_custom_endpoint").(string)
config.CloudFunctionsBasePath = d.Get("cloud_functions_custom_endpoint").(string)
Expand Down
Loading