aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Bug: sam validate does not support language extension

Open napso opened this issue 1 year ago • 11 comments

Description:

sam validate command does not support AWS Language Extensions although it was mentioned to be patched in version 1.56.1.

Also mentioned here

Steps to reproduce:

  1. Create a new project with Poetry: poetry new sam-validate-test
  2. Install aws-sam-cli: poetry add aws-sam-cli
  3. Create a new SAM template with AWS Language Extensions support:

such as:

AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::LanguageExtensions'

Parameters:
...

Resources:
  TestBucket:
  Type: AWS::S3::Bucket
  Properties:
  ... 
    UpdateReplacePolicy: !If [IsDevDeployment, "Delete", "Retain"]
    DeletionPolicy: !If [IsDevDeployment, "Delete", "Retain"]
  1. Validate the SAM template with SAM CLI: sam validate -t template.yaml

Observed result:

The command fails with the following error message:

Error: [InvalidTemplateException('Every DeletionPolicy member must be a string.')] Every DeletionPolicy member must be a string.

Expected result:

There should be no error message

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

SAM CLI, version 1.76.0

❯ sam --info
{
  "version": "1.76.0",
  "system": {
    "python": "3.9.5",
    "os": "Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.31"
  },
  "additional_dependencies": {
    "docker_engine": "Not available",
    "aws_cdk": "2.53.0 (build 7690f43)",
    "terraform": "Not available"
  }
}

napso avatar Mar 08 '23 15:03 napso

Hi @napso, thanks for raising this issue!

SAM CLI doesn't support language extensions with sam validate command as of now, other commands should be working as expected. I will flag this feature request and take it to our PMs.

mndeveci avatar Mar 08 '23 22:03 mndeveci

Hi @napso, thanks for raising this issue!

SAM CLI doesn't support language extensions with sam validate command as of now, other commands should be working as expected. I will flag this feature request and take it to our PMs.

I see, thank you.

napso avatar Mar 09 '23 08:03 napso

other commands should be working as expected.

Unfortunately, sam deploy won't work with language extensions so its not just not limited to sam validate.

francisreyes-tfs avatar Aug 13 '23 18:08 francisreyes-tfs

+1 for this feature

shashanklmurthy avatar Sep 12 '23 16:09 shashanklmurthy

+1 for this, would be nice to get that fixed soon.

haenggi001 avatar Dec 22 '23 08:12 haenggi001

+1 for this, sam publish does not support language extension too.

redaLaanait avatar Feb 05 '24 13:02 redaLaanait

+1 for this

randradas avatar Apr 11 '24 16:04 randradas

I think we need to wait 10 more years until it is fixed. :-)

fade2black avatar Aug 02 '24 16:08 fade2black

sam build does not work either.

fade2black avatar Aug 02 '24 16:08 fade2black

+1 for this

charunik avatar Aug 07 '24 05:08 charunik