iterative / terraform-provider-iterative

☁️ Terraform plugin for machine learning workloads: spot instance recovery & auto-termination | AWS, GCP, Azure, Kubernetes
https://registry.terraform.io/providers/iterative/iterative/latest/docs
Apache License 2.0
288 stars 27 forks source link

Separate credentials from other environment variables #583

Closed 0x2b3bfa0 closed 2 years ago

0x2b3bfa0 commented 2 years ago

Closes #561 and fixes #581; not tested locally, waiting for continuous integration to complain if I “committed” some mistake.

dacbd commented 2 years ago

tested with:

terraform {
  required_providers { iterative = { source = "github.com/iterative/iterative" } }
}
provider "iterative" {}
resource "iterative_task" "vscode" {
  #spot      = 0
  timeout   = 24*60*60
  disk_size = 10
  machine   = "t3.small"
  image     = "ubuntu"

  # cloud-specific config
  cloud     = "aws"

  storage {
    workdir = ""
    output  = ""
  } 
  script = <<-END
    #!/bin/bash -x
    apt-get update -y && apt-get install -y ansible git
    ansible-pull --url https://github.com/dacbd/tpi-ansible.git playbook.yml
    env
    aws sts get-caller-identity
    echo "READY"
  END
}