首页 > 解决方案 > What user am I when I upload a file to a S3 bucket with the AWS CLI?

问题描述

I'm learning AWS using the AWS CLI and LocalStack.

I'm working with tutorials such as this, which describe how to create a S3 bucket and upload a file to it.

What I'd like to understand is the role of users in relation to AWS commands, and whether or not there is a relationship between a user and a profile (the latter is created when you run the aws configure CLI command).

When I run a AWS CLI command such as aws --endpoint-url=http://localhost:4572 s3 cp ./foo.json s3://my-bucket/path/to/foo.json what user am I running that command as? I have not explicitly created any users using the AWS IAM CLI or by other means. Is a profile implicitly a user? I.e. when I run aws configure, does the default profile created mean a user named default is created in AWS IAM?

标签: amazon-web-servicesamazon-s3amazon-iamaws-clilocalstack

解决方案


嗯,实际上很容易检查。

https://docs.aws.amazon.com/cli/latest/reference/sts/get-caller-identity.html

个人资料是否隐含用户?

不,配置文件就是这样 - 凭据配置文件。无论是用户还是角色,只要这些凭证有效,AWS CLI 就不会在意。

当我运行 aws configure 时,创建的默认配置文件是否意味着在 AWS IAM 中创建了一个名为 default 的用户

从上一点开始,不。IAM 中没有隐含地做任何事情。当您运行时,aws configure您提供已经存在的凭据,而不是相反。


推荐阅读