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

[Feature Request] Enable deploy parameters to be passed in via JSON, like the aws cli

Open rupe120 opened this issue 5 years ago • 7 comments

Describe your idea/feature/enhancement

When performing a aws cloudformation create-stack the --parameters option can be passed a JSON file

https://docs.aws.amazon.com/cli/latest/reference/cloudformation/create-stack.html

Please enable this functionality for sam deploy

Proposal

If a JSON file refrence is passed like so sam deploy --parameter-overrides <file path>, attempt to read the parameters from the file. The file should follow the same spec as in the aws cli

Additional Details

This would make certain code deployment integrations much easier, being able to refrence a single parameters file from different scripts.

rupe120 avatar Apr 24 '20 13:04 rupe120

We would happily accept a PR for this, otherwise it's on our list of UX issues to fix.

awood45 avatar Jul 24 '20 20:07 awood45

@rupe120 It seems this feature was added to 1.3.2: https://github.com/aws/aws-sam-cli/releases/tag/v1.3.2 Does it solve your issue?

mgrandis avatar Feb 04 '21 23:02 mgrandis

@mgrandis Not quite. If I'm reading the change correctly it pulls the parameters from the toml file.

What I was looking for was the JSON format file import that is supported by CloudFormation. The intention is that JSON is a more accessible format for manipulation in automation. For instance, I can use the JSON format with the jq bash command

rupe120 avatar Feb 05 '21 14:02 rupe120

@rupe120 I knocked this up a little while ago to address my need for the same https://github.com/mokele/template-configuration

mokele avatar Feb 05 '21 14:02 mokele

@mokele There are too many tools to juggle. We are currently using just SAM and AWS cli in our pipeline. I do appreciate the desire to streamline the process, but the added complexity in that solution is less desirable for me than the consolidation of configuration

rupe120 avatar Feb 05 '21 14:02 rupe120

I should have been more specific sorry! I was talking about the --parameter-overrides parameter, it is however not in JSON format:

Optional. A string that contains AWS CloudFormation parameter overrides encoded as key=value pairs." "For example, 'ParameterKey=KeyPairName,ParameterValue=MyKey ParameterKey=InstanceType," "ParameterValue=t1.micro' or KeyPairName=MyKey InstanceType=t1.micro

mgrandis avatar Feb 05 '21 16:02 mgrandis

@mokele I understood what you were saying, which is why I re-highlighted the JSON format that was the primary focus of my proposal

rupe120 avatar Feb 08 '21 13:02 rupe120

hello, do you plan to implement this in close future? Our team is planning to use SAM and it would be great to get this feature in our pipelines :)

bartoszWesolowski avatar Apr 12 '23 14:04 bartoszWesolowski

Duplicate https://github.com/aws/aws-sam-cli/issues/2054

mndeveci avatar Jul 10 '23 21:07 mndeveci

⚠️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.

github-actions[bot] avatar Jul 10 '23 21:07 github-actions[bot]