Skip to content

Commit 5bb0688

Browse files
0x2b3bfa0restyled-commitscasperdcl
authored
Document name and id (#475)
* Update task.md * Update getting-started.md * Restyled by prettier-markdown * Reword `id` note * Update getting-started.md * Update task.md * Restyled by prettier-markdown * Apply suggestions from code review Co-authored-by: Casper da Costa-Luis <[email protected]> * Simplify name deprecation * Update task.md * Apply suggestions from code review Co-authored-by: Casper da Costa-Luis <[email protected]> * Apply suggestions from code review Co-authored-by: Casper da Costa-Luis <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Casper da Costa-Luis <[email protected]>
1 parent d1c0b77 commit 5bb0688

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/guides/getting-started.md

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ With spot/preemptible instances (`spot >= 0`), auto-recovery logic and persisten
8787

8888
-> **Note:** A large `workdir` may take a long time to upload.
8989

90+
-> **Note:** The [`id`](https://registry.terraform.io/providers/iterative/iterative/latest/docs/resources/task#id) returned by `terraform apply` (i.e. `[id=tpi-···]`) can be used to locate the created cloud resources through the cloud's web console or command–line tool.
91+
9092
## Query Status
9193

9294
```console

docs/resources/task.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ This resource will:
1111

1212
```hcl
1313
resource "iterative_task" "example" {
14-
name = "example"
1514
cloud = "aws"
1615
machine = "m" # medium. Or any of: l, xl, m+k80, xl+v100, ...
1716
image = "ubuntu"
@@ -43,7 +42,6 @@ resource "iterative_task" "example" {
4342

4443
### Optional
4544

46-
- `name` - (Optional) Deterministic task name.
4745
- `region` - (Optional) [Cloud region/zone](#cloud-regions) to run the task on.
4846
- `machine` - (Optional) See [Machine Types](#machine-types) below.
4947
- `disk_size` - (Optional) Size of the ephemeral machine storage in GB.
@@ -54,21 +52,23 @@ resource "iterative_task" "example" {
5452
- `storage.output` - (Optional) Results directory (**relative to `workdir`**) to download (default: no download).
5553
- `environment` - (Optional) Map of environment variable names and values for the task script. Empty string values are replaced with local environment values. Empty values may also be combined with a [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) name to import all matching variables.
5654
- `timeout` - (Optional) Maximum number of seconds to run before termination.
55+
- `name` - (Optional) Discouraged and may be removed in future. Deterministic task name (e.g. `name="Hello, World!"` always produces `id="tpi-hello-world-5kz6ldls-57wo7rsp"`).
5756

5857
-> **Note:** `output` is relative to `workdir`, so `storage { workdir = "foo", output = "bar" }` means "upload `./foo/`, change working directory to the uploaded folder, run `script`, and download `bar` (i.e. `./foo/bar`)".
5958

6059
## Attribute Reference
6160

6261
In addition to all arguments above, the following attributes are exported:
6362

63+
- `id` - Task identifier, `tpi-{name}-{random_hash_1}-{random_hash_2}`. Either the full `{id}` or (if too long), the shorter `{random_hash_1}{random_hash_2}` is used as the name for all cloud resources.
6464
- `ssh_public_key` - Used to access the created machines.
6565
- `ssh_private_key` - Used to access the created machines.
6666
- `addresses` - IP addresses of the currently active machines.
6767
- `status` - Status of the machine orchestrator.
6868
- `events` - List of events for the machine orchestrator.
6969
- `logs` - List with task logs; one for each machine.
7070

71-
~> **Warning:** Status and events don't produce a stable output between cloud providers and are intended for human consumption only.
71+
~> **Warning:** `events` have different formats across cloud providers and cannot be relied on for programmatic consumption/automation.
7272

7373
## Machine Type
7474

0 commit comments

Comments
 (0)