Skip to content

Commit f953612

Browse files
0x2b3bfa0casperdcl
andauthored
Improve basic example (#375)
Co-authored-by: Casper da Costa-Luis <casper.dcl@physics.org>
1 parent 5e4b037 commit f953612

File tree

2 files changed

+11
-40
lines changed

2 files changed

+11
-40
lines changed

README.md

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,16 @@ The Iterative Provider makes it easy to:
1212
- Unify configuration of various cloud compute providers
1313
- Automatically destroy unused cloud resources (never forget to turn your GPU off again)
1414

15-
## Prerequisites
16-
17-
To use the Iterative Provider you will need to:
18-
19-
- [Install Terraform 1.0+](https://learn.hashicorp.com/tutorials/terraform/install-cli#install-terraform)
20-
- Create an account with your preferred cloud compute provider and expose its [authentication credentials via environment variables](https://registry.terraform.io/providers/iterative/iterative/latest/docs#authentication)
21-
2215
The Iterative Provider can provision resources with the following cloud providers and orchestrators:
2316

2417
- Amazon Web Services
2518
- Microsoft Azure
2619
- Google Cloud Platform
2720
- Kubernetes
2821

29-
## Example usage
30-
31-
```
32-
terraform {
33-
required_providers {
34-
iterative = {
35-
source = "iterative/iterative"
36-
}
37-
}
38-
}
39-
40-
provider "iterative" {}
41-
42-
resource "iterative_task" "example" {
43-
name = "example"
44-
cloud = "aws"
45-
machine = "m+v100"
46-
47-
script = <<-END
48-
#!/bin/bash
49-
echo "hello!"
50-
END
51-
}
52-
```
53-
5422
## Documentation
5523

56-
More details on configuring and using the Iterative Provider are in the [documentation](https://registry.terraform.io/providers/iterative/iterative/latest/docs).
24+
See the [Getting Started](https://registry.terraform.io/providers/iterative/iterative/latest/docs/guides/getting-started) guide to learn how to use the Iterative Provider. More details on configuring and using the Iterative Provider are in the [documentation](https://registry.terraform.io/providers/iterative/iterative/latest/docs).
5725

5826
## Support
5927

docs/guides/getting-started.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ page_title: Getting Started
44

55
# Getting Started
66

7-
Begin by [installing Terraform 1.0 or greater](https://learn.hashicorp.com/tutorials/terraform/install-cli#install-terraform) if needed.
7+
To use the Iterative Provider you will need to:
8+
9+
- [Install Terraform 1.0](https://learn.hashicorp.com/tutorials/terraform/install-cli#install-terraform) or greater
10+
- Create an account with your preferred cloud compute provider and expose its [authentication credentials via environment variables](https://registry.terraform.io/providers/iterative/iterative/latest/docs#authentication)
811

912
## Defining a Task
1013

@@ -19,8 +22,10 @@ terraform {
1922
}
2023
provider "iterative" {}
2124
resource "iterative_task" "task" {
22-
name = "example"
23-
cloud = "aws" # or any of: gcp, az, k8s
25+
name = "example"
26+
cloud = "aws" # or any of: gcp, az, k8s
27+
machine = "m"
28+
2429
workdir {
2530
input = "${path.root}/shared"
2631
}
@@ -31,6 +36,8 @@ resource "iterative_task" "task" {
3136
}
3237
```
3338

39+
See [the reference](https://registry.terraform.io/providers/iterative/iterative/latest/docs/resources/task) for a full list of options -- including more information on [`machine` types](https://registry.terraform.io/providers/iterative/iterative/latest/docs/resources/task#machine-type).
40+
3441
-> **Note:** The `script` argument can take any string, including a [heredoc](https://www.terraform.io/docs/language/expressions/strings.html#heredoc-strings) or the contents of a file returned by the [`file`](https://www.terraform.io/docs/language/functions/file.html) function.
3542

3643
The project layout should look similar to this:
@@ -59,7 +66,6 @@ This command will:
5966

6067
```console
6168
$ terraform apply
62-
···
6369
```
6470

6571
This command will:
@@ -72,9 +78,6 @@ This command will:
7278

7379
```console
7480
$ terraform refresh && terraform show
75-
resource "iterative_task" "example" {
76-
···
77-
}
7881
```
7982

8083
This command will:

0 commit comments

Comments
 (0)