【问题标题】:Get a list of s3 buckets associated with amazon access key using powershell?使用 powershell 获取与亚马逊访问密钥关联的 s3 存储桶列表?
【发布时间】:2015-05-22 03:55:28
【问题描述】:

我尝试在谷歌上搜索如何检索与 Amazon 访问密钥关联的可用 s3 存储桶列表,但要么我搜索的术语有误,要么我没有得到足够的结果。

我有一个访问密钥和秘密密钥,但我不知道与账户或 IAM 用户关联的存储桶名称。

如何使用 Powershell 和 AWS 工具获取可用存储桶名称的列表?

【问题讨论】:

  • 您具体要查找哪些信息?该凭证持有者可见的桶,或凭证持有者负责的桶?
  • 嗨 Anthony,我正在寻找与访问/密钥相关联的用户“可见”和可访问的存储桶。谢谢!

标签: powershell amazon-web-services amazon-s3 aws-powershell


【解决方案1】:

假设您已经按照自己的方式设置了AWS Credentials,您只需调用Get-S3Bucket。这会调用 ListBuckets,并返回您可见的 S3Bucket 对象的集合:

例子:

# With credentials stored in the SDK store:
PS C:\> Get-S3Bucket

CreationDate                                                BucketName
------------                                                ----------
5/20/2015 2:00:00 PM                                        MyBucket1
5/21/2015 4:00:00 PM                                        MyBucket2

 # With credentials passed inline:    
PS C:\> Get-S3Bucket -AccessKey "accKey" -SecretKey "secKey" -Region "us-east-1"

CreationDate                                                BucketName
------------                                                ----------
5/20/2015 2:00:00 PM                                        MyBucket1
5/21/2015 4:00:00 PM                                        MyBucket2

【讨论】:

  • 非常简单!感谢您提供简洁的信息回复。这正是我一直在寻找和希望的!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-05-24
  • 1970-01-01
  • 1970-01-01
  • 2017-03-03
  • 1970-01-01
  • 2017-04-12
  • 1970-01-01
相关资源
最近更新 更多