Skip to content

[Enhancement] Support common text parsing / manipulation functions #140

@iann0036

Description

@iann0036

Is your feature request related to a problem? Please describe.

For many resources in CloudFormation, a property block can be defined as a JSON string, rather than a nested block. This makes it impossible to inspect a specific sub-property and enforce a ruleset against it.

Describe the solution you'd like

Add a set of in-built functions that could perform a text-based manipulation, which could include JSON parsing, URL encoding/decoding, and a Regex-style replacement.

when %my_variable is_string {
    let my_parsed_variable = jsonparse %my_variable
}
let my_parsed_variable = urldecode %my_variable
let my_parsed_variable = regexreplace /ab(cd)ef/ %my_variable 'zy$1vu'

Describe alternatives you've considered

Something out-of-band probably, or some complex Regex magic if I hated myself enough.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions