terraform-provider-iterative icon indicating copy to clipboard operation
terraform-provider-iterative copied to clipboard

`task` machine relationship

Open dacbd opened this issue 2 years ago • 4 comments

I was snooping at: https://github.com/iterative/terraform-provider-iterative/pull/340

and I wonder if there are any plans to have the task's "machine" definition accept an iterative_machine definition/resource?

dacbd avatar Jan 08 '22 01:01 dacbd

@dacbd I would like to have built it on top but they are based on different concepts... in any case task like runner has its own hardware definition

DavidGOrtega avatar Jan 08 '22 13:01 DavidGOrtega

I might be wrong but looks like right now the only "hardware" definition consists of the instance type, disk, and base image.

I foresee something like this as a future possibility:


terraform {
    required_providers {
        iterative = {
            source = "iterative/iterative"
        }
    }
}

provider "iterative" {}

resource "iterative_machine" "instance_test" {
    cloud = "aws"
    region = "us-west-2"
    aws_subnet_id = "subnet-qwert2345"
    aws_security_group = "test"
    instance_type = "t1.micro"
    instance_permission_set = "some_S3_role"
    ssh_private = ***
}

resource "iterative_task" "task" {
    name = "test"
    machine = iterative_machine.instance_test.id
    script = file("script.sh")
    workdir {
        input = "."
        output = "./output"
        object_storage = "arn:::mys3/bucket"
    }
}

dacbd avatar Jan 10 '22 19:01 dacbd

Oh yeah! we have already discussed that. Indeed the idea was to be able to use resources within resources. I pretended that also with network and storage resources

https://github.com/iterative/terraform-provider-iterative/issues/89

DavidGOrtega avatar Jan 13 '22 11:01 DavidGOrtega

related: #461

casperdcl avatar Aug 18 '22 09:08 casperdcl