1

Fog を使用して S3 バケットの内容を一覧表示しようとしていますが、一定のエラーが発生します。

The request signature we calculated does not match the signature you provided. Check your key and signing method.

セットアップの詳細

EC2 インスタンス

IAM ロール「S3BucketAccess」:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:Get*",
        "s3:List*"
      ],
      "Resource": [
        "arn:aws:s3:::*",
        "arn:aws:s3:::mybucket/*",
        "arn:aws:s3:::mybucket/deploy",
        "arn:aws:s3:::mybucket/deploy/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": "s3:ListAllMyBuckets",
      "Resource": "arn:aws:s3:::*"
    }
  ]
}

169.254.169.254/latest/meta-data/iam/security-credentials/S3BucketAccess

{
  "Code" : "Success",
  "LastUpdated" : "2013-06-28T11:54:08Z",
  "Type" : "AWS-HMAC",
  "AccessKeyId" : "XXXXXXXXXX",
  "SecretAccessKey" : "YYYYYYYYYY",
  "Token" : "ALongToken",
  "Expiration" : "2013-06-28T18:15:09Z"
}

Ruby コード:

require 'rubygems'
require 'fog'
connection = Fog::Storage::AWS.new({:use_iam_profile => true})
p connection.directories

上記のエラー コードを含む厄介なエラー メッセージ/スタック トレースを取得します。

4

2 に答える 2