title: AWS S3 presigned URL contains X-Amz-Security-Token
body: <p>I am trying to create a presigned URL for a file in my S3 bucket using go sdk.</p>
  
  <p>When I run the program from command line, I get the presigned URL which doesn't contain the X-Amz-Security-Token.</p>
  
  <p>But if I use the same code from a lambda function, I always get the X-Amz-Security-Token in the URL.</p>
  
  <p>I am not sure why this behaviour is different.</p>
  
  <p>Here is the code -</p>
  
  <pre><code>func CreatePreSignedURL(bucketName string, path string) (string, error) {
  
      sess, err := session.NewSession(&amp;aws.Config{
          Region: aws.String("us-east-1")},
      )
  
      svc := s3.New(sess)
  
      req, _ := svc.GetObjectRequest(&amp;s3.GetObjectInput{
          Bucket: aws.String(bucketName),
          Key:    aws.String(path),
      })
  
      urlStr, err := req.Presign(60 * time.Minute)
  
      if err != nil {
          fmt.Println("error in generarting presigned URL is ", err)
          return urlStr, err
      }
  
      return urlStr, nil
  }
  </code></pre>
  
  <p>The URL generated by lambda is quite long, for my application I am expecting a shorter URL without X-Amz-Security-Token</p>