MCPcopy Create free account
hub / github.com/cortexlabs/cortex / CreateBucket

Method CreateBucket

pkg/lib/aws/s3.go:362–377  ·  view source on GitHub ↗
(bucket string)

Source from the content-addressed store, hash-verified

360}
361
362func (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
379func (c *Client) EnableBucketEncryption(bucket string) error {
380 _, err := c.S3().PutBucketEncryption(&s3.PutBucketEncryptionInput{

Callers 2

createS3BucketIfNotFoundFunction · 0.80

Calls 3

S3Method · 0.95
WrapFunction · 0.92
StringMethod · 0.45

Tested by 1