"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/service/s3"
//// create a configuration
Credentials: credentials.NewStaticCredentials("filebase-access-key", "filebase-secret-key", ""),
Endpoint: aws.String("https://s3.filebase.com"),
Region: aws.String("us-east-1"),
S3ForcePathStyle: aws.Bool(true),
// create a new session using the config above and profile
goSession, err := session.NewSessionWithOptions(session.Options{
// check if the session was created correctly.
// create a s3 client session
s3Client := s3.New(goSession)
//set the file path to upload
file, err := os.Open("/path/to/object/to/upload")
// create put object input
putObjectInput := &s3.PutObjectInput{
Bucket: aws.String("bucket-name"),
Key: aws.String("object-name"),
_, err = s3Client.PutObject(putObjectInput)
// print if there is an error