forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go rewrite handwritten provider files (GoogleCloudPlatform#11638)
- Loading branch information
Showing
29 changed files
with
3,623 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
name: 'SiteVerification' | ||
display_name: 'Site Verification' | ||
versions: | ||
- name: 'ga' | ||
base_url: 'https://www.googleapis.com/siteVerification/v1/' | ||
scopes: | ||
- 'https://www.googleapis.com/auth/siteverification' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
mmv1/templates/terraform/custom_check_destroy/go/kms_autokey_config.go.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
mmv1/templates/terraform/examples/go/cloudrunv2_service_mesh.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { | ||
provider = google-beta | ||
name = "{{index $.Vars "cloud_run_service_name"}}" | ||
depends_on = [time_sleep.wait_for_mesh] | ||
deletion_protection = false | ||
|
||
location = "us-central1" | ||
launch_stage = "BETA" | ||
|
||
template { | ||
containers { | ||
image = "us-docker.pkg.dev/cloudrun/container/hello" | ||
} | ||
service_mesh { | ||
mesh = google_network_services_mesh.mesh.id | ||
} | ||
} | ||
} | ||
|
||
resource "time_sleep" "wait_for_mesh" { | ||
depends_on = [google_network_services_mesh.mesh] | ||
|
||
create_duration = "1m" | ||
} | ||
|
||
resource "google_network_services_mesh" "mesh" { | ||
provider = google-beta | ||
name = "{{index $.Vars "mesh_name"}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
mmv1/templates/terraform/post_create/go/kms_autokey_config_folder.go.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id = strings.Replace(id, "folders/folders/", "folders/", 1) | ||
d.SetId(id) |
4 changes: 4 additions & 0 deletions
4
mmv1/templates/terraform/pre_create/go/kms_autokey_config_folder.go.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
url = strings.Replace(url, "folders/folders/", "folders/", 1) | ||
folderValue := d.Get("folder").(string) | ||
folderValue = strings.Replace(folderValue, "folders/", "", 1) | ||
d.Set("folder", folderValue) |
1 change: 1 addition & 0 deletions
1
mmv1/templates/terraform/pre_delete/go/kms_autokey_config_folder.go.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
url = strings.Replace(url, "folders/folders/", "folders/", 1) |
1 change: 1 addition & 0 deletions
1
mmv1/templates/terraform/pre_read/go/kms_autokey_config_folder.go.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
url = strings.Replace(url, "folders/folders/", "folders/", 1) |
1 change: 1 addition & 0 deletions
1
mmv1/templates/terraform/pre_update/go/kms_autokey_config_folder.go.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
url = strings.Replace(url, "folders/folders/", "folders/", 1) |
74 changes: 74 additions & 0 deletions
74
mmv1/third_party/terraform/fwmodels/go/provider_model.go.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package fwmodels | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-framework/attr" | ||
"github.com/hashicorp/terraform-plugin-framework/types" | ||
) | ||
|
||
// ProviderModel describes the provider config data model. | ||
type ProviderModel struct { | ||
Credentials types.String `tfsdk:"credentials"` | ||
AccessToken types.String `tfsdk:"access_token"` | ||
ImpersonateServiceAccount types.String `tfsdk:"impersonate_service_account"` | ||
ImpersonateServiceAccountDelegates types.List `tfsdk:"impersonate_service_account_delegates"` | ||
Project types.String `tfsdk:"project"` | ||
BillingProject types.String `tfsdk:"billing_project"` | ||
Region types.String `tfsdk:"region"` | ||
Zone types.String `tfsdk:"zone"` | ||
Scopes types.List `tfsdk:"scopes"` | ||
Batching types.List `tfsdk:"batching"` | ||
UserProjectOverride types.Bool `tfsdk:"user_project_override"` | ||
RequestTimeout types.String `tfsdk:"request_timeout"` | ||
RequestReason types.String `tfsdk:"request_reason"` | ||
UniverseDomain types.String `tfsdk:"universe_domain"` | ||
DefaultLabels types.Map `tfsdk:"default_labels"` | ||
AddTerraformAttributionLabel types.Bool `tfsdk:"add_terraform_attribution_label"` | ||
TerraformAttributionLabelAdditionStrategy types.String `tfsdk:"terraform_attribution_label_addition_strategy"` | ||
|
||
// Generated Products | ||
{{- range $product := $.Products }} | ||
{{ $product.Name }}CustomEndpoint types.String `tfsdk:"{{ underscore $product.Name }}_custom_endpoint"` | ||
{{- end }} | ||
|
||
// Handwritten Products / Versioned / Atypical Entries | ||
CloudBillingCustomEndpoint types.String `tfsdk:"cloud_billing_custom_endpoint"` | ||
ContainerCustomEndpoint types.String `tfsdk:"container_custom_endpoint"` | ||
DataflowCustomEndpoint types.String `tfsdk:"dataflow_custom_endpoint"` | ||
IamCredentialsCustomEndpoint types.String `tfsdk:"iam_credentials_custom_endpoint"` | ||
ResourceManagerV3CustomEndpoint types.String `tfsdk:"resource_manager_v3_custom_endpoint"` | ||
{{- if ne $.TargetVersionName "ga" }} | ||
RuntimeconfigCustomEndpoint types.String `tfsdk:"runtimeconfig_custom_endpoint"` | ||
{{- end }} | ||
IAMCustomEndpoint types.String `tfsdk:"iam_custom_endpoint"` | ||
TagsLocationCustomEndpoint types.String `tfsdk:"tags_location_custom_endpoint"` | ||
|
||
// dcl | ||
ContainerAwsCustomEndpoint types.String `tfsdk:"container_aws_custom_endpoint"` | ||
ContainerAzureCustomEndpoint types.String `tfsdk:"container_azure_custom_endpoint"` | ||
|
||
// dcl generated | ||
ApikeysCustomEndpoint types.String `tfsdk:"apikeys_custom_endpoint"` | ||
AssuredWorkloadsCustomEndpoint types.String `tfsdk:"assured_workloads_custom_endpoint"` | ||
CloudBuildWorkerPoolCustomEndpoint types.String `tfsdk:"cloud_build_worker_pool_custom_endpoint"` | ||
CloudResourceManagerCustomEndpoint types.String `tfsdk:"cloud_resource_manager_custom_endpoint"` | ||
EventarcCustomEndpoint types.String `tfsdk:"eventarc_custom_endpoint"` | ||
FirebaserulesCustomEndpoint types.String `tfsdk:"firebaserules_custom_endpoint"` | ||
RecaptchaEnterpriseCustomEndpoint types.String `tfsdk:"recaptcha_enterprise_custom_endpoint"` | ||
|
||
GkehubFeatureCustomEndpoint types.String `tfsdk:"gkehub_feature_custom_endpoint"` | ||
} | ||
|
||
type ProviderBatching struct { | ||
SendAfter types.String `tfsdk:"send_after"` | ||
EnableBatching types.Bool `tfsdk:"enable_batching"` | ||
} | ||
|
||
var ProviderBatchingAttributes = map[string]attr.Type{ | ||
"send_after": types.StringType, | ||
"enable_batching": types.BoolType, | ||
} | ||
|
||
// ProviderMetaModel describes the provider meta model | ||
type ProviderMetaModel struct { | ||
ModuleName types.String `tfsdk:"module_name"` | ||
} |
Oops, something went wrong.