Skip to content

Commit 479fbfc

Browse files
committed
2 parents ccf64aa + 46d34c6 commit 479fbfc

23 files changed

Lines changed: 299 additions & 108 deletions

mmv1/products/accessapproval/FolderSettings.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ update_verb: PATCH
2929
legacy_name: google_folder_access_approval_settings
3030
import_format:
3131
- folders/{{folder_id}}/accessApprovalSettings
32+
include_in_tgc_next: true
33+
tgc_tests:
34+
- name: 'TestAccAccessApprovalSettings/folder'
3235
custom_code:
3336
constants: templates/terraform/constants/access_approval.go.tmpl
3437
pre_create: templates/terraform/update_mask.go.tmpl

mmv1/products/chronicle/NativeDashboard.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: A configuration for a native dashboard within a Google SecOps (Chro
1717
references:
1818
guides:
1919
'Google SecOps Guides': 'https://cloud.google.com/chronicle/docs/secops/secops-overview'
20-
api: 'https://cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances.nativeDashboards'
20+
api: 'https://cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.nativeDashboards'
2121
base_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/nativeDashboards
2222
self_link: 'projects/{{project}}/locations/{{location}}/instances/{{instance}}/nativeDashboards/{{dashboard_id}}'
2323
create_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/nativeDashboards
@@ -28,11 +28,9 @@ import_format:
2828
update_mask: true
2929
update_verb: PATCH
3030

31-
min_version: 'beta'
3231
examples:
3332
- name: chronicle_nativedashboard_basic
3433
primary_resource_id: my_basic_dashboard
35-
min_version: 'beta'
3634
ignore_read_extra:
3735
- "last_viewed_time"
3836
vars:

mmv1/products/chronicle/Rule.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ examples:
5454

5555
custom_code:
5656
pre_delete: 'templates/terraform/pre_delete/chronicle_rule.go.tmpl'
57+
test_check_destroy: 'templates/terraform/custom_check_destroy/chronicle_rule.go.tmpl'
5758

5859
virtual_fields:
5960
- name: 'deletion_policy'

mmv1/products/cloudrun/Service.yaml

Lines changed: 89 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -69,95 +69,118 @@ sweeper:
6969
- region: "us-central1"
7070
- region: "europe-west1"
7171
- region: "europe-north1"
72-
examples:
72+
samples:
7373
- name: 'cloud_run_service_basic'
7474
primary_resource_id: 'default'
75-
vars:
76-
cloud_run_service_name: 'cloudrun-srv'
77-
test_env_vars:
78-
project: 'PROJECT_NAME'
75+
steps:
76+
- name: 'cloud_run_service_basic'
77+
resource_id_vars:
78+
cloud_run_service_name: 'cloudrun-srv'
79+
test_env_vars:
80+
project: 'PROJECT_NAME'
7981
- name: 'cloud_run_service_gpu'
8082
primary_resource_id: 'default'
81-
vars:
82-
cloud_run_service_name: 'cloudrun-srv'
83-
test_env_vars:
84-
project: 'PROJECT_NAME'
83+
steps:
84+
- name: 'cloud_run_service_gpu'
85+
resource_id_vars:
86+
cloud_run_service_name: 'cloudrun-srv'
87+
test_env_vars:
88+
project: 'PROJECT_NAME'
8589
- name: 'cloud_run_service_sql'
8690
primary_resource_id: 'default'
87-
vars:
88-
cloud_run_service_name: 'cloudrun-srv'
89-
cloud_run_sql_name: 'cloudrun-sql'
90-
deletion_protection: 'true'
91-
test_vars_overrides:
92-
'deletion_protection': 'false'
93-
oics_vars_overrides:
94-
'deletion_protection': 'false'
95-
ignore_read_extra:
96-
- 'autogenerate_revision_name'
91+
steps:
92+
- name: 'cloud_run_service_sql'
93+
resource_id_vars:
94+
cloud_run_service_name: 'cloudrun-srv'
95+
cloud_run_sql_name: 'cloudrun-sql'
96+
vars:
97+
deletion_protection: 'true'
98+
test_vars_overrides:
99+
'deletion_protection': 'false'
100+
oics_vars_overrides:
101+
'deletion_protection': 'false'
102+
ignore_read_extra:
103+
- 'autogenerate_revision_name'
97104
- name: 'cloud_run_service_noauth'
98105
primary_resource_id: 'default'
99-
vars:
100-
cloud_run_service_name: 'cloudrun-srv'
101-
test_env_vars:
102-
project: 'PROJECT_NAME'
106+
steps:
107+
- name: 'cloud_run_service_noauth'
108+
resource_id_vars:
109+
cloud_run_service_name: 'cloudrun-srv'
110+
test_env_vars:
111+
project: 'PROJECT_NAME'
103112
- name: 'cloud_run_service_multiple_environment_variables'
104113
primary_resource_id: 'default'
105-
vars:
106-
cloud_run_service_name: 'cloudrun-srv'
107-
test_env_vars:
108-
project: 'PROJECT_NAME'
109-
ignore_read_extra:
110-
- 'autogenerate_revision_name'
111-
exclude_docs: true
114+
exclude_basic_doc: true
115+
steps:
116+
- name: 'cloud_run_service_multiple_environment_variables'
117+
resource_id_vars:
118+
cloud_run_service_name: 'cloudrun-srv'
119+
test_env_vars:
120+
project: 'PROJECT_NAME'
121+
ignore_read_extra:
122+
- 'autogenerate_revision_name'
112123
- name: 'cloud_run_service_secret_environment_variables'
113124
primary_resource_id: 'default'
114-
vars:
115-
cloud_run_service_name: 'cloudrun-srv'
116-
secret_id: 'secret'
117-
test_vars_overrides:
118-
# for backward compatible
119-
secret_id: '"secret" + randomSuffix'
120-
test_env_vars:
121-
project: 'PROJECT_NAME'
122-
ignore_read_extra:
123-
- 'autogenerate_revision_name'
124-
exclude_docs: true
125+
exclude_basic_doc: true
126+
steps:
127+
- name: 'cloud_run_service_secret_environment_variables'
128+
resource_id_vars:
129+
cloud_run_service_name: 'cloudrun-srv'
130+
secret_id: 'secret'
131+
test_vars_overrides:
132+
# for backward compatible
133+
secret_id: '"secret" + randomSuffix'
134+
test_env_vars:
135+
project: 'PROJECT_NAME'
136+
ignore_read_extra:
137+
- 'autogenerate_revision_name'
125138
- name: 'cloud_run_service_secret_volumes'
126139
primary_resource_id: 'default'
127-
vars:
128-
cloud_run_service_name: 'cloudrun-srv'
129-
secret_id: 'secret'
130-
test_vars_overrides:
131-
# for backward compatible
132-
secret_id: '"secret" + randomSuffix'
133-
test_env_vars:
134-
project: 'PROJECT_NAME'
135-
ignore_read_extra:
136-
- 'autogenerate_revision_name'
137-
exclude_docs: true
140+
exclude_basic_doc: true
141+
steps:
142+
- name: 'cloud_run_service_secret_volumes'
143+
resource_id_vars:
144+
cloud_run_service_name: 'cloudrun-srv'
145+
secret_id: 'secret'
146+
test_vars_overrides:
147+
# for backward compatible
148+
secret_id: '"secret" + randomSuffix'
149+
test_env_vars:
150+
project: 'PROJECT_NAME'
151+
ignore_read_extra:
152+
- 'autogenerate_revision_name'
138153
- name: 'cloud_run_service_probes'
139154
primary_resource_id: 'default'
140-
vars:
141-
cloud_run_service_name: 'cloudrun-srv'
155+
steps:
156+
- name: 'cloud_run_service_probes'
157+
resource_id_vars:
158+
cloud_run_service_name: 'cloudrun-srv'
142159
- name: 'cloud_run_service_readiness_probe'
143160
primary_resource_id: 'default'
144-
vars:
145-
cloud_run_service_name: 'cloudrun-srv-rp'
146-
test_env_vars:
147-
project: 'PROJECT_NAME'
161+
steps:
162+
- name: 'cloud_run_service_readiness_probe'
163+
resource_id_vars:
164+
cloud_run_service_name: 'cloudrun-srv-rp'
165+
test_env_vars:
166+
project: 'PROJECT_NAME'
148167
- name: 'cloud_run_service_multicontainer'
149168
primary_resource_id: 'default'
150169
min_version: 'beta'
151-
vars:
152-
cloud_run_service_name: 'cloudrun-srv'
153-
test_env_vars:
154-
project: 'PROJECT_NAME'
170+
steps:
171+
- name: 'cloud_run_service_multicontainer'
172+
resource_id_vars:
173+
cloud_run_service_name: 'cloudrun-srv'
174+
test_env_vars:
175+
project: 'PROJECT_NAME'
155176
- name: 'cloud_run_service_iap'
156177
primary_resource_id: 'default'
157-
vars:
158-
cloud_run_service_name: 'cloudrun-srv'
159-
test_env_vars:
160-
project: 'PROJECT_NAME'
178+
steps:
179+
- name: 'cloud_run_service_iap'
180+
resource_id_vars:
181+
cloud_run_service_name: 'cloudrun-srv'
182+
test_env_vars:
183+
project: 'PROJECT_NAME'
161184
virtual_fields:
162185
- name: 'autogenerate_revision_name'
163186
description: |

mmv1/products/databasemigrationservice/PrivateConnection.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ timeouts:
3333
delete_minutes: 60
3434
autogen_async: true
3535
async:
36-
actions: ['create', 'delete', 'update']
36+
actions: ['create', 'delete']
3737
type: 'OpAsync'
3838
operation:
39+
timeouts:
40+
insert_minutes: 60
41+
delete_minutes: 60
3942
base_url: '{{op_id}}'
4043
result:
4144
resource_inside_response: false
@@ -50,6 +53,23 @@ examples:
5053
test_vars_overrides:
5154
# for backward compatible
5255
create_without_validation: '"false" + randomSuffix'
56+
network_name: '"my-network" + randomSuffix'
57+
private_connection_id: '"my-connection" + randomSuffix'
58+
- name: 'database_migration_service_private_connection_psc'
59+
primary_resource_id: 'default'
60+
vars:
61+
private_connection_id: 'my-connection'
62+
attachment_name: 'my-attachment'
63+
create_without_validation: 'false'
64+
network_name: 'my-network'
65+
subnetwork_name: 'my-subnetwork'
66+
test_vars_overrides:
67+
# for backward compatible
68+
create_without_validation: '"false" + randomSuffix'
69+
attachment_name: '"my-attachment" + randomSuffix'
70+
private_connection_id: '"my-connection" + randomSuffix'
71+
network_name: '"my-network" + randomSuffix'
72+
subnetwork_name: '"my-subnetwork" + randomSuffix'
5373
parameters:
5474
- name: 'privateConnectionId'
5575
type: String
@@ -109,7 +129,8 @@ properties:
109129
description: |
110130
The VPC Peering configuration is used to create VPC peering
111131
between databasemigrationservice and the consumer's VPC.
112-
required: true
132+
exactly_one_of:
133+
- 'pscInterfaceConfig'
113134
properties:
114135
- name: 'vpcName'
115136
type: String
@@ -122,3 +143,17 @@ properties:
122143
description: |
123144
A free subnet for peering. (CIDR of /29)
124145
required: true
146+
- name: 'pscInterfaceConfig'
147+
type: NestedObject
148+
description: |
149+
The PSC Interface configuration is used to create PSC Interface
150+
between DMS's internal VPC and the consumer's PSC.
151+
exactly_one_of:
152+
- 'vpcPeeringConfig'
153+
properties:
154+
- name: 'networkAttachment'
155+
type: String
156+
description: |
157+
Fully qualified name of the Network Attachment that DMS will connect to.
158+
Format: projects/{project}/regions/{region}/networkAttachments/{name}
159+
required: true

mmv1/products/workstations/WorkstationCluster.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ examples:
6565
test_vars_overrides:
6666
'key_short_name': '"tf-test-key-" + acctest.RandString(t, 10)'
6767
'value_short_name': '"tf-test-value-" + acctest.RandString(t, 10)'
68+
samples:
69+
- name: "workstation_cluster_urls"
70+
primary_resource_id: "default"
71+
steps:
72+
- name: "workstation_cluster_custom_urls"
73+
vars:
74+
cluster_id: "custom-urls-cluster"
75+
resource_id_vars:
76+
cluster_network_name: "workstations-network"
6877
parameters:
6978
- name: 'workstationClusterId'
7079
type: String
@@ -120,6 +129,17 @@ properties:
120129
type: String
121130
description: |
122131
Human-readable name for this resource.
132+
- name: 'workstationAuthorizationUrl'
133+
type: String
134+
default_from_api: true
135+
description: |
136+
Specifies the redirect URL for unauthorized requests received by workstation VMs in this cluster.
137+
Redirects to this endpoint will send a base64 encoded `state` query param containing the target workstation name and original request hostname. The endpoint is responsible for retrieving a token using `GenerateAccessToken` and redirecting back to the original hostname with the token.
138+
- name: 'workstationLaunchUrl'
139+
type: String
140+
description: |
141+
Specifies the launch URL for workstations in this cluster. Requests sent to unstarted workstations will be redirected to this URL.
142+
Requests redirected to the launch endpoint will be sent with a `workstation` query parameter containing the full workstation resource. The launch endpoint is responsible for starting the workstation, polling it until it reaches `STATE_RUNNING`, and then issuing a redirect to the workstation's host URL.
123143
- name: 'degraded'
124144
type: Boolean
125145
description: |
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Delete is eventually-consistent; wait for a moment.
2+
time.Sleep(10*time.Second)
3+
4+
config := acctest.GoogleProviderConfig(t)
5+
url, err := tpgresource.ReplaceVarsForTest(config, rs, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(chronicle.Product, config), "projects/{{"{{"}}project{{"}}"}}/locations/{{"{{"}}location{{"}}"}}/instances/{{"{{"}}instance{{"}}"}}/rules/{{"{{"}}rule_id{{"}}"}}"))
6+
if err != nil {
7+
return err
8+
}
9+
10+
billingProject := ""
11+
12+
if config.BillingProject != "" {
13+
billingProject = config.BillingProject
14+
}
15+
16+
_, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
17+
Config: config,
18+
Method: "GET",
19+
Project: billingProject,
20+
RawURL: url,
21+
UserAgent: config.UserAgent,
22+
})
23+
if err == nil {
24+
return fmt.Errorf("ChronicleRule still exists at %s", url)
25+
}

