aws
2022-09-13
Read More
2022-09-05
2022-08-18
近期在修改 api-gateway 中 custom authorizer 回傳的錯誤訊息。
原本是希望可以回傳 http status code 400 的錯誤,試了一段時間後。因為是以 custom authorizer 的方式實作,在 auth 中,僅能回傳 401 & 403 的錯誤
Reference
- Introducing custom authorizers in Amazon API Gateway | AWS Compute Blog overall 的說明 blog
- awslabs/aws-apigateway-lambda-authorizer-blueprints: Blueprints and examples for Lambda-based custom Authorizers for use in API Gateway. 以這份參考,來修改 python custom authorizer 的實作
- Use API Gateway Lambda authorizers - Amazon API Gateway 使用 lambda 來實作 api-gateway custom authorizer 的說明文件
- Output from an Amazon API Gateway Lambda authorizer - Amazon API Gateway lambda authorizer 回傳的結果。
- 其中回傳 json 中,所帶的
context
資料,會傳到下個 lambda 的event
變數中
- 其中回傳 json 中,所帶的
2022-08-17
Read More
2022-08-17
ssh tunnel 設定的參考
ssh -i <identity_file> -f -l <bastion-host-username> -L <local-port-you-connect-to>:<rds-endpoint>:<rds:listening-port> <bastion-host-public-ip> -v
- Example Command
ssh -i "private_key.pem" -f -l ec2-user -L 5432:172.31.39.62:5432 3.133.141.189 -v
Reference
- Connect to an Amazon RDS DB instance using a bastion host from a Linux machine
- 有成功使用 Syntax 1 的方式連
- Using a Jump host to access an RDS database in a private subnet
- Simplify your day with SSH config file entries and self closing tunnels
- 原本想說直接設定在 ssh config 就好,不過,試的過程有遇到問題,還試不出來
2022-08-16
Read More
2022-08-12
Read More
2022-08-12
近期的 project 使用 AWS CloudFront 為前端,來拉儲存在 S3 中的資料,以提供一個 web server 的方式
上傳 server.ini 後,使用 browser 瀏覽時會變成是下載檔案,查詢後,發現是 MIME 的原因
Reference
- Working with object metadata - Amazon Simple Storage Service
- System-defined metadata,default 的 content-type 為
binary/octet-stream
- System-defined metadata,default 的 content-type 為
- How can I change the MIME/Content-Type associated with my objects stored in Wasabi? – Wasabi Knowledge Base
- How to set correct MIME type on videos in Amazon S3
2022-08-05
最近有發生在 query aws dynamodb 時,有看到在 Query & Delete 時出現很久的情形
在 query & delete 一個很小的 table 時,出現需要 5 second 的情形
有找了一下,dynamodb 相關的 tunning 資料
Reference
2022-07-07
Read More