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
23 changes: 23 additions & 0 deletions docs/resources/virtual_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,29 @@ resource "spectrocloud_virtual_cluster" "cluster" {

```

## Import

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import)
to import the resource spectrocloud_virtual_cluster by using its `id` with the Palette `context` separated by a colon. For example:

```terraform
import {
to = spectrocloud_virtual_cluster.example
id = "example_id:context"
}
```

Using `terraform import`, import the cluster using the `cluster_name` or `id` colon separated with `context`. For example:

```console
terraform import spectrocloud_virtual_cluster.example example_id
```

```console
terraform import spectrocloud_virtual_cluster.example cluster_name
```

Refer to the [Import section](/docs#import) to learn more.

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
4 changes: 3 additions & 1 deletion spectrocloud/resource_cluster_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,11 @@ func flattenMachinePoolConfigsAws(machinePools []*models.V1AwsMachinePoolConfig)
oi["max_price"] = machinePool.SpotMarketOptions.MaxPrice
}
// Flatten skip_k8s_upgrade (worker pools only); default "disabled" for backward compat when API omits field
skipK8sUpgrade := "disabled"
if machinePool.SkipK8sUpgrade != nil && *machinePool.SkipK8sUpgrade != "" {
oi["skip_k8s_upgrade"] = *machinePool.SkipK8sUpgrade
skipK8sUpgrade = *machinePool.SkipK8sUpgrade
}
oi["skip_k8s_upgrade"] = skipK8sUpgrade
oi["disk_size_gb"] = int(machinePool.RootDeviceSize)
if machinePool.SubnetIds != nil {
oi["az_subnets"] = machinePool.SubnetIds
Expand Down
1 change: 1 addition & 0 deletions spectrocloud/resource_cluster_aws_flatten_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func TestFlattenMachinePoolConfigsAws(t *testing.T) {
"max": 5,
"instance_type": "t2.micro",
"disk_size_gb": 8,
"skip_k8s_upgrade": "disabled",
"az_subnets": map[string]string{"us-west-2d": "subnet-87654321"},
"update_strategy": "RollingUpdateScaleOut",
"additional_security_groups": []string{"sg-1234567890"},
Expand Down
23 changes: 23 additions & 0 deletions templates/resources/virtual_cluster.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,28 @@ resource "spectrocloud_virtual_cluster" "cluster" {

```

## Import

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import)
to import the resource {{ .Name }} by using its `id` with the Palette `context` separated by a colon. For example:

```terraform
import {
to = {{ .Name }}.example
id = "example_id:context"
}
```

Using `terraform import`, import the cluster using the `cluster_name` or `id` colon separated with `context`. For example:

```console
terraform import {{ .Name }}.example example_id
```

```console
terraform import {{ .Name }}.example cluster_name
```

Refer to the [Import section](/docs#import) to learn more.

{{ .SchemaMarkdown | trimspace }}