mmv1/templates/terraform/examples/chronicle_nativedashboard_basic.tf.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
resource "google_chronicle_native_dashboard" "my_basic_dashboard" {
2-
provider = google-beta
32
location = "us"
43
instance = "{{index $.TestEnvVars "chronicle_id"}}"
54
display_name = "{{index $.Vars "dashboard_name"}}"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
resource "google_database_migration_service_private_connection" "{{$.PrimaryResourceId}}" {
2+
display_name = "dbms_pc"
3+
location = "us-central1"
4+
private_connection_id = "{{index $.Vars "private_connection_id"}}"
5+
6+
labels = {
7+
key = "value"
8+
}
9+
10+
psc_interface_config {
11+
network_attachment = resource.google_compute_network_attachment.default.id
12+
}
13+
14+
create_without_validation = false
15+
}
16+
17+
resource "google_compute_network_attachment" "default" {
18+
name = "{{index $.Vars "attachment_name"}}"
19+
region = "us-central1"
20+
connection_preference = "ACCEPT_AUTOMATIC"
21+
subnetworks = [resource.google_compute_subnetwork.default.id]
22+
}
23+
24+
resource "google_compute_network" "default" {
25+
name = "{{index $.Vars "network_name"}}"
26+
auto_create_subnetworks = false
27+
}
28+
29+
resource "google_compute_subnetwork" "default" {
30+
name = "{{index $.Vars "subnetwork_name"}}"
31+
ip_cidr_range = "10.0.0.0/16"
32+
region = "us-central1"
33+
network = google_compute_network.default.id
34+
}

mmv1/templates/terraform/examples/cloud_run_service_basic.tf.tmpl renamed to mmv1/templates/terraform/samples/services/cloudrun/cloud_run_service_basic.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "google_cloud_run_service" "{{$.PrimaryResourceId}}" {
2-
name = "{{index $.Vars "cloud_run_service_name"}}"
2+
name = "{{index $.ResourceIdVars "cloud_run_service_name"}}"
33
location = "us-central1"
44

55
template {

0 commit comments

Comments
 (0)