-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sam deploy command option for different config file #1615
Comments
This is a good feature request. We had made the explicit decision to skip this to support more automatic resolution mechanisms of the config file. What do you think about an automatic resolution mechanism where you specify the env |
@sanathkr That would work for my use case 👍 |
I like to have multiple stacks in my application repo (e.g. splitting front-end and back-end resources), so I don't think the Really I just want to be able to support a custom configuration file name, so that I can specify where to load settings from, just like I would when specifying different template files - it feels like there is always going to be a 1:1 mapping between template file and config file, so why not support specifying them the same way? |
I agree with @rowanu. I'd rather start with a simple generic mechanism, |
Additionally, with the ability to use a separate configuration file should come the ability for "guided" mode to not actually deploy but write the values to a new config file location. |
I need multiple configs for all of:
I can accomplish all of them with |
I would also be in favor of being able to define multiple profiles inside of a single Does this belong in a separate issue? |
It seems there is a hidden feature (or at least not yet documented) here with "--config-env" : [default.validate.parameters]
template_file = "template-dev.yaml"
[prod.validate.parameters]
template_file = "template-prod.yaml" $ sam validate
template-dev.yaml is a valid SAM Template
$ sam validate --config-env prod
template-prod.yaml is a valid SAM Template :) |
@darylounet I would not rely on this at the moment. I think we initially had some design but pulled it out to start with the single config file. See #1615 (comment) above. |
@jfuss however I really think it's the good way to go. I have 5 environments, it's ridiculous to have 5 files, don't you think ? |
@jfuss I'm not against adding a config-file option, but I'm totally in favor of the undocumented feature @darylounet points out. I think there are use cases for both, but the current I will, however, point out that the label of "environment" is semantic to the application itself. What we are really talking about are stack labels. I recommend implementing |
@darylounet We haven't made a decision on what is best here. There are defiantly case for both solutions. @sbbowers We are planning on removing, as this was never meant to be available: #1769 Originally, we thought about this but didn't have enough to understand if this was the right choice. It was meant to be hidden in the code to be able to expand later not hidden and still available from the command line. This is why it is not documented, because it was never meant to be there. |
It seems like the two cases are compatible. Separate quibble: it seems like because of the similarity with the AWS CLI config files, it should maybe be a "profile", not an "env". It doesn't have to be a separate environment, it could just be a different bucket to use within the same environment, or even literally just using a different credentials profile. |
I agree with @benkehoe. I would love to see this feature, and I think guided mode without an actual deployment would be helpful too. Also, having a bit more docs explaining what are the allowed/expected params in this samconfig.toml file would be excellent. |
Has anyone come up with a workaround for this in the meantime? How do you manage pushing to dev / test environments? Having to use Edit: Oh, just found this:
from https://aws.amazon.com/blogs/compute/a-simpler-deployment-experience-with-aws-sam-cli/ I think I can work with that... |
It is surprising to remove a workaround possibility from your users before even proposing a solution ... cd "$(dirname "$(which sam)" )/../lib/python/site-packages"
wget https://github.com/awslabs/aws-sam-cli/commit/1b7b4c9b11b5149b333d1dd20458293d5d4af6d4.patch
patch -R samcli/cli/cli_config_file.py 1b7b4c9b11b5149b333d1dd20458293d5d4af6d4.patch
rm 1b7b4c9b11b5149b333d1dd20458293d5d4af6d4.patch |
This option with different config file would be definitely good to have! |
What is the issue with the |
I'm going to throw my support behind @benkehoe for having a file path option and not just setting an env. |
@benkehoe We also would like to have this functionality. As we are working in a Landing Zone where we do have staging accounts (DEV, TEST, PROD) for each product, we would like to deploy a SAM application via CICD with a separate samconfig.toml for each account. |
To be clear, I think SAM CLI should support both configuring the "env" that selects sets of content from within the |
From our personal perspective we would like to configure the location of samconfig.toml , since we would use a separate git repo where we want to place the samconfig.toml of the environment (dev1, dev2). So the support to configure an env section inside of the samconfig.toml is not neccessary in our use case. |
It seems one of the points of having a Therefore, IMO, it appears to be an unexpected choice to have multiple At this point, I just want something. |
This feature has now been released. Apologies, the SAM cli docs will not be available for this new functionality until tomorrow ( 9/24 ). |
Describe your idea/feature/enhancement
I'd like to be able to have multiple different samconfig.toml files for deploying to different environments in my CI/CD process.
Proposal
Add an option flag to
sam deploy
that allows a user to specify a path to asamconfig.toml
path, like so:The guided mode should also be updated to ask for the path name, possible right after the
Save arguments to samconfig.toml:
input step.The text was updated successfully, but these errors were encountered: