Aws_transfer_workflow resource syntax example for multiple steps

I just can’t for the life of me get this to work. Example in the docs are as follows:

resource "aws_transfer_workflow" "example" {
  steps {
    delete_step_details {
      name                 = "example"
      source_file_location = "$${original.file}"
    }
    type = "DELETE"
  }
}

Workflows support multiple steps, so I would expect multiple steps to be ie. (pseudo code)

resource "aws_transfer_workflow" "example" {
  steps = [ {
    tag_step_details {
      name                 = "tag"
      source_file_location = "$${original.file}"
    }
    type = "TAG"
  },
{
    delete_step_details {
      name                 = "example"
      source_file_location = "$${original.file}"
    }
    type = "DELETE"
  }
]
}

or similar, but anything I’ve tried fails either fmt or validate. Any help is appreciated.

Terraform and AWS provider versions are all latest available.

1 Like

By using terraform import on a workflow I created manually in the console, I managed to figure it out (and raised #27376).

resource "aws_transfer_workflow" "example" {
  steps {
    custom_step_details {
      name                 = "example"
      source_file_location = "$${original.file}"
      target               = aws_lambda_function.example.arn
      timeout_seconds      = 60
    }
    type = "CUSTOM"
  }

  steps {
    tag_step_details {
      name                 = "example"
      source_file_location = "$${original.file}"
      tags {
        key   = "Name"
        value = "Hello World"
      }
    }
    type = "TAG"
  }
}

Hope this helps.