| 360 | } |
| 361 | |
| 362 | func (c *Client) CreateBucket(bucket string) error { |
| 363 | var bucketConfiguration *s3.CreateBucketConfiguration |
| 364 | if c.Region != "us-east-1" { |
| 365 | bucketConfiguration = &s3.CreateBucketConfiguration{ |
| 366 | LocationConstraint: aws.String(c.Region), |
| 367 | } |
| 368 | } |
| 369 | _, err := c.S3().CreateBucket(&s3.CreateBucketInput{ |
| 370 | Bucket: aws.String(bucket), |
| 371 | CreateBucketConfiguration: bucketConfiguration, |
| 372 | }) |
| 373 | if err != nil { |
| 374 | return errors.Wrap(err, "creating bucket "+bucket) |
| 375 | } |
| 376 | return nil |
| 377 | } |
| 378 | |
| 379 | func (c *Client) EnableBucketEncryption(bucket string) error { |
| 380 | _, err := c.S3().PutBucketEncryption(&s3.PutBucketEncryptionInput{ |