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

Feature request: support aws cli version 2 #52

Open
wppaul opened this issue Apr 27, 2023 · 1 comment
Open

Feature request: support aws cli version 2 #52

wppaul opened this issue Apr 27, 2023 · 1 comment

Comments

@wppaul
Copy link

wppaul commented Apr 27, 2023

Describe the feature
Currently, amaysim/serverless only support aws cli v1, it would be great to have aws cli v1 supported.

The AWS CLI v2 offers several new features including improved installers, new configuration options such as AWS Single Sign-On (SSO), and various interactive features. More importantly, with serverless/serverless#9290, serverless framework still does not support use the ec2 role, so we have to use assume role scripts to make use of underlying ec2 profile inside serverless container, e.g.

role_arn='arn:aws:iam::account_id:role/ec2-role' 
role_session_name='ec2-test'
profile_name='ec2-test'

temp_role=$(aws sts assume-role \
     --role-arn $role_arn \
     --role-session-name $role_session_name)

export AWS_ACCESS_KEY_ID=$(echo $temp_role | jq -r .Credentials.AccessKeyId)
export AWS_SECRET_ACCESS_KEY=$(echo $temp_role | jq -r .Credentials.SecretAccessKey)
export AWS_SESSION_TOKEN=$(echo $temp_role | jq -r .Credentials.SessionToken)

The above scripts can be replaced by https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configure/export-credentials.html with AWS cli version 2.

Additional context
Install aws cli v2 may need some effort to in Alpine as per aws/aws-cli#4685, it is possible as per https://docs.aws.amazon.com/cli/latest/userguide/getting-started-source-install.html - Alpine Linux container

@flemay
Copy link
Collaborator

flemay commented May 30, 2023

Thank you @wppaul for opening this issue. Further analysis will be required to understand the impact of removing v1 for us.

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

No branches or pull requests

2 participants