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

bug: setting the prompted architectures generates an error #162

Open
michaelbrewer opened this issue Dec 14, 2021 · 2 comments
Open

bug: setting the prompted architectures generates an error #162

michaelbrewer opened this issue Dec 14, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@michaelbrewer
Copy link
Contributor

michaelbrewer commented Dec 14, 2021

Issue

I am running SAM CLI, version 1.36.0 and when I try to input the architectures prompted by Cookiecutter I get an Error: Unable to decode to JSON. error. And this might not be intuitive for a first time user

sam init --location cookiecutter-aws-sam-eventbridge-hello-java-gradle
project_name [Your EventBridge Starter app]: x
runtime [java11]:
architectures [default]: arm64
Error: Unable to decode to JSON.

Work around

If I set the input to {"value":["arm64"]} for architectures then this works.

sam init --location cookiecutter-aws-sam-eventbridge-hello-java-gradle
project_name [Your EventBridge Starter app]: x
runtime [java11]:
architectures [default]: {"value":["arm64"]}

Or if I pass in architecture in the cli and not enter anything in architectures:

sam init --location java11/cookiecutter-aws-sam-eventbridge-hello-java-gradle --architecture arm64

Possible Solution

  • Change the architectures in cookiecutter.json to be a simple string value like runtime, this would mean change all of the templates and CLI
@hoffa hoffa added the enhancement New feature or request label Dec 31, 2021
@hawflau
Copy link
Contributor

hawflau commented Jul 4, 2022

Thanks for reporting the issue. I agree this is not very intuitive to use. We will take it internally and discuss how to fix it.

@sleepwithcoffee
Copy link
Contributor

since we only have 2 types of supported architecture x86_64 and arm64. May we suggest user key in x86_64 or arm64 or both?
If both is selected then we generate an array of 2 elements in the generated yaml template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants