Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there plans to update pipeline template resource to use native HCL schema #39

Open
KeisukeYamashita opened this issue Dec 27, 2019 · 1 comment

Comments

@KeisukeYamashita
Copy link

What

Currently, pipeline and pipeline_template load JSON file. Are there plans to make theses to native HCL schema?

What

With HCL schema support, we can get diffs, validate inputs and so on.

@max-rocket-internet
Copy link

It would be good to have this but you can use jsonencode now to go from HCL to pipeline data. I tested it and it works well, for example:

resource "spinnaker_pipeline" "load_test" {
  for_each    = local.load_tests
  application = "xxxx"
  name        = "${each.key}-testing-do-not-use"
  pipeline    = jsonencode(local.pipeline_json)
}

locals {
  pipeline_json = {
    appConfig = {}
    isNew = true
    keepWaitingPipelines = false
    limitConcurrent = false
    notifications = []
    parameterConfig = [
      {
        default = "opa"
        description = "The name of the load test in Locust"
        hasOptions = true
        label = "loadtest_name"
        name = "loadtest_name"
        options = [
          {
            value = "myapp"
          }
        ]
        pinned = true
        required = true
      }
    ]
    stages = []
    triggers = []
  }

Also, even when using templatefile, you still get nice diffs of the JSON 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants