Skip to content

Commit 00846d4

Browse files
authored
Add support for launch and authorization URLs on workstation_cluster. (GoogleCloudPlatform#17472)
1 parent 1f6c3df commit 00846d4

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
resource "google_workstations_workstation_cluster" "{{$.PrimaryResourceId}}" {
2+
workstation_cluster_id = "{{index $.Vars "cluster_id"}}"
3+
network = google_compute_network.default.id
4+
subnetwork = google_compute_subnetwork.default.id
5+
location = "us-central1"
6+
7+
workstation_authorization_url = "https://workstations.cloud.google.com/ui/auth"
8+
workstation_launch_url = "https://console.cloud.google.com/workstations/launch"
9+
}
10+
11+
data "google_project" "project" {
12+
}
13+
14+
resource "google_compute_network" "default" {
15+
name = "{{index $.ResourceIdVars "cluster_network_name"}}"
16+
auto_create_subnetworks = false
17+
}
18+
19+
resource "google_compute_subnetwork" "default" {
20+
name = "{{index $.ResourceIdVars "cluster_network_name"}}"
21+
ip_cidr_range = "10.0.0.0/24"
22+
region = "us-central1"
23+
network = google_compute_network.default.name
24+
}

0 commit comments

Comments
 (0)