Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOML Alternative #2379

Closed
mousedownmike opened this issue Nov 14, 2020 · 9 comments
Closed

TOML Alternative #2379

mousedownmike opened this issue Nov 14, 2020 · 9 comments

Comments

@mousedownmike
Copy link

I was initially going to place this as a comment on #2253 but I fear it might sidetrack efforts there so I'm opening a separate ticket.

The issue in #2253 highlights a point of friction I found while trying to learn SAM. The use of TOML for the samconfig file seems unique and arbitrary in the scope of AWS utilities that I've worked with. With the exception of credential files which seem to be TOML-like, I'm not familiar with any other AWS tools that use TOML to the extent that SAM does. In an environment where JSON and YAML are abundant, is it necessary to introduce an additional (and somewhat incompatible) file format? As someone new to SAM, here are my initial observations:

  • The required conversion of hyphens to underscores seems onerous, under-documented and unnecessary.
  • Having configuration data on the CLI, in JSON, YAML and TOML that are all VERY similar looking (parameter_-overrides being a prime example) yet incompatible among formats (i.e. I can't copy and paste) introduces error-prone and time-consuming processes depending on the tasks being worked on.
  • Simple things like maps and lists are made complex and difficult to read in TOML.
  • To the extent TOML is being used in SAM, it isn't clear what benefits it offers over normal JSON and YAML syntax.

Is this a technical decision that is open to review in future CLI revisions? Is it possible to support JSON syntax as an alternative?

I'm enjoying the benefits that I'm getting from adopting SAM in my project but I'm concerned that the developer friction will slow/stall adoption. The YAML heavy format of CloudFormation is already a high hurdle, adding TOML to that seems to introduce more difficulties than it solves.

@qingchm qingchm added type/design stage/pm-review Waiting for review by our Product Manager, please don't work on this yet area/sam-config and removed stage/pm-review Waiting for review by our Product Manager, please don't work on this yet labels Nov 17, 2020
@wchengru wchengru added stage/pm-review Waiting for review by our Product Manager, please don't work on this yet type/feature Feature request labels Nov 20, 2020
@zadowsmash
Copy link

+1 to this.
It would be great to see JSON and YAML support for config files

@dan-me
Copy link

dan-me commented Dec 8, 2020

+1

Agree with everything mousedownmike mentioned, and have had many of the same experiences myself.

@tf-chris-cottingham
Copy link

+1

@Rabadash8820
Copy link
Contributor

I'll also add that TOML, being more of a niche config language, has somewhat worse tooling around it. JSON and YAML have great extensions for syntax highlighting, intellisense, validation, etc. in editors like VS Code. TOML less so.

@wchengru wchengru removed the stage/pm-review Waiting for review by our Product Manager, please don't work on this yet label Nov 21, 2021
@c2tarun
Copy link
Contributor

c2tarun commented Jan 6, 2022

Thanks for raising this feature request. We prioritize features based on 👍's on a request. If this feature impacts you please 👍 the issue instead of adding comment.

Thanks.

@solarmosaic-kflorence
Copy link

The way the TOML configuration works right now makes it practically unusable unless every configuration value you have is static.

@alessandrobologna
Copy link

alessandrobologna commented Feb 18, 2022

I completely agree and I can't understand a rationale for using TOML instead of yaml (or even JSON). For fun, this is how the example at https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html would look like in YAML:

default:
   global:
     parameters:
       stack_name: common-stack
 
   deploy:
     parameters:
       stack_name: my-app-stack
       s3_bucket: my-source-bucket 
       s3_prefix: my-s3-prefix
       image_repositories: 
         my-function-1: image-repo-1
         my-function-2: image-repo-2
       region: us-west-2
       confirm_changeset: true
       capabilities: CAPABILITY_IAM
       tags:
         project: my-application
         stage: production

    build:
      parameters:
        container_env_var: 
           Function1.GITHUB_TOKEN: TOKEN1
           Function2.GITHUB_TOKEN: TOKEN2
      container_env_var_file: env.json
      no_beta_features: true

For someone who is working with SAM and has to use yaml every day, why adding a completely different syntax with a niche config language?

@super132
Copy link
Contributor

Hi all,

We released YAML file format support in SAM Configuration file in v1.91.0. The documentation was updated to show how to define the configuration file in both TOML and YAML format. I'm closing this issue in the favour of this release. Please feel free to open a new ticket if you have questions / problems regarding to the YAML format support. Thanks.

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests