Replies: 11 comments 20 replies
-
I like the idea of updating the functionality of the file. I like the proposed ideas with some caveats. I have a few points of feedback.
|
Beta Was this translation helpful? Give feedback.
-
In order:
There's a really weak use case for cascading config files where you want to check a copy into version control as defaults. Currently we handle this with setup instructions in the README file and I'm perfectly happy with that solution |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
At the moment, it is possible to set parameters common to all sections of any given environment in the [dev.global.parameters]
stack_name = "my-app-dev"
resolve_s3 = true
[dev.build.parameters]
use_container = true
[dev.deploy.parameters]
parameter_overrides = "Environment=\"dev\"" However, when defining multiple environments in It would be great if one could set common parameters across environments only once. These could be applied to specific SAM subcommands (e.g. deploy, build), or all subcommands, like the current behaviour of global: [ALL.build.parameters]
use_container = true
resolve_s3 = true
[dev.global.parameters]
stack_name = "my-app-dev"
[dev.deploy.parameters]
# [...]
[prod.global.parameters]
stack_name = "my-app-prod"
[prod.deploy.parameters]
# [...] |
Beta Was this translation helpful? Give feedback.
-
Could a mechanism be added to make sharing configurations easier e.g. point it at your companies GitHub repo or include default settings in projects that are then overridden by local ones or interactively worked through. |
Beta Was this translation helpful? Give feedback.
-
I generally like the ideas proposed here but I wonder if there is something more that we could do to make it so that users don't have to care/know about Using the example in sam-config.md - If the user want's to do the following workflow:
Currently, the suggestion is that the user should pre-populate the config. But that's maybe hard to find/realize it exists and not really top of mind for the user as they are doing their work. Could SAM instead auto-save the users parameters such as the following:
Then, for And for Where this really shines is the next time the user does this flow, they get the full benefits of having pre-populated their Implied in this flow is that the parameters are not saved at the command scope, but higher. Not sure what's right though - environment, global, or something else. This would remove a lot of friction for the user without them actually needing to learn about There's open questions in my head about if this falls apart for certain sam commands or applies less for some parameters that you all would know far better than me. |
Beta Was this translation helpful? Give feedback.
-
A few more requests:
Here serverless-infra is a cloudformation stack deployed to all accounts, and BucketName is a cloudformation output in it. SAM would do a lookup to cloudformation and resolve this prior to deployment. In the future this could be extended to support other lookups like environment variables, Parameter store, etc.
Right now if you specify 5 parameters in samconfig.toml, and a 6th one is sensitive and won't be committed, if you do |
Beta Was this translation helpful? Give feedback.
-
Howdy ya'll! This sounds really nice - I'm excited for evolving the SAM config 🎉 I'm curious what ya'll are considering for the scope of the new config? Will it continue to focus around needed build & local configuration like it is today - or are you thinking it might be more application-specific configuration? Either way - exciting stuff! I spent a while working on the Copilot CLI manifests (the nearest equivalent to SAM configs) and thought I'd share some of our tenets / decisions. Obviously these won't all apply for ya'll - but food for thought! 👩 Tenet 1: Make manifest files portable 💌I don't know if this applies so much to your use-case, but we wanted folks to basically be able to fork a github repository with a copilot application and be able to run This meant that generally, we'd try to keep things parameterized rather than hardcoded. Things like the S3 bucket name would be stored in SSM instead of directly in the manifest, and there'd be a naming convention for the SSM parameters We couldn't always do this with more specific usecases like DNS - but I'm pretty happy with it! But it's important to us to make sure we give our customers a super easy way to handle paramaters like secrets, etc - so using this naming convention scheme in SSM makes it really easy. example of secrets usage Tenet 2: Defaults & Inline documentation 📓Copilot generates a default Tenet 3: You can overwrite anything per environment 🪆Most configuration is universal per environment [or can be easily parameterized] - but for environment specific configuration, we wanted to make it super easy to just overwrite the top level values with custom values per environment. name: api
type: Backend Service
# default for all environments
cpu: 256
memory: 512
count: 2
exec: true
# environment specific values
environments:
prod:
count: 10 |
Beta Was this translation helpful? Give feedback.
-
I'd love to have environment specific variables too but instead of having all in the same file, I was thinking of having them on a separate file just like how it works on react, vue and other popular development frameworks. samconfig.toml # Global file
# Environment specific files
samconfig.dev.toml
samconfig.prd.toml
samconfig.uat.toml
# If we think about it, we can even support developer-specific environments
samconfig.tom.toml
samconfig.john.toml
samconfig.bill.toml If we think about it, this approach offers the following benefits:
|
Beta Was this translation helpful? Give feedback.
-
Hey All! Thanks a ton for the comments! Keep 'em flowing. At this point, we will take the feedback that we have and start building out the design out in the open in the coming weeks. Please continue the discussion ❤️ |
Beta Was this translation helpful? Give feedback.
-
Hi @sriram-mv , just curious which of these ideas have traction with your team and are undergoing development? One of the things that has come up on our end is the following scenario:
VpcConfig:
SecurityGroupIds:
- !ParamStore !Sub /configs/${DeployEnvironment}/DefaultVpcSecurityGroupID
SubnetIds:
- !ParamStore !Sub /configs/${DeployEnvironment}/DefaultVpcSubnet1ID
- !ParamStore !Sub /configs/${DeployEnvironment}/DefaultVpcSubnet2ID |
Beta Was this translation helpful? Give feedback.
-
Status: Proposed
Type: AWS SAM CLI Standards
Created: 1/19/2023
Abstract
The AWS SAM CLI is a powerful tool for developing and deploying Serverless applications, but the current
samconfig.toml
configuration file has several limitations that make it difficult to use for certain use cases. This proposal outlines several improvements that could be made to thesamconfig.toml
file to enhance its functionality and usability.Changes
The proposed changes include (not any particular order):
sam config
command that will allow to view and change the contents of the configuration file based on interactive prompts instead of having to go through the guided deploy flow or through a text editor of choice.samconfig.toml
such that it has extensive IDE format while attempting to make changes in the IDE.yaml
in addition toTOML
specifically due to user feedback at: TOML Alternative #2379samconfig.toml
file is limited, making it difficult for new users to understand how to properly configure applications. Adding more detailed documentation and examples will make it easier for developers to use the AWS SAM CLI.~/.aws-sam/samconfig.toml
→/Users/sam-user/apps/my-app/samconfig.toml
Conclusion
The proposed changes to the
samconfig.toml
file in the AWS SAM CLI would greatly enhance its functionality and usability.We encourage the community to provide feedback on these proposals and contribute to the development of the AWS SAM CLI.
Acknowledgements
Sriram Madapusi Vasudevan would like to thank the community members in advance for providing feedback and suggestions for improving the AWS SAM CLI configuration file.
Beta Was this translation helpful? Give feedback.
All reactions