ec2-instance-connect client does not use session profile credentials
See original GitHub issueDescribe the bug The ec2-instance-connect client uses the default aws profile, not the one specified in the session
Steps to reproduce
b3session = boto3.Session(profile_name='stage')
s3client = b3session.client('s3')
for bucket in s3client.list_buckets():
print(bucket.name) //Will list the stage profile
client = b3session.client('ec2-instance-connect', region_name=instance['region'])
client.send_ssh_public_key( //Will use "default profile"
InstanceId=instance['instanceId'],
SSHPublicKey=key,
AvailabilityZone=instance['az'],
InstanceOSUser=myuser
)
Expected behavior I am expecting ec2-instance-connect client to use the session profile
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Set up EC2 Instance Connect - Amazon Elastic Compute Cloud
You can check for an SSH client by typing ssh at the command line. If your local computer doesn't recognize the command, you...
Read more >AWS SSO Support does not work #17 - GitHub
I currently have SSO credentials using the command aws sso login, which work fine for aws cli (v2) commands, but mssh does not...
Read more >STS — Boto3 Docs 1.26.33 documentation - AWS
Returns a set of temporary security credentials that you can use to access Amazon Web Services resources that you might not normally have...
Read more >Never put AWS temporary credentials in the ... - Ben Kehoe
We need to talk about how AWS credential configuration works. Many people have more than one IAM principal that they use on a...
Read more >Remote Access to EC2 instances, the easy (and secure) way
But there are downsides: ✗ An SSH port on a public IP address will get scanned and credential-stuffed on a near-continuous basis. Your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @stobrien89! After some intense troubleshooting I found out that the error was me not specifying the correct profile when I then tried to connect to the instance (using aws ssm). This one is on me. Thanks for the attention.
Hi @stilren,
Of course—Glad you were able to get it working. Let us know if anything else comes up!