Skip to content

SAM/CFN json schema: handle of intrinsic functions #2596

Open
@jpinkney-aws

Description

@jpinkney-aws

Is your feature request related to a problem? Please describe.
Right now when we use intrinsic functions in YAML we often get error messages such as:
Incorrect type. Expected "string".

E.g.

AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Resources:
  sample:
    Type: AWS::Logs::MetricFilter
    Properties:
      LogGroupName: !Join [ ":", [ a, b, c ] ] <- Incorrect type. Expected "string"

from #1974 (comment).

This issue can also be seen a couple times in: #1978.

We should work on improving support for intrinsic functions (either in this extension or through VSCode-YAML) so that all YAML is successfully validated.

Describe the solution you'd like
There's a couple quick ideas that might help:

  1. Work with VSCode-YAML to create an API to disable validation when it sees certain intrinsic types
  2. Work with VSCode-YAML to create an API to allow us to provide custom validation on intrinsic values. This means we would be able to validate whether or not an intrinsic function is behaving correctly and provide feedback to YAML writers if there might be an error

Describe alternatives you've considered
See if we can somehow handle intrinsic functions better through this extension

Additional context
Intrinsic function reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws-documentsAWS-specific programming languages, DSLs, filetypes, LSP, JSON schemaaws-documents-sam-cfnLSP or JSON schema for CFN/SAM template yaml/json filesfeature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions