aws secretsmanager get-secret-value --secret-id ${secretId} --profile ${customProfile}
如果没有 --region
选项,上面的代码会失败,但是如果没有区域选项,下面的代码可以工作
aws s3api get-bucket-encryption --bucket ${s3Bucket} --profile ${customProfile}
想知道上面的解释是什么。一种合理的解释是,失败是因为 s3 存储桶名称是全局唯一的,不需要更多的区域特异性。
S3 存储桶名称是全局唯一的,秘密名称不是。
如果您查看秘密的 arn,您会看到它包含帐户 ID 和区域,这使得 arn 具有全局唯一性。
S3存储桶的arn仅包含前缀
arn:aws:s3
和存储桶名称。