Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- svc := s3.New(session.New(), aws.NewConfig().WithRegion("ap-northeast-1"))
- req, _ := svc.GetObjectRequest(&s3.GetObjectInput{
- Bucket: aws.String("bucket_name"),
- Key: aws.String("file_path"),
- })
- url, err := req.Presign(time.Hour * 2) // 有効期限を指定して署名付きURLを取得
- if err != nil {
- fmt.Println("Failed to sign request", err)
- }
- fmt.Println(url)
Add Comment
Please, Sign In to add comment