Skip to content

Feature Request: kyaml_encode functionΒ #2799

@Indigenuity

Description

@Indigenuity

Description

Kubernetes 1.34 has added Alpha support for KYAML. Though the feature is in Alpha, I can see some utility in starting work on a kyaml_encode function, or perhaps support for KYAML in manifest_encode.

Potential Terraform Configuration

locals {
  manifest = {
    apiVersion = "v1"
    kind       = "ConfigMap"
    metadata = {
      name = "example"
    }
    data = {
      EXAMPLE = "example"
    }
  }
}

output "example_output" {
  value = provider::kubernetes::kyaml_encode(local.manifest)
}

Would output:

manifest: {
  apiVersion: "v1",
  kind: "ConfigMap",
  metadata: {
    name: "example",
  },
  data: {
    EXAMPLE: "example",
  },
},

References

The proposed spec seems very similar to HCL without identifiers.

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions