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

Cloud Workstations - Workstation Config #7017

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b5bc460
Add WorkstationConfig resource
bschaatsbergen Dec 21, 2022
5a18847
indent correctly
bschaatsbergen Dec 21, 2022
7b75c6d
Merge branch 'main' into cloud-workstations-workstation-config
bschaatsbergen Jan 31, 2023
9ef31d6
add the workstationConfig
bschaatsbergen Jan 31, 2023
45d5994
Add WorkstationConfig
bschaatsbergen Jan 31, 2023
5f8b3e8
Create workstation_config_basic.tf.erb
bschaatsbergen Jan 31, 2023
7db8872
Create resource_workstations_workstation_config_test.go.erb
bschaatsbergen Jan 31, 2023
71dd398
fix indent
bschaatsbergen Jan 31, 2023
9626224
remove duplicate displayName field
bschaatsbergen Jan 31, 2023
2cd6605
add `workstationClusterId` param
bschaatsbergen Jan 31, 2023
00564c4
set host attribute block
bschaatsbergen Jan 31, 2023
2a8332e
set the `workstation_cluster_id`
bschaatsbergen Jan 31, 2023
f888377
fix create
bschaatsbergen Feb 1, 2023
78ce695
use a default for the container property
bschaatsbergen Feb 1, 2023
ecdb6f8
add input true
bschaatsbergen Feb 1, 2023
3a3e095
set api defaults
bschaatsbergen Feb 2, 2023
6ba2733
set `host.gceInstance.bootDiskSizeGb` to be computed
bschaatsbergen Feb 2, 2023
adb355f
fix machine_type attribute
bschaatsbergen Feb 2, 2023
7e45687
Merge remote-tracking branch 'upstream/main' into cloud-workstations-…
bschaatsbergen Feb 2, 2023
101a2f6
fix typo's
bschaatsbergen Feb 2, 2023
6dc716c
lower case funcs
bschaatsbergen Feb 2, 2023
a2b5e68
Update mmv1/third_party/terraform/tests/resource_workstations_worksta…
bschaatsbergen Feb 2, 2023
6140a5a
add location
bschaatsbergen Feb 2, 2023
dd2d0c9
add skip test to examples
bschaatsbergen Feb 6, 2023
202ee43
add tests to run sequentially instead of paralell
bschaatsbergen Feb 6, 2023
1ad43e7
set `<% unless version == 'ga' -%>`
bschaatsbergen Feb 6, 2023
1fc0744
Remove extra tests
bschaatsbergen Feb 6, 2023
37a4af3
align google_workstations_workstation_config resource in update test
bschaatsbergen Feb 8, 2023
404ae30
Revert "align google_workstations_workstation_config resource in upda…
bschaatsbergen Feb 8, 2023
6849617
Revert "Remove extra tests"
bschaatsbergen Feb 8, 2023
2a7e181
revert skip test
bschaatsbergen Feb 8, 2023
4dc89e8
align tests and remove update label
bschaatsbergen Feb 8, 2023
0b3378e
add encryptionKey attribute
bschaatsbergen Feb 8, 2023
961e6bf
Merge remote-tracking branch 'upstream/main' into cloud-workstations-…
bschaatsbergen Feb 8, 2023
c5a6b7c
indent the description
bschaatsbergen Feb 8, 2023
a3549b6
add encryption key test
bschaatsbergen Feb 9, 2023
82d858b
Use a static `account_id` for KMS SA
bschaatsbergen Feb 9, 2023
27c5a7c
address comments on pr
bschaatsbergen Feb 11, 2023
75dd220
set some extra defaults
bschaatsbergen Feb 11, 2023
0f7d6c5
add 2 new tests to test host and persistent_directories
bschaatsbergen Feb 11, 2023
3eb76f7
Move back up
bschaatsbergen Feb 20, 2023
8b4ce30
have a single set of unless/end
bschaatsbergen Feb 20, 2023
d7145e4
remove data google project
bschaatsbergen Feb 23, 2023
0b9b42f
Remove faulty import
bschaatsbergen Feb 23, 2023
6f02e61
remove duplicate output and fmt
bschaatsbergen Feb 23, 2023
c456e94
remove output field on displayName
bschaatsbergen Feb 23, 2023
a31d55d
add displayName update test
bschaatsbergen Feb 23, 2023
05ef367
Fix update of display name
bschaatsbergen Feb 24, 2023
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
279 changes: 277 additions & 2 deletions mmv1/products/workstations/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ objects:
Time the Instance was created in UTC.
output: true
- !ruby/object:Api::Type::NestedObject
name: 'privateClusterConfig'
name: "privateClusterConfig"
description: |
Configuration for private cluster.
properties:
Expand Down Expand Up @@ -167,8 +167,283 @@ objects:
description: |-
Human readable message indicating details about the current status.
- !ruby/object:Api::Type::Array
name: 'details'
name: "details"
description: |
A list of messages that carry the error details.
item_type: Api::Type::KeyValuePairs
output: true
- !ruby/object:Api::Resource
name: "WorkstationConfig"
self_link: "projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}"
base_url: "projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs"
create_url: "projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs?workstationConfigId={{workstation_config_id}}"
update_verb: :PATCH
update_mask: true
min_version: beta
description: "A set of configuration options describing how a workstation will be run. Workstation configurations are intended to be shared across multiple workstations."
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
"Workstations": "https://cloud.google.com/workstations/docs/"
api: "https://cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters.workstationConfigs/create"
async: !ruby/object:Api::OpAsync
operation: !ruby/object:Api::OpAsync::Operation
path: "name"
base_url: "{{op_id}}"
wait_ms: 1000
timeouts: !ruby/object:Api::Timeouts
insert_minutes: 30
update_minutes: 30
delete_minutes: 30
result: !ruby/object:Api::OpAsync::Result
path: "response"
status: !ruby/object:Api::OpAsync::Status
path: "done"
complete: true
allowed:
- true
- false
error: !ruby/object:Api::OpAsync::Error
path: "error"
message: "message"
parameters:
- !ruby/object:Api::Type::String
name: "workstationConfigId"
required: true
input: true
url_param_only: true
description: |
The ID of the workstation cluster config.
- !ruby/object:Api::Type::String
name: "workstationClusterId"
required: true
input: true
url_param_only: true
description: |
The name of the workstation cluster.
- !ruby/object:Api::Type::String
name: "location"
bschaatsbergen marked this conversation as resolved.
Show resolved Hide resolved
input: true
required: true
url_param_only: true
description: |
The location where the workstation cluster config should reside.
properties:
- !ruby/object:Api::Type::String
name: "name"
output: true
description: |
Full name of this resource.
- !ruby/object:Api::Type::String
name: "uid"
output: true
description: |
The system-generated UID of the resource.
- !ruby/object:Api::Type::String
name: "displayName"
description: |
Human-readable name for this resource.
- !ruby/object:Api::Type::KeyValuePairs
name: "labels"
description: "Client-specified labels that are applied to the resource and that are also propagated to the underlying Compute Engine resources."
- !ruby/object:Api::Type::KeyValuePairs
name: "annotations"
description: "Client-specified annotations. This is distinct from labels."
- !ruby/object:Api::Type::Fingerprint
name: "etag"
description: |
Checksum computed by the server.
May be sent on update and delete requests to ensure that the client has an up-to-date value before proceeding.
- !ruby/object:Api::Type::Time
name: "createTime"
description: |
Time the Instance was created in UTC.
output: true
- !ruby/object:Api::Type::NestedObject
name: "host"
bschaatsbergen marked this conversation as resolved.
Show resolved Hide resolved
description: |
Runtime host for a workstation.
input: true
properties:
- !ruby/object:Api::Type::NestedObject
name: "gceInstance"
bschaatsbergen marked this conversation as resolved.
Show resolved Hide resolved
description: |
Specifies a Compute Engine instance as the host.
input: true
properties:
- !ruby/object:Api::Type::String
name: "machineType"
input: true
description: |-
The name of a Compute Engine machine type.
- !ruby/object:Api::Type::String
name: "serviceAccount"
input: true
description: |-
Email address of the service account that will be used on VM instances used to support this config. This service account must have permission to pull the specified container image. If not set, VMs will run without a service account, in which case the image must be publicly accessible.
- !ruby/object:Api::Type::Integer
name: "poolSize"
input: true
description: |-
Number of instances to pool for faster workstation startup.
- !ruby/object:Api::Type::Integer
name: "bootDiskSizeGb"
input: true
description: |-
Size of the boot disk in GB.
- !ruby/object:Api::Type::Array
name: "tags"
item_type: Api::Type::String
input: true
description: |
Network tags to add to the Compute Engine machines backing the Workstations.
- !ruby/object:Api::Type::Boolean
name: "disablePublicIpAddresses"
input: true
description: |
Whether instances have no public IP address.
- !ruby/object:Api::Type::NestedObject
name: "shieldedInstanceConfig"
description: |
A set of Compute Engine Shielded instance options.
input: true
properties:
- !ruby/object:Api::Type::Boolean
name: "enableSecureBoot"
input: true
description: |
Whether the instance has Secure Boot enabled.
- !ruby/object:Api::Type::Boolean
name: "enableVtpm"
input: true
description: |
Whether the instance has the vTPM enabled.
- !ruby/object:Api::Type::Boolean
name: "enableIntegrityMonitoring"
input: true
description: |
Whether the instance has integrity monitoring enabled.
- !ruby/object:Api::Type::NestedObject
name: "confidentialInstanceConfig"
description: |
A set of Compute Engine Confidential VM instance options.
input: true
properties:
- !ruby/object:Api::Type::Boolean
name: "enableConfidentialCompute"
input: true
description: |
Whether the instance has confidential compute enabled.
- !ruby/object:Api::Type::Array
name: "persistentDirectories"
description: |
Directories to persist across workstation sessions.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: "mountPath"
description: |
Location of this directory in the running workstation.
- !ruby/object:Api::Type::NestedObject
name: "gcePd"
bschaatsbergen marked this conversation as resolved.
Show resolved Hide resolved
bschaatsbergen marked this conversation as resolved.
Show resolved Hide resolved
description: |
PersistentDirectory backed by a Compute Engine regional persistent disk.
properties:
- !ruby/object:Api::Type::String
name: "fsType"
description: |
Type of file system that the disk should be formatted with. The workstation image must support this file system type. Must be empty if sourceSnapshot is set.
- !ruby/object:Api::Type::String
name: "diskType"
description: |
Type of the disk to use.
- !ruby/object:Api::Type::Integer
name: "sizeGb"
description: |-
Size of the disk in GB. Must be empty if sourceSnapshot is set.
- !ruby/object:Api::Type::Enum
name: "reclaimPolicy"
description: |
What should happen to the disk after the workstation is deleted. Defaults to DELETE.
values:
- :RECLAIM_POLICY_UNSPECIFIED
- :DELETE
- :RETAIN
- !ruby/object:Api::Type::NestedObject
name: "container"
description: |
Container that will be run for each workstation using this configuration when that workstation is started.
properties:
- !ruby/object:Api::Type::String
name: "image"
description: |
Docker image defining the container. This image must be accessible by the config"s service account.
- !ruby/object:Api::Type::Array
name: "command"
item_type: Api::Type::String
description: |
If set, overrides the default ENTRYPOINT specified by the image.
- !ruby/object:Api::Type::Array
name: "args"
item_type: Api::Type::String
description: |
Arguments passed to the entrypoint.
- !ruby/object:Api::Type::String
name: "workingDir"
description: |
If set, overrides the default DIR specified by the image.
- !ruby/object:Api::Type::KeyValuePairs
name: "env"
description: |
Environment variables passed to the container.
The elements are of the form "KEY=VALUE" for the environment variable "KEY" being given the value "VALUE".
- !ruby/object:Api::Type::Integer
name: "runAsUser"
description: |
If set, overrides the USER specified in the image with the given uid.
- !ruby/object:Api::Type::NestedObject
name: "encryptionKey"
description: |
Encrypts resources of this workstation configuration using a customer-managed encryption key.

