--- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "strettchcloud_compute Resource - terraform-provider-strettchcloud" subcategory: "" description: |- A Strettch Cloud compute instance. --- # strettchcloud_compute (Resource) A Strettch Cloud compute instance. ## Example Usage ```terraform data "strettchcloud_specification" "medium" { vcpus = 2 memory_mb = 4096 } resource "strettchcloud_compute" "web" { host_name = "web-01" image = "UBUNTU-24.04" region = "KGL-1" specification = data.strettchcloud_specification.medium.specification public_keys = ["ssh-ed25519 AAAA..."] with_public_ip = true tags = ["production", "web"] # state defaults to "RUNNING"; set "STOPPED" to keep it powered off. } output "ip" { value = strettchcloud_compute.web.ipv4 } ``` ## Schema ### Required - `host_name` (String) Host name. Updated in place. Must be non-empty with no leading or trailing whitespace. - `image` (String) Image slug, e.g. `UBUNTU-24.04`. Changing it replaces the compute. Catalog validity is checked by the API. - `public_keys` (Set of String) SSH public keys. Cannot change after creation (changing them replaces the compute). Not recoverable on import; the first apply after import writes them in place without a replace. - `region` (String) Region slug, e.g. `KGL-1`. Changing it replaces the compute. Catalog validity is checked by the API. - `specification` (String) Specification slug, e.g. `S-1C-1G`. Raising it resizes the compute in place (upward only; downsizing is an error). The compute is stopped during the resize. ### Optional - `state` (String) Desired power state: `RUNNING` or `STOPPED`. Updated in place via start/stop. Defaults to `RUNNING`. Not sent on create; every new compute starts. - `tags` (List of String) Tags. Updated in place. Each tag must be non-empty with no leading or trailing whitespace. - `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) - `with_public_ip` (Boolean) Whether to attach a public IP. Cannot change after creation (changing it replaces the compute). Defaults to `false`. ### Read-Only - `created_at` (String) Creation timestamp. - `id` (String) Compute id. - `ipv4` (String) Public IPv4 address. - `private_ipv4` (String) Private IPv4 address. - `updated_at` (String) Last update timestamp. ### Nested Schema for `timeouts` Optional: - `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). - `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. - `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). ## Import Import is supported using the following syntax: The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: ```shell # Import an existing compute by its id. The first apply after import plans an # in-place update on public_keys (never a replace); set public_keys in config to # match the key the compute was created with. terraform import strettchcloud_compute.web 325 ```