spacelift-io / terraform-provider-spacelift

Terraform provider to interact with Spacelift
MIT License
74 stars 28 forks source link

Add delete stack and task scheduling resource #354

Closed michieldewilde closed 1 year ago

michieldewilde commented 2 years ago

Description of the change

Add delete stack and task scheduling resource.

resource "spacelift_scheduled_task" "task_every" {
  stack_id = spacelift_stack.test.id

  command    = "terraform apply -auto-approve"
  every      = ["*/15 * * * *"]
  timezone   = "UTC"
}

resource "spacelift_scheduled_task" "task_at" {
  stack_id = spacelift_stack.test.id

  command    = "terraform apply -auto-approve"
  at         = "1661943083"
}

resource "spacelift_scheduled_delete_stack" "delete_stack" {
  stack_id = spacelift_stack.test.id

  at               = "1661943083"
  delete_resources = true
}

To import this resource the following id format has to be used ${stack_id}/${scheduling_id}. Where scheduling_id is the last part of the ID of the scheduling config.

Type of change

Checklists

Development

Code review

adamconnelly commented 2 years ago

@michieldewilde I've converted this to a draft to avoid us getting notified to review it. Can you mark it as ready again when you're ready to merge it?