iterative.Task
Explore with Pulumi AI
# Task Resource
This resource will:
- Create cloud resources (machines and storage) for the task.
- Upload the given
storage.workdir
to the cloud storage. - Run the given
script
on the cloud machine until completion ortimeout
. - Download results to the given
storage.output
.
Create Task Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Task(name: string, args: TaskArgs, opts?: CustomResourceOptions);
@overload
def Task(resource_name: str,
args: TaskArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Task(resource_name: str,
opts: Optional[ResourceOptions] = None,
cloud: Optional[str] = None,
script: Optional[str] = None,
region: Optional[str] = None,
disk_size: Optional[float] = None,
machine: Optional[str] = None,
name: Optional[str] = None,
parallelism: Optional[float] = None,
permission_set: Optional[str] = None,
environment: Optional[Mapping[str, str]] = None,
image: Optional[str] = None,
spot: Optional[float] = None,
storages: Optional[Sequence[TaskStorageArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
task_id: Optional[str] = None,
timeout: Optional[float] = None,
timeouts: Optional[TaskTimeoutsArgs] = None)
func NewTask(ctx *Context, name string, args TaskArgs, opts ...ResourceOption) (*Task, error)
public Task(string name, TaskArgs args, CustomResourceOptions? opts = null)
type: iterative:Task
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TaskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TaskArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TaskArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TaskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TaskArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var taskResource = new Iterative.Task("taskResource", new()
{
Cloud = "string",
Script = "string",
Region = "string",
DiskSize = 0,
Machine = "string",
Name = "string",
Parallelism = 0,
PermissionSet = "string",
Environment =
{
{ "string", "string" },
},
Image = "string",
Spot = 0,
Storages = new[]
{
new Iterative.Inputs.TaskStorageArgs
{
Container = "string",
ContainerOpts =
{
{ "string", "string" },
},
Excludes = new[]
{
"string",
},
Output = "string",
Workdir = "string",
},
},
Tags =
{
{ "string", "string" },
},
TaskId = "string",
Timeout = 0,
Timeouts = new Iterative.Inputs.TaskTimeoutsArgs
{
Create = "string",
Delete = "string",
Read = "string",
Update = "string",
},
});
example, err := iterative.NewTask(ctx, "taskResource", &iterative.TaskArgs{
Cloud: pulumi.String("string"),
Script: pulumi.String("string"),
Region: pulumi.String("string"),
DiskSize: pulumi.Float64(0),
Machine: pulumi.String("string"),
Name: pulumi.String("string"),
Parallelism: pulumi.Float64(0),
PermissionSet: pulumi.String("string"),
Environment: pulumi.StringMap{
"string": pulumi.String("string"),
},
Image: pulumi.String("string"),
Spot: pulumi.Float64(0),
Storages: iterative.TaskStorageArray{
&iterative.TaskStorageArgs{
Container: pulumi.String("string"),
ContainerOpts: pulumi.StringMap{
"string": pulumi.String("string"),
},
Excludes: pulumi.StringArray{
pulumi.String("string"),
},
Output: pulumi.String("string"),
Workdir: pulumi.String("string"),
},
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
TaskId: pulumi.String("string"),
Timeout: pulumi.Float64(0),
Timeouts: &iterative.TaskTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Read: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var taskResource = new Task("taskResource", TaskArgs.builder()
.cloud("string")
.script("string")
.region("string")
.diskSize(0)
.machine("string")
.name("string")
.parallelism(0)
.permissionSet("string")
.environment(Map.of("string", "string"))
.image("string")
.spot(0)
.storages(TaskStorageArgs.builder()
.container("string")
.containerOpts(Map.of("string", "string"))
.excludes("string")
.output("string")
.workdir("string")
.build())
.tags(Map.of("string", "string"))
.taskId("string")
.timeout(0)
.timeouts(TaskTimeoutsArgs.builder()
.create("string")
.delete("string")
.read("string")
.update("string")
.build())
.build());
task_resource = iterative.Task("taskResource",
cloud="string",
script="string",
region="string",
disk_size=0,
machine="string",
name="string",
parallelism=0,
permission_set="string",
environment={
"string": "string",
},
image="string",
spot=0,
storages=[{
"container": "string",
"container_opts": {
"string": "string",
},
"excludes": ["string"],
"output": "string",
"workdir": "string",
}],
tags={
"string": "string",
},
task_id="string",
timeout=0,
timeouts={
"create": "string",
"delete": "string",
"read": "string",
"update": "string",
})
const taskResource = new iterative.Task("taskResource", {
cloud: "string",
script: "string",
region: "string",
diskSize: 0,
machine: "string",
name: "string",
parallelism: 0,
permissionSet: "string",
environment: {
string: "string",
},
image: "string",
spot: 0,
storages: [{
container: "string",
containerOpts: {
string: "string",
},
excludes: ["string"],
output: "string",
workdir: "string",
}],
tags: {
string: "string",
},
taskId: "string",
timeout: 0,
timeouts: {
create: "string",
"delete": "string",
read: "string",
update: "string",
},
});
type: iterative:Task
properties:
cloud: string
diskSize: 0
environment:
string: string
image: string
machine: string
name: string
parallelism: 0
permissionSet: string
region: string
script: string
spot: 0
storages:
- container: string
containerOpts:
string: string
excludes:
- string
output: string
workdir: string
tags:
string: string
taskId: string
timeout: 0
timeouts:
create: string
delete: string
read: string
update: string
Task Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Task resource accepts the following input properties:
- Cloud string
- Script string
- Disk
Size double - Environment Dictionary<string, string>
- Image string
- Machine string
- Name string
- Parallelism double
- Permission
Set string - Region string
- Spot double
- Storages
List<Task
Storage> - Dictionary<string, string>
- Task
Id string - 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. - Timeout double
- Timeouts
Task
Timeouts
- Cloud string
- Script string
- Disk
Size float64 - Environment map[string]string
- Image string
- Machine string
- Name string
- Parallelism float64
- Permission
Set string - Region string
- Spot float64
- Storages
[]Task
Storage Args - map[string]string
- Task
Id string - 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. - Timeout float64
- Timeouts
Task
Timeouts Args
- cloud String
- script String
- disk
Size Double - environment Map<String,String>
- image String
- machine String
- name String
- parallelism Double
- permission
Set String - region String
- spot Double
- storages
List<Task
Storage> - Map<String,String>
- task
Id String - 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. - timeout Double
- timeouts
Task
Timeouts
- cloud string
- script string
- disk
Size number - environment {[key: string]: string}
- image string
- machine string
- name string
- parallelism number
- permission
Set string - region string
- spot number
- storages
Task
Storage[] - {[key: string]: string}
- task
Id string - 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. - timeout number
- timeouts
Task
Timeouts
- cloud str
- script str
- disk_
size float - environment Mapping[str, str]
- image str
- machine str
- name str
- parallelism float
- permission_
set str - region str
- spot float
- storages
Sequence[Task
Storage Args] - Mapping[str, str]
- task_
id str - 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. - timeout float
- timeouts
Task
Timeouts Args
- cloud String
- script String
- disk
Size Number - environment Map<String>
- image String
- machine String
- name String
- parallelism Number
- permission
Set String - region String
- spot Number
- storages List<Property Map>
- Map<String>
- task
Id String - 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. - timeout Number
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Task resource produces the following output properties:
- Addresses List<string>
- IP addresses of the currently active machines.
- Events List<string>
- List of events for the machine orchestrator.
- Id string
- The provider-assigned unique ID for this managed resource.
- Logs List<string>
- List with task logs; one for each machine.
- Ssh
Private stringKey - Used to access the created machines.
- Ssh
Public stringKey - Used to access the created machines.
- Status Dictionary<string, double>
- Status of the machine orchestrator.
- Addresses []string
- IP addresses of the currently active machines.
- Events []string
- List of events for the machine orchestrator.
- Id string
- The provider-assigned unique ID for this managed resource.
- Logs []string
- List with task logs; one for each machine.
- Ssh
Private stringKey - Used to access the created machines.
- Ssh
Public stringKey - Used to access the created machines.
- Status map[string]float64
- Status of the machine orchestrator.
- addresses List<String>
- IP addresses of the currently active machines.
- events List<String>
- List of events for the machine orchestrator.
- id String
- The provider-assigned unique ID for this managed resource.
- logs List<String>
- List with task logs; one for each machine.
- ssh
Private StringKey - Used to access the created machines.
- ssh
Public StringKey - Used to access the created machines.
- status Map<String,Double>
- Status of the machine orchestrator.
- addresses string[]
- IP addresses of the currently active machines.
- events string[]
- List of events for the machine orchestrator.
- id string
- The provider-assigned unique ID for this managed resource.
- logs string[]
- List with task logs; one for each machine.
- ssh
Private stringKey - Used to access the created machines.
- ssh
Public stringKey - Used to access the created machines.
- status {[key: string]: number}
- Status of the machine orchestrator.
- addresses Sequence[str]
- IP addresses of the currently active machines.
- events Sequence[str]
- List of events for the machine orchestrator.
- id str
- The provider-assigned unique ID for this managed resource.
- logs Sequence[str]
- List with task logs; one for each machine.
- ssh_
private_ strkey - Used to access the created machines.
- ssh_
public_ strkey - Used to access the created machines.
- status Mapping[str, float]
- Status of the machine orchestrator.
- addresses List<String>
- IP addresses of the currently active machines.
- events List<String>
- List of events for the machine orchestrator.
- id String
- The provider-assigned unique ID for this managed resource.
- logs List<String>
- List with task logs; one for each machine.
- ssh
Private StringKey - Used to access the created machines.
- ssh
Public StringKey - Used to access the created machines.
- status Map<Number>
- Status of the machine orchestrator.
Look up Existing Task Resource
Get an existing Task resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TaskState, opts?: CustomResourceOptions): Task
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
addresses: Optional[Sequence[str]] = None,
cloud: Optional[str] = None,
disk_size: Optional[float] = None,
environment: Optional[Mapping[str, str]] = None,
events: Optional[Sequence[str]] = None,
image: Optional[str] = None,
logs: Optional[Sequence[str]] = None,
machine: Optional[str] = None,
name: Optional[str] = None,
parallelism: Optional[float] = None,
permission_set: Optional[str] = None,
region: Optional[str] = None,
script: Optional[str] = None,
spot: Optional[float] = None,
ssh_private_key: Optional[str] = None,
ssh_public_key: Optional[str] = None,
status: Optional[Mapping[str, float]] = None,
storages: Optional[Sequence[TaskStorageArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
task_id: Optional[str] = None,
timeout: Optional[float] = None,
timeouts: Optional[TaskTimeoutsArgs] = None) -> Task
func GetTask(ctx *Context, name string, id IDInput, state *TaskState, opts ...ResourceOption) (*Task, error)
public static Task Get(string name, Input<string> id, TaskState? state, CustomResourceOptions? opts = null)
public static Task get(String name, Output<String> id, TaskState state, CustomResourceOptions options)
resources: _: type: iterative:Task get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Addresses List<string>
- IP addresses of the currently active machines.
- Cloud string
- Disk
Size double - Environment Dictionary<string, string>
- Events List<string>
- List of events for the machine orchestrator.
- Image string
- Logs List<string>
- List with task logs; one for each machine.
- Machine string
- Name string
- Parallelism double
- Permission
Set string - Region string
- Script string
- Spot double
- Ssh
Private stringKey - Used to access the created machines.
- Ssh
Public stringKey - Used to access the created machines.
- Status Dictionary<string, double>
- Status of the machine orchestrator.
- Storages
List<Task
Storage> - Dictionary<string, string>
- Task
Id string - 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. - Timeout double
- Timeouts
Task
Timeouts
- Addresses []string
- IP addresses of the currently active machines.
- Cloud string
- Disk
Size float64 - Environment map[string]string
- Events []string
- List of events for the machine orchestrator.
- Image string
- Logs []string
- List with task logs; one for each machine.
- Machine string
- Name string
- Parallelism float64
- Permission
Set string - Region string
- Script string
- Spot float64
- Ssh
Private stringKey - Used to access the created machines.
- Ssh
Public stringKey - Used to access the created machines.
- Status map[string]float64
- Status of the machine orchestrator.
- Storages
[]Task
Storage Args - map[string]string
- Task
Id string - 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. - Timeout float64
- Timeouts
Task
Timeouts Args
- addresses List<String>
- IP addresses of the currently active machines.
- cloud String
- disk
Size Double - environment Map<String,String>
- events List<String>
- List of events for the machine orchestrator.
- image String
- logs List<String>
- List with task logs; one for each machine.
- machine String
- name String
- parallelism Double
- permission
Set String - region String
- script String
- spot Double
- ssh
Private StringKey - Used to access the created machines.
- ssh
Public StringKey - Used to access the created machines.
- status Map<String,Double>
- Status of the machine orchestrator.
- storages
List<Task
Storage> - Map<String,String>
- task
Id String - 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. - timeout Double
- timeouts
Task
Timeouts
- addresses string[]
- IP addresses of the currently active machines.
- cloud string
- disk
Size number - environment {[key: string]: string}
- events string[]
- List of events for the machine orchestrator.
- image string
- logs string[]
- List with task logs; one for each machine.
- machine string
- name string
- parallelism number
- permission
Set string - region string
- script string
- spot number
- ssh
Private stringKey - Used to access the created machines.
- ssh
Public stringKey - Used to access the created machines.
- status {[key: string]: number}
- Status of the machine orchestrator.
- storages
Task
Storage[] - {[key: string]: string}
- task
Id string - 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. - timeout number
- timeouts
Task
Timeouts
- addresses Sequence[str]
- IP addresses of the currently active machines.
- cloud str
- disk_
size float - environment Mapping[str, str]
- events Sequence[str]
- List of events for the machine orchestrator.
- image str
- logs Sequence[str]
- List with task logs; one for each machine.
- machine str
- name str
- parallelism float
- permission_
set str - region str
- script str
- spot float
- ssh_
private_ strkey - Used to access the created machines.
- ssh_
public_ strkey - Used to access the created machines.
- status Mapping[str, float]
- Status of the machine orchestrator.
- storages
Sequence[Task
Storage Args] - Mapping[str, str]
- task_
id str - 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. - timeout float
- timeouts
Task
Timeouts Args
- addresses List<String>
- IP addresses of the currently active machines.
- cloud String
- disk
Size Number - environment Map<String>
- events List<String>
- List of events for the machine orchestrator.
- image String
- logs List<String>
- List with task logs; one for each machine.
- machine String
- name String
- parallelism Number
- permission
Set String - region String
- script String
- spot Number
- ssh
Private StringKey - Used to access the created machines.
- ssh
Public StringKey - Used to access the created machines.
- status Map<Number>
- Status of the machine orchestrator.
- storages List<Property Map>
- Map<String>
- task
Id String - 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. - timeout Number
- timeouts Property Map
Supporting Types
TaskStorage, TaskStorageArgs
- Container string
- Container
Opts Dictionary<string, string> - Excludes List<string>
- Output string
- Workdir string
- Container string
- Container
Opts map[string]string - Excludes []string
- Output string
- Workdir string
- container String
- container
Opts Map<String,String> - excludes List<String>
- output String
- workdir String
- container string
- container
Opts {[key: string]: string} - excludes string[]
- output string
- workdir string
- container str
- container_
opts Mapping[str, str] - excludes Sequence[str]
- output str
- workdir str
- container String
- container
Opts Map<String> - excludes List<String>
- output String
- workdir String
TaskTimeouts, TaskTimeoutsArgs
Package Details
- Repository
- iterative iterative/terraform-provider-iterative
- License
- Notes
- This Pulumi package is based on the
iterative
Terraform Provider.