question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support instance profile credentials via ec2 metadata service, like aws cli

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m attempting to run the amplify cli on a Jenkins worker, which gets its credentials from its instance profile, not from a ~/.aws/credentials or ~/.aws/config file. I can run aws s3 ls and other aws cli commands just fine, but when I run amplify init, it says “AWS access credentials can not be found.”

Describe the solution you’d like amplify should work automagically just like the aws cli 😃

Describe alternatives you’ve considered Per these docs I could fetch the credentials via the AWS STS API, but that’s a bit of a pain.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
UnleashedMindcommented, Mar 7, 2019

If you configured your EC2 instance to use IAM roles, the Amplify CLI can automatically assume the IAM credentials for your application, eliminating the need to manually provide credentials. This can be done in two ways:

  1. If you are initializing a project, run the amplify init in headless mode and set the awscloudformation provider’s configuration level to be general, see here
  2. After you’ve already initialized a project (probably with other method for credentials), run amplify configure project, and when prompted Do you want to update or remove the project level configuration, select remove. The cli will then automatically assume the EC2 role for your project.
0reactions
github-actions[bot]commented, May 26, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using credentials for Amazon EC2 instance metadata
Each Amazon EC2 instance contains metadata that the AWS CLI can directly query for temporary credentials. When an IAM role is attached to...
Read more >
AWS CLI using Instance Profile Credentials - Stack Overflow
Instance profile credentials – these credentials can be used on EC2 instances with an assigned instance role, and are delivered through the ...
Read more >
How do AWS CLI credential and IAM role for EC2 work?
Like mentioned in the above page, you're usually navigated to use aws configure command to set up your configuration to use the AWS...
Read more >
Using credentials for Amazon EC2 instance metadata
Each Amazon EC2 instance contains metadata that the Amazon CLI can directly query for temporary credentials. When an IAM role is attached to...
Read more >
Authenticating to AWS with Instance Metadata - Gruntwork Blog
Part of the information available in EC2 Metadata are Temporary Access Keys that are automatically provided and rotated by AWS! The permissions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found