Skip to content
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
3 changes: 3 additions & 0 deletions .changelog/17530.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
hypercomputecluster: added `terminal_storage_class` and `per_unit_storage_throughput` fields to the `google_hypercomputecluster_cluster` resource
```
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,14 @@ created.`,
Required: true,
Description: `Enables Auto-class feature.`,
},
"terminal_storage_class": {
Type: schema.TypeString,
Optional: true,
Description: `Terminal storage class of the autoclass bucket
Possible values:
NEARLINE
ARCHIVE`,
},
},
},
},
Expand Down Expand Up @@ -962,6 +970,15 @@ only contain letters and numbers.`,
Optional: true,
Description: `Description of the Managed Lustre instance. Maximum of 2048 characters.`,
},
"per_unit_storage_throughput": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: `Throughput of the instance in MB/s/TiB. Valid values are 125, 250,
500, 1000. See [Performance tiers and maximum storage
capacities](https://cloud.google.com/managed-lustre/docs/create-instance#performance-tiers)
for more information.`,
},
},
},
},
Expand Down Expand Up @@ -2253,12 +2270,18 @@ func flattenHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclass(v
transformed := make(map[string]interface{})
transformed["enabled"] =
flattenHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclassEnabled(original["enabled"], d, config)
transformed["terminal_storage_class"] =
flattenHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclassTerminalStorageClass(original["terminalStorageClass"], d, config)
return []interface{}{transformed}
}
func flattenHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclassEnabled(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
}

func flattenHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclassTerminalStorageClass(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
}

func flattenHypercomputeclusterClusterStorageResourcesConfigNewBucketBucket(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
}
Expand Down Expand Up @@ -2365,6 +2388,8 @@ func flattenHypercomputeclusterClusterStorageResourcesConfigNewLustre(v interfac
flattenHypercomputeclusterClusterStorageResourcesConfigNewLustreFilesystem(original["filesystem"], d, config)
transformed["lustre"] =
flattenHypercomputeclusterClusterStorageResourcesConfigNewLustreLustre(original["lustre"], d, config)
transformed["per_unit_storage_throughput"] =
flattenHypercomputeclusterClusterStorageResourcesConfigNewLustrePerUnitStorageThroughput(original["perUnitStorageThroughput"], d, config)
return []interface{}{transformed}
}
func flattenHypercomputeclusterClusterStorageResourcesConfigNewLustreCapacityGb(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
Expand All @@ -2383,6 +2408,10 @@ func flattenHypercomputeclusterClusterStorageResourcesConfigNewLustreLustre(v in
return v
}

func flattenHypercomputeclusterClusterStorageResourcesConfigNewLustrePerUnitStorageThroughput(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
}

func flattenHypercomputeclusterClusterStorageResourcesFilestore(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
if v == nil {
return nil
Expand Down Expand Up @@ -3673,13 +3702,24 @@ func expandHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclass(v
transformed["enabled"] = transformedEnabled
}

transformedTerminalStorageClass, err := expandHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclassTerminalStorageClass(original["terminal_storage_class"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedTerminalStorageClass); val.IsValid() && !tpgresource.IsEmptyValue(val) {
transformed["terminalStorageClass"] = transformedTerminalStorageClass
}

return transformed, nil
}

func expandHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclassEnabled(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandHypercomputeclusterClusterStorageResourcesConfigNewBucketAutoclassTerminalStorageClass(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandHypercomputeclusterClusterStorageResourcesConfigNewBucketBucket(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
Expand Down Expand Up @@ -3860,6 +3900,13 @@ func expandHypercomputeclusterClusterStorageResourcesConfigNewLustre(v interface
transformed["lustre"] = transformedLustre
}

transformedPerUnitStorageThroughput, err := expandHypercomputeclusterClusterStorageResourcesConfigNewLustrePerUnitStorageThroughput(original["per_unit_storage_throughput"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedPerUnitStorageThroughput); val.IsValid() && !tpgresource.IsEmptyValue(val) {
transformed["perUnitStorageThroughput"] = transformedPerUnitStorageThroughput
}

return transformed, nil
}

Expand All @@ -3879,6 +3926,10 @@ func expandHypercomputeclusterClusterStorageResourcesConfigNewLustreLustre(v int
return v, nil
}

func expandHypercomputeclusterClusterStorageResourcesConfigNewLustrePerUnitStorageThroughput(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandHypercomputeclusterClusterStorageResourcesFilestore(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
if v == nil {
return nil, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ fields:
field: storage_resources.config.existing_lustre.lustre
- api_field: storageResources.value.config.newBucket.autoclass.enabled
field: storage_resources.config.new_bucket.autoclass.enabled
- api_field: storageResources.value.config.newBucket.autoclass.terminalStorageClass
field: storage_resources.config.new_bucket.autoclass.terminal_storage_class
- api_field: storageResources.value.config.newBucket.bucket
field: storage_resources.config.new_bucket.bucket
- api_field: storageResources.value.config.newBucket.hierarchicalNamespace.enabled
Expand All @@ -118,6 +120,8 @@ fields:
field: storage_resources.config.new_lustre.filesystem
- api_field: storageResources.value.config.newLustre.lustre
field: storage_resources.config.new_lustre.lustre
- api_field: storageResources.value.config.newLustre.perUnitStorageThroughput
field: storage_resources.config.new_lustre.per_unit_storage_throughput
- api_field: storageResources.value.filestore.filestore
field: storage_resources.filestore.filestore
- api_field: storageResources.value.lustre.lustre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ resource "google_hypercomputecluster_cluster" "cluster" {
bucket = "bucket-new-2-%{random_suffix}"
autoclass {
enabled = true
terminal_storage_class = "NEARLINE"
}
hierarchical_namespace {
enabled = false
Expand Down Expand Up @@ -559,6 +560,7 @@ resource "google_hypercomputecluster_cluster" "cluster" {
description = "Lustre instance created via Terraform"
filesystem = "lustrefs"
lustre = "projects/${local.project_id}/locations/us-central1-a/instances/lustre-%{random_suffix}"
per_unit_storage_throughput = "1000"
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions website/docs/r/hypercomputecluster_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,13 @@ The following arguments are supported:
(Required)
Enables Auto-class feature.

* `terminal_storage_class` -
(Optional)
Terminal storage class of the autoclass bucket
Possible values:
NEARLINE
ARCHIVE

<a name="nested_storage_resources_config_new_bucket_hierarchical_namespace"></a>The `hierarchical_namespace` block supports:

* `enabled` -
Expand Down Expand Up @@ -780,6 +787,13 @@ The following arguments are supported:
Name of the Managed Lustre instance to create, in the format
`projects/{project}/locations/{location}/instances/{instance}`

* `per_unit_storage_throughput` -
(Optional)
Throughput of the instance in MB/s/TiB. Valid values are 125, 250,
500, 1000. See [Performance tiers and maximum storage
capacities](https://cloud.google.com/managed-lustre/docs/create-instance#performance-tiers)
for more information.

<a name="nested_storage_resources_filestore"></a>The `filestore` block contains:

* `filestore` -
Expand Down
Loading