質問編集履歴

1

テンプレートを削除

2023/03/30 11:18

投稿

hazawa
hazawa

スコア6

test CHANGED
File without changes
test CHANGED
@@ -1,13 +1,11 @@
1
1
  ### 実現したいこと
2
2
 
3
- ここに実現したいことを箇条書きで書いてください。
3
+
4
4
  - [ ] AWS IoT Credential Providerで取得した 一時アクセスキー,シークレットキー,セッショントークンから
5
5
  curlコマンドを利用してcloudfront経由でIAM認証を設定しているAPI gatewayにアクセスしたい
6
6
 
7
7
  ### 前提
8
8
 
9
- ここに質問の内容を詳しく書いてください。
10
- (例)
11
9
  curlコマンドの--aws-sigv4オプションを使用してIAM認証をしているAPI Gatewayに接続したいです。
12
10
  同じアクセスキー,シークレットキー,セッショントークンでAPI Gatewayに直接リクエストはできますが
13
11
  cloud frontに接続しようとするとエラーが出てしまいます。
@@ -20,13 +18,10 @@
20
18
  curl https://d.cloudfront.net/dev --aws-sigv4 "aws:amz:ap-northeast-1:execute-api" -H "X-Amz-Security-Token:token" --user "accessKeyId:secretAccessKey"
21
19
  ```
22
20
  エラーメッセージ
21
+
22
+ {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\n\nThe Canonical String for this request should have been\n'GET\n/dev\n\nhost:egv5fq4y3e.execute-api.ap-northeast-1.amazonaws.com\nx-amz-date:20230330T105359Z\n\nhost;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\nThe String-to-Sign should have been\n'AWS4-HMAC-SHA256\n20230330T105359Z\n20230330/ap-northeast-1/execute-api/aws4_request\na03c859754b8b8f9c94f08e981e3a702e3a7501c36a532636ee560cb2c7261e9'\n"}
23
23
  ```
24
- {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\n\nThe Canonical String for this request should have been\n'GET\n/dev\n\nhost:egv5fq4y3e.execute-api.ap-northeast-1.amazonaws.com\nx-amz-date:20230330T105359Z\n\nhost;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\nThe String-to-Sign should have been\n'AWS4-HMAC-SHA256\n20230330T105359Z\n20230330/ap-northeast-1/execute-api/aws4_request\na03c859754b8b8f9c94f08e981e3a702e3a7501c36a532636ee560cb2c7261e9'\n"}
25
- ### 該当のソースコード
26
24
 
27
- ```ここに言語名を入力
28
- ソースコード
29
- ```
30
25
 
31
26
  ### 試したこと
32
27
 
@@ -34,5 +29,5 @@
34
29
  Host ヘッダーに api gatewayのドメインを追加したところcloudfront経由でも接続することができましたがcloudfrontのみにアクセスを制限するためのAPIキーやリソースベーすポリシーを行うためのカスタムヘッダーが追加されませんでした。
35
30
  ### 補足情報(FW/ツールのバージョンなど)
36
31
 
37
- ここにより詳細な情報を記載してください。
38
32
 
33
+