If specified, the boot disk of the Compute Engine instance and the persistent disk are encrypted using this encryption key. If this field is not set, the disks are encrypted using a generated key. Customer-managed encryption keys do not protect disk metadata.
If the customer-managed encryption key is rotated, when the workstation instance is stopped, the system attempts to recreate the persistent disk with the new version of the key. Be sure to keep older versions of the key until the persistent disk is recreated. Otherwise, data on the persistent disk will be lost.
If the encryption key is revoked, the workstation session will automatically be stopped within 7 hours.
properties:
- !ruby/object:Api::Type::String
name: "kmsKey"
description: |
The name of the Google Cloud KMS encryption key.
required: true
- !ruby/object:Api::Type::String
name: "kmsKeyServiceAccount"
description: |
The service account to use with the specified KMS key.
required: true
- !ruby/object:Api::Type::Boolean
name: "degraded"
description: |
Whether this resource is in degraded mode, in which case it may require user action to restore full functionality. Details can be found in the conditions field.
output: true
- !ruby/object:Api::Type::Array
name: "conditions"
description: |-
Status conditions describing the current resource state.
output: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::Integer
name: "code"
output: true
description: |-
The status code, which should be an enum value of google.rpc.Code.
- !ruby/object:Api::Type::String
name: "message"
output: true
description: |-
Human readable message indicating details about the current status.
- !ruby/object:Api::Type::Array
name: "details"
bschaatsbergen marked this conversation as resolved.
Show resolved Hide resolved
output: true
description: |
A list of messages that carry the error details.
item_type: Api::Type::KeyValuePairs
81 changes: 80 additions & 1 deletion mmv1/products/workstations/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
!ruby/object:Provider::Terraform::Config
overrides: !ruby/object:Overrides::ResourceOverrides
WorkstationCluster: !ruby/object:Overrides::Terraform::ResourceOverride
import_format: ["projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}", "{{workstation_cluster_id}}"]
import_format:
[
"projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}",
"{{workstation_cluster_id}}",
]
autogen_async: true
examples:
- !ruby/object:Provider::Terraform::Examples
Expand All @@ -30,3 +34,78 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_id: "default"
vars:
workstation_cluster_name: "workstation-cluster-private"
WorkstationConfig: !ruby/object:Overrides::Terraform::ResourceOverride
import_format:
[
"projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}",
"{{workstation_config_id}}",
]
autogen_async: true
properties:
host: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
host.gceInstance: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
host.gceInstance.poolSize:
!ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
host.gceInstance.bootDiskSizeGb:
!ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
host.gceInstance.machineType:
!ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
container: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
bschaatsbergen marked this conversation as resolved.
Show resolved Hide resolved
container.image: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
persistentDirectories: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
persistentDirectories.gcePd:
!ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
persistentDirectories.gcePd.diskType:
!ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
persistentDirectories.gcePd.fsType:
!ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
persistentDirectories.gcePd.sizeGb:
!ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
examples:
- !ruby/object:Provider::Terraform::Examples
name: "workstation_config_basic"
min_version: beta
primary_resource_id: "default"
vars:
workstation_cluster_name: "workstation-cluster"
workstation_config_name: "workstation-config"
- !ruby/object:Provider::Terraform::Examples
name: "workstation_config_container"
min_version: beta
primary_resource_id: "default"
vars:
workstation_cluster_name: "workstation-cluster"
workstation_config_name: "workstation-config"
- !ruby/object:Provider::Terraform::Examples
name: "workstation_config_persistent_directories"
min_version: beta
primary_resource_id: "default"
vars:
workstation_cluster_name: "workstation-cluster"
workstation_config_name: "workstation-config"
- !ruby/object:Provider::Terraform::Examples
name: "workstation_config_shielded_instance_config"
min_version: beta
primary_resource_id: "default"
vars:
workstation_cluster_name: "workstation-cluster"
workstation_config_name: "workstation-config"
- !ruby/object:Provider::Terraform::Examples
name: "workstation_config_encryption_key"
min_version: beta
primary_resource_id: "default"
vars:
workstation_cluster_name: "workstation-cluster"
workstation_config_name: "workstation-config"
Loading