-
Notifications
You must be signed in to change notification settings - Fork 821
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
Amplify init fails in headless mode and configLevel=general on EC2 #11974
Comments
Hey @vladimirjaric, thank you for reaching out. Wanted to get some information. Currently, is the AWS profile in the credentials and config file set/named as |
Hi @ykethan, thank you for responding promptly. EC2 instance uses credentials from the IAM role rather than the
Let me know if you need any other info. Thanks |
Hey @vladimirjaric, interesting. I was able to reproduce the issue in Amazon Linux2 EC2 instance. To mitigate the issue, could you run
Note: if you observe an error After the user have been configure you can the run the headless command as posted with the
Could you let us know how was the AWS credential configured with the role? As in my reproduction on creating a new EC2 instance I observed an empty list when running |
Hi @ykethan, as soon as an IAM role is attached to an EC2 instance Sorry, perhaps I was not clear with my initial description... I agree
The issue I am reporting here is that AWS CLI works with the above IAM role, i.e. Many thanks |
Hey @vladimirjaric, thank you for the information. Currently, Amplify CLI expects the temporary credentials to be stored in |
Hi @ykethan, thank you for clarifying. Cheers |
|
How did you install the Amplify CLI?
curl
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
10.7.1
What operating system are you using?
Amazon Linux 2
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
Running
amplify init
in headless mode andconfigLevel=general
on an EC2 instance returnsFailed to resolve AWS credentials with --yes flag.
If
--yes
parameter is removed, the following prompt is received:? Initialize the project with the above configuration? Yes
? Select the authentication method you want to use: (Use arrow keys)
❯ AWS profile
AWS access keys
The command works ok on the same EC2 instance in headless mode when
configLevel=project
anduseProfile=false
,region
,accessKeyId
, andsecretAccessKey
are provided, as described in #9986 (comment)The command also works ok on a local Ubuntu laptop in headless mode and
configLevel=general
when AWS credentials are obtained withaws sso login
.Here is the EC2 instance trace, running
amplify init
with and without the--yes
flag:Expected behavior
Reproduction steps
amplify
usingcurl -sL https://aws-amplify.github.io/amplify-cli/install | bash
amplify init --amplify "{\"projectName\":\"ampapp\",\"envName\":\"devel\",\"defaultEditor\":\"vscode\"}" --providers "{\"awscloudformation\":{\"configLevel\":\"general\"}}" --frontend "{\"frontend\":\"flutter\",\"config\":{\"ResDir\":\"./lib/\"}}" --yes
Failed to resolve AWS credentials with --yes flag.
amplify init --amplify "{\"projectName\":\"ampapp\",\"envName\":\"devel\",\"defaultEditor\":\"vscode\"}" --providers "{\"awscloudformation\":{\"configLevel\":\"general\"}}" --frontend "{\"frontend\":\"flutter\",\"config\":{\"ResDir\":\"./lib/\"}}"
Missing region in config
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: