S3 存储桶给定名称与物理名称 Cloudformation

S3 bucket given name versus physical name Cloudformation

我创建了一个名为“my-bucket”的存储桶,cloudformation 将其创建为 "StackName-my-bucket-{random text}"。我想从 java 代码中的这个存储桶中读取,如果我不能触及 cloudformation 中的任何内容,什么是正确的访问方式。

假设您无法修改 CloudFormation 模板并且它没有存储桶作为输出变量 - 您可以列出当前 AWS 账户中的存储桶。您需要 s3:ListAllMyBuckets 权限才能这样做。然后您可以搜索您的存储桶名称。如果您需要在多个账户中搜索,您需要在每个账户中承担一个角色。没有“ListAllBucketsInAllAccounts”权限。