Skip to content

Output of Cloudformation YAML extensions #541

Answered by bioball
patersoz asked this question in Q&A
Discussion options

You must be logged in to vote

This snippet is a YAML explicit tag, followed by a seq:

!Sub
  - String
  - Var1Name: Var1Value
    Var2Name: Var2Value

Right now, our YAML renderer doesn't support directly rendering YAML explicit tags (although you can do whatever you want with a RenderDirective).

So, the better option for Pkl is to render the something like the first snippet, because this is a regular map, where the key is "Fn::Sub", and the value is a seq.

The first snippet can be represented in Pkl like so:

`Fn::Sub` {
  "String"
  new {
    ["Var1Name"] = "Var1Value"
    ["Var2Name"] = "Var2Value"
  }
}

By the way, a pattern you can use here is to define a class that uses a fixed property to define the output, and t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@patersoz
Comment options

@ericzbeard
Comment options

Answer selected by patersoz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants